Пример #1
0
  private static Feed addSeries(int feed, String friendlyName, double minValue, double maxValue)
      throws Exception {
    // Creates a Pachube object authenicated using the provided API KEY

    Pachube p = new Pachube(API_KEY);
    Feed f = p.getFeed(feed);
    Data a = new Data();
    a.setId(3);
    a.setMaxValue(maxValue);
    a.setMinValue(minValue);
    a.setTag(friendlyName);
    a.setValue(0);
    f.addData(a);
    Feed g = p.createFeed(f);

    // The Feed 'f' is does not represent the feed on pachube any
    // Changes made to this object will not alter the online feed.
    logger.debug("The id of the new feed is:");
    logger.debug(g.getId());

    return g;
  }