private Set<String> returnRemotePoolsAssociatedWithRemoteCopySettings(Map<String,List<String>> remoteCopySettings,Set<String> poolUris){
  Set<String> remotePoolUris=new HashSet<String>();
  for (  Entry<String,List<String>> entry : remoteCopySettings.entrySet()) {
    VirtualPool vPool=_objectCache.queryObject(VirtualPool.class,URI.create(entry.getKey()));
    if (null == vPool) {
      remotePoolUris.addAll(poolUris);
    }
 else     if (null != vPool.getUseMatchedPools() && vPool.getUseMatchedPools()) {
      if (null != vPool.getMatchedStoragePools()) {
        remotePoolUris.addAll(vPool.getMatchedStoragePools());
      }
    }
 else     if (null != vPool.getAssignedStoragePools()) {
      remotePoolUris.addAll(vPool.getAssignedStoragePools());
    }
  }
  return remotePoolUris;
}

private Set < String > returnRemotePoolsAssociatedWithRemoteCopySettings ( Map < String , List < String > > remoteCopySettings , Set < String > poolUris ) { Set < String > remotePoolUris = new HashSet < String > ( ) ; for ( Entry < String , List < String > > entry : remoteCopySettings . entrySet ( ) ) { VirtualPool vPool = _objectCache . queryObject ( VirtualPool . class , URI . create ( entry . getKey ( ) ) ) ; if ( null == vPool ) { remotePoolUris . addAll ( poolUris ) ; } else if ( null != vPool . getUseMatchedPools ( ) && vPool . getUseMatchedPools ( ) ) { if ( null != vPool . getMatchedStoragePools ( ) ) { remotePoolUris . addAll ( vPool . getMatchedStoragePools ( ) ) ; } } else if ( null != vPool . getAssignedStoragePools ( ) ) { remotePoolUris . addAll ( vPool . getAssignedStoragePools ( ) ) ; } } return remotePoolUris ; }
choose pools based on remote vpool ' s matched or assigned pools
