private boolean igContainsInitiators(StorageSystem storage,CIMInstance igInstance,List<String> initiatorsInDb){
  CIMObjectPath igPath=igInstance.getObjectPath();
  CloseableIterator<CIMInstance> initiatorsForIg=null;
  try {
    initiatorsForIg=_helper.getAssociatorInstances(storage,igPath,null,SmisConstants.CP_SE_STORAGE_HARDWARE_ID,null,null,SmisConstants.PS_STORAGE_ID);
    if (initiatorsForIg != null) {
      while (initiatorsForIg.hasNext()) {
        CIMInstance initiatorInstance=initiatorsForIg.next();
        String initiatorPort=CIMPropertyFactory.getPropertyValue(initiatorInstance,SmisConstants.CP_STORAGE_ID);
        _log.info(String.format("mapInitiatorsToInitiatorGroups - igPath = %s has initiator %s",igPath,initiatorPort));
        if (initiatorsInDb.contains(initiatorPort)) {
          return true;
        }
      }
    }
  }
 catch (  Exception e) {
  }
 finally {
    if (initiatorsForIg != null) {
      initiatorsForIg.close();
    }
  }
  return false;
}

private boolean igContainsInitiators ( StorageSystem storage , CIMInstance igInstance , List < String > initiatorsInDb ) { CIMObjectPath igPath = igInstance . getObjectPath ( ) ; CloseableIterator < CIMInstance > initiatorsForIg = null ; try { initiatorsForIg = _helper . getAssociatorInstances ( storage , igPath , null , SmisConstants . CP_SE_STORAGE_HARDWARE_ID , null , null , SmisConstants . PS_STORAGE_ID ) ; if ( initiatorsForIg != null ) { while ( initiatorsForIg . hasNext ( ) ) { CIMInstance initiatorInstance = initiatorsForIg . next ( ) ; String initiatorPort = CIMPropertyFactory . getPropertyValue ( initiatorInstance , SmisConstants . CP_STORAGE_ID ) ; _log . info ( String . format ( "mapInitiatorsToInitiatorGroups - igPath = %s has initiator %s" , igPath , initiatorPort ) ) ; if ( initiatorsInDb . contains ( initiatorPort ) ) { return true ; } } } } catch ( Exception e ) { } finally { if ( initiatorsForIg != null ) { initiatorsForIg . close ( ) ; } } return false ; }
compare initiators sent in with initiators in an initiator group . any subset ( intersection ) returns true .
