Package org.apache.ambari.server.controller.ivory

Examples of org.apache.ambari.server.controller.ivory.Feed


    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);
      }
    }
View Full Code Here


      if (category.equals(FEED_PROPERTIES_PROPERTY_ID)) {
        properties.put(PropertyHelper.getPropertyName(property), (String) entry.getValue());
      }
    }

    return new Feed(
        feedName,
        (String) propertyMap.get(FEED_DESCRIPTION_PROPERTY_ID),
        (String) propertyMap.get(FEED_STATUS_PROPERTY_ID),
        (String) propertyMap.get(FEED_SCHEDULE_PROPERTY_ID),
        (String) propertyMap.get(FEED_SOURCE_CLUSTER_NAME_PROPERTY_ID),
View Full Code Here

  // ----- helper methods ----------------------------------------------------

  private String setFeedStatus(String feedName, String status) {
    String currentStatus = null;
    Feed feed = feeds.get(feedName);

    if (feed != null) {
      currentStatus = feed.getStatus();
      if (!currentStatus.equals(status)) {
        feed = new Feed(feed.getName(),
            feed.getDescription(),
            status,
            feed.getSchedule(),
            feed.getSourceClusterName(),
            feed.getSourceClusterStart(),
            feed.getSourceClusterEnd(),
            feed.getSourceClusterLimit(),
            feed.getSourceClusterAction(),
            feed.getTargetClusterName(),
            feed.getTargetClusterStart(),
            feed.getTargetClusterEnd(),
            feed.getTargetClusterLimit(),
            feed.getTargetClusterAction(),
            feed.getProperties());

        feeds.put(feed.getName(), feed);
      }
    }
    return currentStatus;
  }
View Full Code Here

    feedNames.add("Feed2");
    feedNames.add("Feed3");

    Map<String,String> props = new HashMap<String, String>();

    Feed feed1 = new Feed("Feed1", "d", "s", "sch", "source", "st", "end", "l", "a", "target", "st", "end", "l", "a", props);
    Feed feed2 = new Feed("Feed2", "d", "s", "sch", "source", "st", "end", "l", "a", "target", "st", "end", "l", "a", props);
    Feed feed3 = new Feed("Feed3", "d", "s", "sch", "source", "st", "end", "l", "a", "target", "st", "end", "l", "a", props);

    // set expectations
    expect(service.getFeedNames()).andReturn(feedNames);

    expect(service.getFeed("Feed1")).andReturn(feed1);
View Full Code Here

    List<String> feedNames = new LinkedList<String>();
    feedNames.add("Feed1");

    Map<String,String> props = new HashMap<String, String>();

    Feed feed1 = new Feed("Feed1", "desc", "WAITING", "sched", "source", "st", "end", "l", "a", "target", "st", "end", "l", "a", props);

    // set expectations
    expect(service.getFeedNames()).andReturn(feedNames);

    expect(service.getFeed("Feed1")).andReturn(feed1);
View Full Code Here

    List<String> feedNames = new LinkedList<String>();
    feedNames.add("Feed1");

    Map<String,String> props = new HashMap<String, String>();

    Feed feed1 = new Feed("Feed1", "d", "s", "sch", "source", "st", "end", "l", "a", "target", "st", "end", "l", "a", props);

    // set expectations
    expect(service.getFeedNames()).andReturn(feedNames);

    expect(service.getFeed("Feed1")).andReturn(feed1);
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.controller.ivory.Feed

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.