Search in sources :

Example 1 with NameList

use of com.emc.nas.vnxfile.xmlapi.NameList in project coprhd-controller by CoprHD.

the class VNXDataMoverInterfaceProcessor method processNetworkDevice.

/**
 * Process the Network device which are received from XMLAPI server.
 *
 * @param logicalNetworkDevice
 * @param interfacePortMap
 */
private void processNetworkDevice(LogicalNetworkDevice logicalNetworkDevice, Map<String, List<String>> interfacePortMap) {
    // get logical interfaces
    List<String> logicalNetworkList = logicalNetworkDevice.getInterfaces();
    if (logicalNetworkList != null && !logicalNetworkList.isEmpty()) {
        List<String> portList = null;
        for (String interfaceIP : logicalNetworkList) {
            // check interface existing in interfacePortMap
            portList = interfacePortMap.get(interfaceIP);
            if (portList == null) {
                portList = new ArrayList<String>();
            }
            // if virtual device for logicalNetwork device
            if (logicalNetworkDevice.getType() != LogicalDeviceType.PHYSICAL_ETHERNET) {
                // virtual device list
                NameList nameList = logicalNetworkDevice.getVirtualDeviceData().getDevices();
                if (nameList != null) {
                    // physical port for virtual device list
                    List<String> deviceList = nameList.getLi();
                    if (!deviceList.isEmpty()) {
                        portList.addAll(new ArrayList<>(deviceList));
                        interfacePortMap.put(interfaceIP, portList);
                    }
                }
            } else {
                // physical port on LogicalNetworkdevice
                String networkName = logicalNetworkDevice.getName();
                if (networkName != null) {
                    portList.add(new String(networkName));
                    interfacePortMap.put(interfaceIP, portList);
                }
            }
        }
    }
}
Also used : NameList(com.emc.nas.vnxfile.xmlapi.NameList)

Aggregations

NameList (com.emc.nas.vnxfile.xmlapi.NameList)1