@Test public void testGetFixedIPToFloatingNetworksMap() throws Exception { Map<String, List<FloatingNetwork>> fixedIPToFloatingNetworksMap = neutronNetworkingApi.getFixedIPToFloatingNetworksMap(networkInterfaces); Assert.assertEquals(String.format("%s. Network interfaces count not valid", validationError), 1, fixedIPToFloatingNetworksMap.size()); }
public Map<String, List<FloatingNetwork>> getFixedIPToFloatingNetworksMap(NetworkInterface[] networkInterfaces) { String nwInterfacesNullMsg = "Input NetworkInterface array cannot be null"; assertNotNull(networkInterfaces, nwInterfacesNullMsg); Map<String, List<FloatingNetwork>> fixedIPToFloatingNetworksMap = new HashMap<String, List<FloatingNetwork>>(); for (NetworkInterface networkInterface : networkInterfaces) { if (networkInterface.getFloatingNetworks() == null || networkInterface.getFloatingNetworks().getFloatingNetworks() == null || networkInterface.getFloatingNetworks().getFloatingNetworks().length == 0) { continue; } if (networkInterface.getFixedIp() == null || networkInterface.getFixedIp().isEmpty()) { continue; } fixedIPToFloatingNetworksMap.put(networkInterface.getFixedIp(), Arrays.asList(networkInterface.getFloatingNetworks().getFloatingNetworks())); } return fixedIPToFloatingNetworksMap; }
NeutronNetworkingApi implements OpenstackNetworkingApi { public Map<String, List<FloatingNetwork>> getFixedIPToFloatingNetworksMap(NetworkInterface[] networkInterfaces) { String nwInterfacesNullMsg = "Input NetworkInterface array cannot be null"; assertNotNull(networkInterfaces, nwInterfacesNullMsg); Map<String, List<FloatingNetwork>> fixedIPToFloatingNetworksMap = new HashMap<String, List<FloatingNetwork>>(); for (NetworkInterface networkInterface : networkInterfaces) { if (networkInterface.getFloatingNetworks() == null || networkInterface.getFloatingNetworks().getFloatingNetworks() == null || networkInterface.getFloatingNetworks().getFloatingNetworks().length == 0) { continue; } if (networkInterface.getFixedIp() == null || networkInterface.getFixedIp().isEmpty()) { continue; } fixedIPToFloatingNetworksMap.put(networkInterface.getFixedIp(), Arrays.asList(networkInterface.getFloatingNetworks().getFloatingNetworks())); } return fixedIPToFloatingNetworksMap; } }
NeutronNetworkingApi implements OpenstackNetworkingApi { public Map<String, List<FloatingNetwork>> getFixedIPToFloatingNetworksMap(NetworkInterface[] networkInterfaces) { String nwInterfacesNullMsg = "Input NetworkInterface array cannot be null"; assertNotNull(networkInterfaces, nwInterfacesNullMsg); Map<String, List<FloatingNetwork>> fixedIPToFloatingNetworksMap = new HashMap<String, List<FloatingNetwork>>(); for (NetworkInterface networkInterface : networkInterfaces) { if (networkInterface.getFloatingNetworks() == null || networkInterface.getFloatingNetworks().getFloatingNetworks() == null || networkInterface.getFloatingNetworks().getFloatingNetworks().length == 0) { continue; } if (networkInterface.getFixedIp() == null || networkInterface.getFixedIp().isEmpty()) { continue; } fixedIPToFloatingNetworksMap.put(networkInterface.getFixedIp(), Arrays.asList(networkInterface.getFloatingNetworks().getFloatingNetworks())); } return fixedIPToFloatingNetworksMap; } NeutronNetworkingApi(IaasProvider iaasProvider); }
NeutronNetworkingApi implements OpenstackNetworkingApi { public Map<String, List<FloatingNetwork>> getFixedIPToFloatingNetworksMap(NetworkInterface[] networkInterfaces) { String nwInterfacesNullMsg = "Input NetworkInterface array cannot be null"; assertNotNull(networkInterfaces, nwInterfacesNullMsg); Map<String, List<FloatingNetwork>> fixedIPToFloatingNetworksMap = new HashMap<String, List<FloatingNetwork>>(); for (NetworkInterface networkInterface : networkInterfaces) { if (networkInterface.getFloatingNetworks() == null || networkInterface.getFloatingNetworks().getFloatingNetworks() == null || networkInterface.getFloatingNetworks().getFloatingNetworks().length == 0) { continue; } if (networkInterface.getFixedIp() == null || networkInterface.getFixedIp().isEmpty()) { continue; } fixedIPToFloatingNetworksMap.put(networkInterface.getFixedIp(), Arrays.asList(networkInterface.getFloatingNetworks().getFloatingNetworks())); } return fixedIPToFloatingNetworksMap; } NeutronNetworkingApi(IaasProvider iaasProvider); @Override List<String> associateAddresses(NodeMetadata node); @Override String associatePredefinedAddress(NodeMetadata node, String ip); @Override void releaseAddress(String ip); Map<String, List<FloatingNetwork>> getNetworkUuidToFloatingNetworksMap(NetworkInterface[] networkInterfaces); Map<String, List<FloatingNetwork>> getFixedIPToFloatingNetworksMap(NetworkInterface[] networkInterfaces); List<String> getAllPredefinedFloatingIPs(NetworkInterface[] networkInterfaces); }
NeutronNetworkingApi implements OpenstackNetworkingApi { public Map<String, List<FloatingNetwork>> getFixedIPToFloatingNetworksMap(NetworkInterface[] networkInterfaces) { String nwInterfacesNullMsg = "Input NetworkInterface array cannot be null"; assertNotNull(networkInterfaces, nwInterfacesNullMsg); Map<String, List<FloatingNetwork>> fixedIPToFloatingNetworksMap = new HashMap<String, List<FloatingNetwork>>(); for (NetworkInterface networkInterface : networkInterfaces) { if (networkInterface.getFloatingNetworks() == null || networkInterface.getFloatingNetworks().getFloatingNetworks() == null || networkInterface.getFloatingNetworks().getFloatingNetworks().length == 0) { continue; } if (networkInterface.getFixedIp() == null || networkInterface.getFixedIp().isEmpty()) { continue; } fixedIPToFloatingNetworksMap.put(networkInterface.getFixedIp(), Arrays.asList(networkInterface.getFloatingNetworks().getFloatingNetworks())); } return fixedIPToFloatingNetworksMap; } NeutronNetworkingApi(IaasProvider iaasProvider); @Override List<String> associateAddresses(NodeMetadata node); @Override String associatePredefinedAddress(NodeMetadata node, String ip); @Override void releaseAddress(String ip); Map<String, List<FloatingNetwork>> getNetworkUuidToFloatingNetworksMap(NetworkInterface[] networkInterfaces); Map<String, List<FloatingNetwork>> getFixedIPToFloatingNetworksMap(NetworkInterface[] networkInterfaces); List<String> getAllPredefinedFloatingIPs(NetworkInterface[] networkInterfaces);  }