Set<String> requestedIds = getRequestPropertyIds(request, predicate);
Set<Resource> resources = new HashSet<Resource>();
for (String feedName : feedNames ) {
Feed feed = service.getFeed(feedName);
Resource resource = new ResourceImpl(Resource.Type.DRFeed);
setResourceProperty(resource, FEED_NAME_PROPERTY_ID,
feed.getName(), requestedIds);
setResourceProperty(resource, FEED_DESCRIPTION_PROPERTY_ID,
feed.getDescription(), requestedIds);
setResourceProperty(resource, FEED_STATUS_PROPERTY_ID,
feed.getStatus(), requestedIds);
setResourceProperty(resource, FEED_SCHEDULE_PROPERTY_ID,
feed.getSchedule(), requestedIds);
setResourceProperty(resource, FEED_SOURCE_CLUSTER_NAME_PROPERTY_ID,
feed.getSourceClusterName(), requestedIds);
setResourceProperty(resource, FEED_SOURCE_CLUSTER_START_PROPERTY_ID,
feed.getSourceClusterStart(), requestedIds);
setResourceProperty(resource, FEED_SOURCE_CLUSTER_END_PROPERTY_ID,
feed.getSourceClusterEnd(), requestedIds);
setResourceProperty(resource, FEED_SOURCE_CLUSTER_LIMIT_PROPERTY_ID,
feed.getSourceClusterLimit(), requestedIds);
setResourceProperty(resource, FEED_SOURCE_CLUSTER_ACTION_PROPERTY_ID,
feed.getSourceClusterAction(), requestedIds);
setResourceProperty(resource, FEED_TARGET_CLUSTER_NAME_PROPERTY_ID,
feed.getTargetClusterName(), requestedIds);
setResourceProperty(resource, FEED_TARGET_CLUSTER_START_PROPERTY_ID,
feed.getTargetClusterStart(), requestedIds);
setResourceProperty(resource, FEED_TARGET_CLUSTER_END_PROPERTY_ID,
feed.getTargetClusterEnd(), requestedIds);
setResourceProperty(resource, FEED_TARGET_CLUSTER_LIMIT_PROPERTY_ID,
feed.getTargetClusterLimit(), requestedIds);
setResourceProperty(resource, FEED_TARGET_CLUSTER_ACTION_PROPERTY_ID,
feed.getTargetClusterAction(), requestedIds);
setResourceProperty(resource, FEED_PROPERTIES_PROPERTY_ID,
feed.getProperties(), requestedIds);
if (predicate == null || predicate.evaluate(resource)) {
resources.add(resource);
}
}