private void updateStoragePortsForAddInitiators(ExportMaskAddInitiatorCompleter taskCompleter,StorageSystem system,ExportMask exportMask,List<com.emc.storageos.db.client.model.Initiator> initiatorList,List<com.emc.storageos.db.client.model.StoragePort> selectedPortsForMask,URI virtualArray,ExportPathParams pathParams){
  List<URI> portUris=new ArrayList<>();
  for (  com.emc.storageos.db.client.model.StoragePort port : selectedPortsForMask) {
    portUris.add(port.getId());
  }
  taskCompleter.setTargetURIs(portUris);
  List<URI> initiatorUris=URIUtil.toUris(initiatorList);
  for (  URI initiatorUri : initiatorUris) {
    exportMask.removeZoningMapEntry(initiatorUri.toString());
  }
  Map<URI,List<URI>> assignments=blockScheduler.assignSelectedStoragePorts(system,selectedPortsForMask,virtualArray,initiatorList,pathParams,exportMask.getZoningMap());
  exportMask.addZoningMap(BlockStorageScheduler.getZoneMapFromAssignments(assignments));
  dbClient.updateObject(exportMask);
}

private void updateStoragePortsForAddInitiators ( ExportMaskAddInitiatorCompleter taskCompleter , StorageSystem system , ExportMask exportMask , List < com . emc . storageos . db . client . model . Initiator > initiatorList , List < com . emc . storageos . db . client . model . StoragePort > selectedPortsForMask , URI virtualArray , ExportPathParams pathParams ) { List < URI > portUris = new ArrayList < > ( ) ; for ( com . emc . storageos . db . client . model . StoragePort port : selectedPortsForMask ) { portUris . add ( port . getId ( ) ) ; } taskCompleter . setTargetURIs ( portUris ) ; List < URI > initiatorUris = URIUtil . toUris ( initiatorList ) ; for ( URI initiatorUri : initiatorUris ) { exportMask . removeZoningMapEntry ( initiatorUri . toString ( ) ) ; } Map < URI , List < URI > > assignments = blockScheduler . assignSelectedStoragePorts ( system , selectedPortsForMask , virtualArray , initiatorList , pathParams , exportMask . getZoningMap ( ) ) ; exportMask . addZoningMap ( BlockStorageScheduler . getZoneMapFromAssignments ( assignments ) ) ; dbClient . updateObject ( exportMask ) ; }
this method updates storage ports in export masks for new initiators , based on array selected ports .
