private VPlexClusterInfo findTargets(List<PortInfo> targetPortInfo,List<VPlexTargetInfo> targetInfoList,boolean allTargetsOnSameCluster) throws VPlexApiException {
  VPlexClusterInfo targetClusterInfo=null;
  VPlexApiDiscoveryManager discoveryMgr=_vplexApiClient.getDiscoveryManager();
  List<VPlexClusterInfo> clusterInfoList=discoveryMgr.getClusterInfoLite();
  for (  VPlexClusterInfo clusterInfo : clusterInfoList) {
    List<VPlexTargetInfo> clusterTargetInfoList=discoveryMgr.getTargetInfoForCluster(clusterInfo.getName());
    for (    PortInfo portInfo : targetPortInfo) {
      String portWWN=portInfo.getPortWWN();
      for (      VPlexTargetInfo clusterTargetInfo : clusterTargetInfoList) {
        if (portWWN.equals(clusterTargetInfo.getPortWwn())) {
          targetInfoList.add(clusterTargetInfo);
          targetClusterInfo=clusterInfo;
          break;
        }
      }
    }
    if ((allTargetsOnSameCluster) && (!targetInfoList.isEmpty())) {
      break;
    }
  }
  return targetClusterInfo;
}

private VPlexClusterInfo findTargets ( List < PortInfo > targetPortInfo , List < VPlexTargetInfo > targetInfoList , boolean allTargetsOnSameCluster ) throws VPlexApiException { VPlexClusterInfo targetClusterInfo = null ; VPlexApiDiscoveryManager discoveryMgr = _vplexApiClient . getDiscoveryManager ( ) ; List < VPlexClusterInfo > clusterInfoList = discoveryMgr . getClusterInfoLite ( ) ; for ( VPlexClusterInfo clusterInfo : clusterInfoList ) { List < VPlexTargetInfo > clusterTargetInfoList = discoveryMgr . getTargetInfoForCluster ( clusterInfo . getName ( ) ) ; for ( PortInfo portInfo : targetPortInfo ) { String portWWN = portInfo . getPortWWN ( ) ; for ( VPlexTargetInfo clusterTargetInfo : clusterTargetInfoList ) { if ( portWWN . equals ( clusterTargetInfo . getPortWwn ( ) ) ) { targetInfoList . add ( clusterTargetInfo ) ; targetClusterInfo = clusterInfo ; break ; } } } if ( ( allTargetsOnSameCluster ) && ( ! targetInfoList . isEmpty ( ) ) ) { break ; } } return targetClusterInfo ; }
finds the target fe ports corresponding to the ports identified by the passed port information .
