public static void updateConnectedVirtualArrays(Network network,List<StoragePort> storagePorts,boolean isAdd,DbClient dbClient){
  _log.info("Updating connected virtual arrays for network {}",network.getLabel());
  if (isAdd) {
    _log.info("Storage ports were added to network or have virtual arrays added.");
    Set<String> varraysToAdd=new HashSet<String>();
    StringSet networksConnectedVArrays=network.getConnectedVirtualArrays();
    _log.info("Current connected virtual arrays are {} ",networksConnectedVArrays);
    for (    StoragePort storagePort : storagePorts) {
      _log.debug("Processing virtual arrays for storage port {}",storagePort.getNativeGuid());
      StringSet storagePortTaggedVArrays=storagePort.getTaggedVirtualArrays();
      if ((storagePortTaggedVArrays != null) && (!storagePortTaggedVArrays.isEmpty())) {
        for (        String storagePortTaggedVArray : storagePortTaggedVArrays) {
          _log.debug("Storage port assigned to virtual array {}",storagePortTaggedVArray);
          if ((networksConnectedVArrays == null) || (!networksConnectedVArrays.contains(storagePortTaggedVArray))) {
            varraysToAdd.add(storagePortTaggedVArray);
          }
        }
      }
    }
    if (!varraysToAdd.isEmpty()) {
      addNetworkConnectedVarrays(network,varraysToAdd,true,dbClient);
    }
  }
 else {
    _log.info("Storage ports {} removed from network or have had virtual arrays removed");
    setNetworkConnectedVirtualArrays(network,true,dbClient);
  }
}

public static void updateConnectedVirtualArrays ( Network network , List < StoragePort > storagePorts , boolean isAdd , DbClient dbClient ) { _log . info ( "Updating connected virtual arrays for network {}" , network . getLabel ( ) ) ; if ( isAdd ) { _log . info ( "Storage ports were added to network or have virtual arrays added." ) ; Set < String > varraysToAdd = new HashSet < String > ( ) ; StringSet networksConnectedVArrays = network . getConnectedVirtualArrays ( ) ; _log . info ( "Current connected virtual arrays are {} " , networksConnectedVArrays ) ; for ( StoragePort storagePort : storagePorts ) { _log . debug ( "Processing virtual arrays for storage port {}" , storagePort . getNativeGuid ( ) ) ; StringSet storagePortTaggedVArrays = storagePort . getTaggedVirtualArrays ( ) ; if ( ( storagePortTaggedVArrays != null ) && ( ! storagePortTaggedVArrays . isEmpty ( ) ) ) { for ( String storagePortTaggedVArray : storagePortTaggedVArrays ) { _log . debug ( "Storage port assigned to virtual array {}" , storagePortTaggedVArray ) ; if ( ( networksConnectedVArrays == null ) || ( ! networksConnectedVArrays . contains ( storagePortTaggedVArray ) ) ) { varraysToAdd . add ( storagePortTaggedVArray ) ; } } } } if ( ! varraysToAdd . isEmpty ( ) ) { addNetworkConnectedVarrays ( network , varraysToAdd , true , dbClient ) ; } } else { _log . info ( "Storage ports {} removed from network or have had virtual arrays removed" ) ; setNetworkConnectedVirtualArrays ( network , true , dbClient ) ; } }
updates the implicitly connected virtual arrays for the passed network , if necessary , based on the passed storage ports . this update is needed when ports ' varrays are changed or when ports are added or removed from a network . if the affected network is routed to other networks , this function will also check if any updates are needed for the routed networks .
