Set<String> requestedIds = getRequestPropertyIds(request, predicate);
Set<Resource> resources = new HashSet<Resource>();
for (String clusterName : clusterNames ) {
Cluster cluster = service.getCluster(clusterName);
Resource resource = new ResourceImpl(Resource.Type.DRTargetCluster);
setResourceProperty(resource, CLUSTER_NAME_PROPERTY_ID,
cluster.getName(), requestedIds);
setResourceProperty(resource, CLUSTER_COLO_PROPERTY_ID,
cluster.getColo(), requestedIds);
setResourceProperty(resource, CLUSTER_INTERFACES_PROPERTY_ID,
cluster.getInterfaces(), requestedIds);
setResourceProperty(resource, CLUSTER_LOCATIONS_PROPERTY_ID,
cluster.getLocations(), requestedIds);
setResourceProperty(resource, CLUSTER_PROPERTIES_PROPERTY_ID,
cluster.getProperties(), requestedIds);
if (predicate == null || predicate.evaluate(resource)) {
resources.add(resource);
}
}