private void processUnManagedMasksForVolumes(com.emc.storageos.db.client.model.StorageSystem storageSystem,Map<URI,HostExportInfo> exportInfosForExistingMasks,List<HostExportInfo> exportInfosForNewMasks,Map<String,URI> unManagedVolumeNativeIdToUriMap,Map<String,URI> managedVolumeNativeIdToUriMap,List<UnManagedExportMask> unManagedExportMasksToUpdate,List<UnManagedExportMask> unManagedExportMasksToCreate,DbClient dbClient){
  log.info("Processing unmanaged volumes: {} .",unManagedVolumeNativeIdToUriMap);
  log.info("Processing masks to update: {} .",exportInfosForExistingMasks);
  for (  Map.Entry<URI,HostExportInfo> entry : exportInfosForExistingMasks.entrySet()) {
    URI maskUri=entry.getKey();
    HostExportInfo exportInfo=entry.getValue();
    Set<String> unManagedVolumesUris=new HashSet<>();
    Set<String> managedVolumesUris=new HashSet<>();
    List<String> volumesNativeIds=exportInfo.getStorageObjectNativeIds();
    for (    String volumeNativeId : volumesNativeIds) {
      URI volumeUri=unManagedVolumeNativeIdToUriMap.get(volumeNativeId);
      if (volumeUri != null) {
        unManagedVolumesUris.add(volumeUri.toString());
      }
 else {
        volumeUri=managedVolumeNativeIdToUriMap.get(volumeNativeId);
        if (volumeUri != null) {
          managedVolumesUris.add(volumeUri.toString());
        }
      }
    }
    UnManagedExportMask unManagedMask=dbClient.queryObject(UnManagedExportMask.class,maskUri);
    StringSet unmangedVolumesInMask=unManagedMask.getUnmanagedVolumeUris();
    if (unmangedVolumesInMask == null) {
      unmangedVolumesInMask=new StringSet();
      unManagedMask.setUnmanagedVolumeUris(unmangedVolumesInMask);
    }
    unmangedVolumesInMask.addAll(unManagedVolumesUris);
    StringSet managedVolumesInMask=unManagedMask.getKnownVolumeUris();
    if (managedVolumesInMask == null) {
      managedVolumesInMask=new StringSet();
      unManagedMask.setKnownVolumeUris(managedVolumesInMask);
    }
    managedVolumesInMask.addAll(managedVolumesUris);
    unManagedExportMasksToUpdate.add(unManagedMask);
  }
  log.info("Processing masks to create: {} .",exportInfosForNewMasks);
  for (  HostExportInfo hostExportInfo : exportInfosForNewMasks) {
    Set<String> unManagedVolumesUris=new HashSet<>();
    Set<String> managedVolumesUris=new HashSet<>();
    List<String> volumesNativeIds=hostExportInfo.getStorageObjectNativeIds();
    for (    String volumeNativeId : volumesNativeIds) {
      URI volumeUri=unManagedVolumeNativeIdToUriMap.get(volumeNativeId);
      if (volumeUri != null) {
        unManagedVolumesUris.add(volumeUri.toString());
      }
 else {
        volumeUri=managedVolumeNativeIdToUriMap.get(volumeNativeId);
        if (volumeUri != null) {
          managedVolumesUris.add(volumeUri.toString());
        }
      }
    }
    UnManagedExportMask newMask=createUnManagedExportMask(storageSystem,hostExportInfo,unManagedVolumesUris,managedVolumesUris,dbClient);
    unManagedExportMasksToCreate.add(newMask);
  }
}

private void processUnManagedMasksForVolumes ( com . emc . storageos . db . client . model . StorageSystem storageSystem , Map < URI , HostExportInfo > exportInfosForExistingMasks , List < HostExportInfo > exportInfosForNewMasks , Map < String , URI > unManagedVolumeNativeIdToUriMap , Map < String , URI > managedVolumeNativeIdToUriMap , List < UnManagedExportMask > unManagedExportMasksToUpdate , List < UnManagedExportMask > unManagedExportMasksToCreate , DbClient dbClient ) { log . info ( "Processing unmanaged volumes: {} ." , unManagedVolumeNativeIdToUriMap ) ; log . info ( "Processing masks to update: {} ." , exportInfosForExistingMasks ) ; for ( Map . Entry < URI , HostExportInfo > entry : exportInfosForExistingMasks . entrySet ( ) ) { URI maskUri = entry . getKey ( ) ; HostExportInfo exportInfo = entry . getValue ( ) ; Set < String > unManagedVolumesUris = new HashSet < > ( ) ; Set < String > managedVolumesUris = new HashSet < > ( ) ; List < String > volumesNativeIds = exportInfo . getStorageObjectNativeIds ( ) ; for ( String volumeNativeId : volumesNativeIds ) { URI volumeUri = unManagedVolumeNativeIdToUriMap . get ( volumeNativeId ) ; if ( volumeUri != null ) { unManagedVolumesUris . add ( volumeUri . toString ( ) ) ; } else { volumeUri = managedVolumeNativeIdToUriMap . get ( volumeNativeId ) ; if ( volumeUri != null ) { managedVolumesUris . add ( volumeUri . toString ( ) ) ; } } } UnManagedExportMask unManagedMask = dbClient . queryObject ( UnManagedExportMask . class , maskUri ) ; StringSet unmangedVolumesInMask = unManagedMask . getUnmanagedVolumeUris ( ) ; if ( unmangedVolumesInMask == null ) { unmangedVolumesInMask = new StringSet ( ) ; unManagedMask . setUnmanagedVolumeUris ( unmangedVolumesInMask ) ; } unmangedVolumesInMask . addAll ( unManagedVolumesUris ) ; StringSet managedVolumesInMask = unManagedMask . getKnownVolumeUris ( ) ; if ( managedVolumesInMask == null ) { managedVolumesInMask = new StringSet ( ) ; unManagedMask . setKnownVolumeUris ( managedVolumesInMask ) ; } managedVolumesInMask . addAll ( managedVolumesUris ) ; unManagedExportMasksToUpdate . add ( unManagedMask ) ; } log . info ( "Processing masks to create: {} ." , exportInfosForNewMasks ) ; for ( HostExportInfo hostExportInfo : exportInfosForNewMasks ) { Set < String > unManagedVolumesUris = new HashSet < > ( ) ; Set < String > managedVolumesUris = new HashSet < > ( ) ; List < String > volumesNativeIds = hostExportInfo . getStorageObjectNativeIds ( ) ; for ( String volumeNativeId : volumesNativeIds ) { URI volumeUri = unManagedVolumeNativeIdToUriMap . get ( volumeNativeId ) ; if ( volumeUri != null ) { unManagedVolumesUris . add ( volumeUri . toString ( ) ) ; } else { volumeUri = managedVolumeNativeIdToUriMap . get ( volumeNativeId ) ; if ( volumeUri != null ) { managedVolumesUris . add ( volumeUri . toString ( ) ) ; } } } UnManagedExportMask newMask = createUnManagedExportMask ( storageSystem , hostExportInfo , unManagedVolumesUris , managedVolumesUris , dbClient ) ; unManagedExportMasksToCreate . add ( newMask ) ; } }
this method processes export info for volumes and returns unmanaged masks to create and existing unmanaged masks to update .
