/** * Given the initiator and port networks, check that they are connected that is either in the same * network or in different networks but routable. * * @param iniNetwork the initiator network * @param portNet the port network * @return true if the port and initiator network are connected. */ public static boolean checkInitiatorAndPortConnected( NetworkLite iniNetwork, NetworkLite portNet) { if (iniNetwork.getId().equals(portNet.getId())) { _log.info( "Both the port and initiator are in the same network {}", iniNetwork.getNativeGuid()); return true; } else if (iniNetwork.hasRoutedNetworks(portNet.getId())) { _log.info( "The port and initiators are in different but routed networks: {} and {}", new Object[] {iniNetwork.getNativeGuid(), portNet.getNativeGuid()}); return true; } _log.info("The port and initiator are not connected."); return false; }
/** * Parses the WWN from the network's Native GUID * * @param network the network * @return the network WWN */ public static String getNetworkWwn(NetworkLite network) { return parseNetworkWwn(network == null ? "" : network.getNativeGuid()); }