class FeedResourceProvider extends AbstractDRResourceProvider {

  @Override
  public RequestStatus updateResources(Request request, Predicate predicate)
      throws SystemException, UnsupportedPropertyException,
             NoSuchResourceException, NoSuchParentResourceException {

    Iterator<Map<String,Object>> iterator = request.getProperties().iterator();
    if (iterator.hasNext()) {

      Map<String, Object> propertyMap = iterator.next();

      String desiredStatus = (String) propertyMap.get(FEED_STATUS_PROPERTY_ID);

      // get all the feeds that pass the predicate check
      Set<Resource> resources = getResources(PropertyHelper.getReadRequest(), predicate);

      // update all the matching feeds with the property values from the request
      for (Resource resource : resources) {
        IvoryService service = getService();
        if (desiredStatus != null) {
          String status   = (String) resource.getPropertyValue(FEED_STATUS_PROPERTY_ID);
          String feedName = (String) resource.getPropertyValue(FEED_NAME_PROPERTY_ID);

          if (desiredStatus.equals("SCHEDULED")) {
            service.scheduleFeed(feedName);
          } else if (desiredStatus.equals("SUSPENDED")) {
            service.suspendFeed(feedName);
          } else if (status.equals("SUSPENDED") && desiredStatus.equals("RUNNING")) {
            service.resumeFeed(feedName);
          }
        }
        service.updateFeed(getFeed((String) resource.getPropertyValue(FEED_NAME_PROPERTY_ID),
            getUpdateMap(resource, propertyMap)));
      }
    }
    return new RequestStatusImpl(null);
  }

  public  FeedResourceProvider(IvoryService ivoryService);

}