public static boolean hasExportMaskForStorageAndVArray(DbClient dbClient,ExportGroup exportGroup,URI storageURI){
  Set<String> storagePortURIsAssociatedWithVArrayAndStorageArray=ExportMaskUtils.getStoragePortUrisAssociatedWithVarrayAndStorageArray(storageURI,exportGroup.getVirtualArray(),dbClient);
  StringSet maskUriSet=exportGroup.getExportMasks();
  if (maskUriSet != null) {
    for (    String maskUriString : maskUriSet) {
      ExportMask mask=dbClient.queryObject(ExportMask.class,URI.create(maskUriString));
      URI maskStorageURI=mask.getStorageDevice();
      if (maskStorageURI.equals(storageURI)) {
        for (        String storagePort : mask.getStoragePorts()) {
          if (storagePortURIsAssociatedWithVArrayAndStorageArray.contains(storagePort))           return true;
        }
      }
    }
  }
  return false;
}

public static boolean hasExportMaskForStorageAndVArray ( DbClient dbClient , ExportGroup exportGroup , URI storageURI ) { Set < String > storagePortURIsAssociatedWithVArrayAndStorageArray = ExportMaskUtils . getStoragePortUrisAssociatedWithVarrayAndStorageArray ( storageURI , exportGroup . getVirtualArray ( ) , dbClient ) ; StringSet maskUriSet = exportGroup . getExportMasks ( ) ; if ( maskUriSet != null ) { for ( String maskUriString : maskUriSet ) { ExportMask mask = dbClient . queryObject ( ExportMask . class , URI . create ( maskUriString ) ) ; URI maskStorageURI = mask . getStorageDevice ( ) ; if ( maskStorageURI . equals ( storageURI ) ) { for ( String storagePort : mask . getStoragePorts ( ) ) { if ( storagePortURIsAssociatedWithVArrayAndStorageArray . contains ( storagePort ) ) return true ; } } } } return false ; }
for a given export group and storage system , this will check wheather there are any export mask exists in storage system which matches export group and storage ports in varray
