Package com.twitter.hbc.core.endpoint

Examples of com.twitter.hbc.core.endpoint.Endpoint


  /**
   * TODO: This must be limited to 25 adds per seconds
   */
  public void addUser(String streamId, long userId) throws IOException, ControlStreamException {
    Endpoint endpoint = SitestreamEndpoint.addUserEndpoint(streamId);
    endpoint.addPostParameter(Constants.USER_ID_PARAM, Long.toString(userId));

    HttpUriRequest request = HttpConstants.constructRequest(hosts.nextHost(), endpoint, auth);
    consumeHttpEntityContent(makeControlStreamRequest(request));
  }
View Full Code Here


    HttpUriRequest request = HttpConstants.constructRequest(hosts.nextHost(), endpoint, auth);
    consumeHttpEntityContent(makeControlStreamRequest(request));
  }

  public void removeUser(String streamId, long userId) throws IOException, ControlStreamException {
    Endpoint endpoint = SitestreamEndpoint.removeUserEndpoint(streamId);
    endpoint.addPostParameter(Constants.USER_ID_PARAM, Long.toString(userId));

    HttpUriRequest request = HttpConstants.constructRequest(hosts.nextHost(), endpoint, auth);
    consumeHttpEntityContent(makeControlStreamRequest(request));
  }
View Full Code Here

    consumeHttpEntityContent(makeControlStreamRequest(request));
  }

  public void addUsers(String streamId, Collection<Long> userIds) throws IOException, ControlStreamException {
    Preconditions.checkArgument(userIds.size() >= 1 && userIds.size() <= 100, "The userId parameter can be supplied with up to 100 user IDs.");
    Endpoint endpoint = SitestreamEndpoint.addUserEndpoint(streamId);
    endpoint.addPostParameter(Constants.USER_ID_PARAM, Joiner.on(',').join(userIds));

    HttpUriRequest request = HttpConstants.constructRequest(hosts.nextHost(), endpoint, auth);
    consumeHttpEntityContent(makeControlStreamRequest(request));
  }
View Full Code Here

    consumeHttpEntityContent(makeControlStreamRequest(request));
  }

  public void removeUsers(String streamId, Collection<Long> userIds) throws IOException, ControlStreamException {
    Preconditions.checkArgument(userIds.size() >= 1 && userIds.size() <= 100, "The userId parameter can be supplied with up to 100 user IDs.");
    Endpoint endpoint = SitestreamEndpoint.removeUserEndpoint(streamId);
    endpoint.addPostParameter(Constants.USER_ID_PARAM, Joiner.on(',').join(userIds));

    HttpUriRequest request = HttpConstants.constructRequest(hosts.nextHost(), endpoint, auth);
    consumeHttpEntityContent(makeControlStreamRequest(request));
  }
View Full Code Here

  public String getFriends(String streamId, long userId) throws IOException, ControlStreamException {
    return getFriends(streamId, userId, 0);
  }

  public String getFriends(String streamId, long userId, int cursor) throws IOException, ControlStreamException {
    Endpoint endpoint = SitestreamEndpoint.friendsEndpoint(streamId);
    endpoint.addPostParameter(Constants.USER_ID_PARAM, Long.toString(userId));
    endpoint.addPostParameter(Constants.CURSOR_PARAM, Integer.toString(cursor));

    HttpUriRequest request = HttpConstants.constructRequest(hosts.nextHost(), endpoint, auth);
    HttpResponse response = makeControlStreamRequest(request);
    return consumeHttpEntityContent(response);
  }
View Full Code Here

  public String getInfo(String streamId, long userId) throws IOException, ControlStreamException {
    return getInfo(streamId);
  }

  public String getInfo(String streamId) throws IOException, ControlStreamException {
    Endpoint endpoint = SitestreamEndpoint.streamInfoEndpoint(streamId);

    HttpUriRequest request = HttpConstants.constructRequest(hosts.nextHost(), endpoint, auth);
    HttpResponse response = makeControlStreamRequest(request);
    return consumeHttpEntityContent(response);
  }
View Full Code Here

TOP

Related Classes of com.twitter.hbc.core.endpoint.Endpoint

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.