private HostExportInfo verifyHostExports(List<HostExportInfo> hostExportInfoList){
  HostExportInfo exportInfo=hostExportInfoList.get(0);
  String hostName=exportInfo.getHostName();
  Set<String> volumeNativeIds=new HashSet<>();
  Set<String> masterInitiatorNetworkIds=new HashSet<>();
  Set<String> masterTargetNativeIds=new HashSet<>();
  List<Initiator> initiators=exportInfo.getInitiators();
  List<StoragePort> targets=exportInfo.getTargets();
  for (  Initiator initiator : initiators) {
    masterInitiatorNetworkIds.add(initiator.getPort());
  }
  for (  StoragePort port : targets) {
    masterTargetNativeIds.add(port.getNativeId());
  }
  for (  HostExportInfo hostExportInfo : hostExportInfoList) {
    boolean isValid=verifyHostExports(masterInitiatorNetworkIds,masterTargetNativeIds,hostExportInfo);
    if (!isValid) {
      return null;
    }
    volumeNativeIds.addAll(hostExportInfo.getStorageObjectNativeIds());
  }
  HostExportInfo hostExportInfo=new HostExportInfo(hostName,new ArrayList<>(volumeNativeIds),initiators,targets);
  return hostExportInfo;
}

private HostExportInfo verifyHostExports ( List < HostExportInfo > hostExportInfoList ) { HostExportInfo exportInfo = hostExportInfoList . get ( 0 ) ; String hostName = exportInfo . getHostName ( ) ; Set < String > volumeNativeIds = new HashSet < > ( ) ; Set < String > masterInitiatorNetworkIds = new HashSet < > ( ) ; Set < String > masterTargetNativeIds = new HashSet < > ( ) ; List < Initiator > initiators = exportInfo . getInitiators ( ) ; List < StoragePort > targets = exportInfo . getTargets ( ) ; for ( Initiator initiator : initiators ) { masterInitiatorNetworkIds . add ( initiator . getPort ( ) ) ; } for ( StoragePort port : targets ) { masterTargetNativeIds . add ( port . getNativeId ( ) ) ; } for ( HostExportInfo hostExportInfo : hostExportInfoList ) { boolean isValid = verifyHostExports ( masterInitiatorNetworkIds , masterTargetNativeIds , hostExportInfo ) ; if ( ! isValid ) { return null ; } volumeNativeIds . addAll ( hostExportInfo . getStorageObjectNativeIds ( ) ) ; } HostExportInfo hostExportInfo = new HostExportInfo ( hostName , new ArrayList < > ( volumeNativeIds ) , initiators , targets ) ; return hostExportInfo ; }
verifies that all members of the specified list have the same set of initiators ans the same set of storage ports .
