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)); }
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)); }
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); }
/** * 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)); }
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)); }
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); }
String host = hosts.nextHost(); if (host == null) { setExitStatus(new Event(EventType.STOPPED_BY_ERROR, "No hosts available"));