@Override public String keyFrom(NetworkAttachment networkAttachment) { return networkAttachment.getNicName(); } }
public String getNicName() { return networkAttachment.getNicName(); }
private Map<String, Set<LogicalNetworkModel>> createNicNameToNetworkModels() { Map<String, Set<LogicalNetworkModel>> nicToNetworks = new HashMap<>(); for (NetworkAttachment networkAttachment : hostSetupNetworksParametersData.getNetworkAttachments()) { String nicName = networkAttachment.getNicName(); if (!nicToNetworks.containsKey(nicName)) { nicToNetworks.put(nicName, new HashSet<LogicalNetworkModel>()); } LogicalNetworkModel networkModel = networkModelByName.get(networkAttachment.getNetworkName()); assert networkModel != null : "network on an attachment should have a logical model"; //$NON-NLS-1$ setVlanDeviceOnNetworkModelIfNeeded(nicName, networkModel); nicToNetworks.get(nicName).add(networkModel); } createModelsForUnamangedNetworks(nicToNetworks); return nicToNetworks; }
public NetworkAttachment(NetworkAttachment networkAttachment) { id = networkAttachment.getId(); nicId = networkAttachment.getNicId(); nicName = networkAttachment.getNicName(); networkId = networkAttachment.getNetworkId(); networkName = networkAttachment.getNetworkName(); ipConfiguration = networkAttachment.getIpConfiguration(); properties = networkAttachment.getProperties(); overrideConfiguration = networkAttachment.isOverrideConfiguration(); reportedConfigurations = networkAttachment.getReportedConfigurations(); }
private void assertNetworkAttachmentEquals(NetworkAttachment expected, NetworkAttachment actual) { assertEquals(expected.getId(), actual.getId()); assertEquals(expected.getNetworkId(), actual.getNetworkId()); assertEquals(expected.getNicId(), actual.getNicId()); assertEquals(expected.getNicName(), actual.getNicName()); assertEquals(expected.getIpConfiguration(), actual.getIpConfiguration()); assertEquals(expected.getProperties().entrySet(), actual.getProperties().entrySet()); assertEquals(expected.getDnsResolverConfiguration(), actual.getDnsResolverConfiguration()); }
@Override public String toString() { return ToStringBuilder.forInstance(this) .append("id", getId()) .append("networkId", getNetworkId()) .append("networkName", getNetworkName()) .append("nicId", getNicId()) .append("nicName", getNicName()) .append("ipConfiguration", getIpConfiguration()) .append("dnsResolverConfiguration", getDnsResolverConfiguration()) .append("properties", getProperties()) .append("overrideConfiguration", isOverrideConfiguration()) .build(); } }