public static boolean validateExportMaskMatchesComputeResourceInitiators(DbClient dbClient,ExportGroup exportGroup,StringSet computeInitiators,UnManagedExportMask unManagedExportMask,List<String> errorMessages){
  if (computeInitiators == null) {
    String errorMessage=String.format("ExportGroup %s has no initiators and therefore unmanaged export mask %s can't be ingested with it.",exportGroup.getLabel(),unManagedExportMask.getMaskName());
    errorMessages.add(errorMessage.toString());
    _logger.warn(errorMessage);
    return false;
  }
  if (unManagedExportMask.getKnownInitiatorUris() == null) {
    String errorMessage=String.format("Unmanaged export mask %s has no initiators and therefore it can't be ingested.  (ExportGroup: %s)",unManagedExportMask.getMaskName(),exportGroup.getLabel());
    errorMessages.add(errorMessage.toString());
    _logger.warn(errorMessage);
    return false;
  }
  if (StringSetUtil.hasIntersection(unManagedExportMask.getKnownInitiatorUris(),computeInitiators)) {
    String message=String.format("Unmanaged export mask has initiators that match the export group (%s) initiators and therefore will be attempted to be ingested.",unManagedExportMask.getMaskName(),exportGroup.getLabel());
    _logger.info(message);
    return true;
  }
  String errorMessage=String.format("ExportGroup %s has no initiators that match unmanaged export mask %s and therefore can't be ingested with it.",exportGroup.getLabel(),unManagedExportMask.getMaskName());
  errorMessages.add(errorMessage.toString());
  _logger.warn(errorMessage);
  return false;
}

public static boolean validateExportMaskMatchesComputeResourceInitiators ( DbClient dbClient , ExportGroup exportGroup , StringSet computeInitiators , UnManagedExportMask unManagedExportMask , List < String > errorMessages ) { if ( computeInitiators == null ) { String errorMessage = String . format ( "ExportGroup %s has no initiators and therefore unmanaged export mask %s can't be ingested with it." , exportGroup . getLabel ( ) , unManagedExportMask . getMaskName ( ) ) ; errorMessages . add ( errorMessage . toString ( ) ) ; _logger . warn ( errorMessage ) ; return false ; } if ( unManagedExportMask . getKnownInitiatorUris ( ) == null ) { String errorMessage = String . format ( "Unmanaged export mask %s has no initiators and therefore it can't be ingested.  (ExportGroup: %s)" , unManagedExportMask . getMaskName ( ) , exportGroup . getLabel ( ) ) ; errorMessages . add ( errorMessage . toString ( ) ) ; _logger . warn ( errorMessage ) ; return false ; } if ( StringSetUtil . hasIntersection ( unManagedExportMask . getKnownInitiatorUris ( ) , computeInitiators ) ) { String message = String . format ( "Unmanaged export mask has initiators that match the export group (%s) initiators and therefore will be attempted to be ingested." , unManagedExportMask . getMaskName ( ) , exportGroup . getLabel ( ) ) ; _logger . info ( message ) ; return true ; } String errorMessage = String . format ( "ExportGroup %s has no initiators that match unmanaged export mask %s and therefore can't be ingested with it." , exportGroup . getLabel ( ) , unManagedExportMask . getMaskName ( ) ) ; errorMessages . add ( errorMessage . toString ( ) ) ; _logger . warn ( errorMessage ) ; return false ; }
validate the unmanaged export mask is a mask that aligns with the host / cluster initiators provided . if they do match , they will eventually be fed into the export group .
