final class SiteStreamsImpl extends StatusStreamBase
StatusStreamBase.StreamEvent
Modifier and Type | Field and Description |
---|---|
private StreamController |
cs |
protected static RawStreamListener[] |
EMPTY |
private static java.lang.ThreadLocal<java.lang.Long> |
forUser |
CONF, logger
Constructor and Description |
---|
SiteStreamsImpl(Dispatcher dispatcher,
HttpResponse response,
Configuration conf,
StreamController cs) |
SiteStreamsImpl(Dispatcher dispatcher,
java.io.InputStream stream,
Configuration conf,
StreamController cs) |
Modifier and Type | Method and Description |
---|---|
void |
next(StatusListener listener)
Reads next status from this stream.
|
void |
next(StreamListener[] listeners,
RawStreamListener[] rawStreamListeners) |
protected void |
onBlock(JSONObject source,
JSONObject target,
StreamListener[] listeners) |
protected void |
onClose() |
protected void |
onDelete(JSONObject json,
StreamListener[] listeners) |
protected void |
onDirectMessage(JSONObject json,
StreamListener[] listeners) |
void |
onDisconnectionNotice(java.lang.String line,
StreamListener[] listeners) |
void |
onException(java.lang.Exception ex,
StreamListener[] listeners) |
protected void |
onFavorite(JSONObject source,
JSONObject target,
JSONObject targetObject,
StreamListener[] listeners) |
(package private) void |
onFavoritedRetweet(JSONObject source,
JSONObject target,
JSONObject targetObject,
StreamListener[] listeners) |
protected void |
onFollow(JSONObject source,
JSONObject target,
StreamListener[] listeners) |
protected void |
onFriends(JSONObject json,
StreamListener[] listeners) |
protected void |
onMessage(java.lang.String rawString,
RawStreamListener[] listeners) |
(package private) void |
onMute(JSONObject source,
JSONObject target,
StreamListener[] listeners) |
(package private) void |
onQuotedTweet(JSONObject source,
JSONObject target,
JSONObject targetObject,
StreamListener[] listeners) |
(package private) void |
onRetweetedRetweet(JSONObject source,
JSONObject target,
JSONObject targetObject,
StreamListener[] listeners) |
protected void |
onStatus(JSONObject json,
StreamListener[] listeners) |
protected void |
onUnblock(JSONObject source,
JSONObject target,
StreamListener[] listeners) |
protected void |
onUnfavorite(JSONObject source,
JSONObject target,
JSONObject targetObject,
StreamListener[] listeners) |
protected void |
onUnfollow(JSONObject source,
JSONObject target,
StreamListener[] listeners) |
(package private) void |
onUnmute(JSONObject source,
JSONObject target,
StreamListener[] listeners) |
protected void |
onUserDeletion(long target,
StreamListener[] listeners) |
protected void |
onUserListCreation(JSONObject source,
JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListDestroyed(JSONObject source,
JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListMemberAddition(JSONObject addedMember,
JSONObject owner,
JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListMemberDeletion(JSONObject deletedMember,
JSONObject owner,
JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListSubscription(JSONObject source,
JSONObject owner,
JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListUnsubscription(JSONObject source,
JSONObject owner,
JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListUpdated(JSONObject source,
JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserSuspension(long target,
StreamListener[] listeners) |
protected void |
onUserUpdate(JSONObject source,
JSONObject target,
StreamListener[] listeners) |
protected java.lang.String |
parseLine(java.lang.String line) |
asDirectMessage, asFriendList, asStatus, asUser, asUserList, close, handleNextElement, onException, onLimit, onScrubGeo, onSender, onStallWarning
private final StreamController cs
private static final java.lang.ThreadLocal<java.lang.Long> forUser
protected static final RawStreamListener[] EMPTY
SiteStreamsImpl(Dispatcher dispatcher, java.io.InputStream stream, Configuration conf, StreamController cs) throws java.io.IOException
java.io.IOException
SiteStreamsImpl(Dispatcher dispatcher, HttpResponse response, Configuration conf, StreamController cs) throws java.io.IOException
java.io.IOException
protected java.lang.String parseLine(java.lang.String line)
parseLine
in class StatusStreamBase
protected void onClose()
onClose
in class StatusStreamBase
protected void onMessage(java.lang.String rawString, RawStreamListener[] listeners) throws TwitterException
onMessage
in class StatusStreamBase
TwitterException
protected void onStatus(JSONObject json, StreamListener[] listeners) throws TwitterException
onStatus
in class StatusStreamBase
TwitterException
protected void onDelete(JSONObject json, StreamListener[] listeners) throws JSONException
onDelete
in class StatusStreamBase
JSONException
protected void onDirectMessage(JSONObject json, StreamListener[] listeners) throws TwitterException
onDirectMessage
in class StatusStreamBase
TwitterException
protected void onFriends(JSONObject json, StreamListener[] listeners) throws TwitterException, JSONException
onFriends
in class StatusStreamBase
TwitterException
JSONException
protected void onFavorite(JSONObject source, JSONObject target, JSONObject targetObject, StreamListener[] listeners) throws TwitterException
onFavorite
in class StatusStreamBase
TwitterException
protected void onUnfavorite(JSONObject source, JSONObject target, JSONObject targetObject, StreamListener[] listeners) throws TwitterException
onUnfavorite
in class StatusStreamBase
TwitterException
protected void onFollow(JSONObject source, JSONObject target, StreamListener[] listeners) throws TwitterException
onFollow
in class StatusStreamBase
TwitterException
protected void onUnfollow(JSONObject source, JSONObject target, StreamListener[] listeners) throws TwitterException
onUnfollow
in class StatusStreamBase
TwitterException
protected void onUserListMemberAddition(JSONObject addedMember, JSONObject owner, JSONObject userList, StreamListener[] listeners) throws TwitterException, JSONException
onUserListMemberAddition
in class StatusStreamBase
TwitterException
JSONException
protected void onUserListMemberDeletion(JSONObject deletedMember, JSONObject owner, JSONObject userList, StreamListener[] listeners) throws TwitterException, JSONException
onUserListMemberDeletion
in class StatusStreamBase
TwitterException
JSONException
protected void onUserListSubscription(JSONObject source, JSONObject owner, JSONObject userList, StreamListener[] listeners) throws TwitterException, JSONException
onUserListSubscription
in class StatusStreamBase
TwitterException
JSONException
protected void onUserListUnsubscription(JSONObject source, JSONObject owner, JSONObject userList, StreamListener[] listeners) throws TwitterException, JSONException
onUserListUnsubscription
in class StatusStreamBase
TwitterException
JSONException
protected void onUserListCreation(JSONObject source, JSONObject userList, StreamListener[] listeners) throws TwitterException, JSONException
onUserListCreation
in class StatusStreamBase
TwitterException
JSONException
protected void onUserListUpdated(JSONObject source, JSONObject userList, StreamListener[] listeners) throws TwitterException, JSONException
onUserListUpdated
in class StatusStreamBase
TwitterException
JSONException
protected void onUserListDestroyed(JSONObject source, JSONObject userList, StreamListener[] listeners) throws TwitterException
onUserListDestroyed
in class StatusStreamBase
TwitterException
protected void onUserUpdate(JSONObject source, JSONObject target, StreamListener[] listeners) throws TwitterException
onUserUpdate
in class StatusStreamBase
TwitterException
protected void onUserSuspension(long target, StreamListener[] listeners) throws TwitterException
onUserSuspension
in class StatusStreamBase
TwitterException
protected void onUserDeletion(long target, StreamListener[] listeners) throws TwitterException
onUserDeletion
in class StatusStreamBase
TwitterException
protected void onBlock(JSONObject source, JSONObject target, StreamListener[] listeners) throws TwitterException
onBlock
in class StatusStreamBase
TwitterException
protected void onUnblock(JSONObject source, JSONObject target, StreamListener[] listeners) throws TwitterException
onUnblock
in class StatusStreamBase
TwitterException
void onRetweetedRetweet(JSONObject source, JSONObject target, JSONObject targetObject, StreamListener[] listeners) throws TwitterException
onRetweetedRetweet
in class StatusStreamBase
TwitterException
void onFavoritedRetweet(JSONObject source, JSONObject target, JSONObject targetObject, StreamListener[] listeners) throws TwitterException
onFavoritedRetweet
in class StatusStreamBase
TwitterException
void onQuotedTweet(JSONObject source, JSONObject target, JSONObject targetObject, StreamListener[] listeners) throws TwitterException
onQuotedTweet
in class StatusStreamBase
TwitterException
void onMute(JSONObject source, JSONObject target, StreamListener[] listeners) throws TwitterException
onMute
in class StatusStreamBase
TwitterException
void onUnmute(JSONObject source, JSONObject target, StreamListener[] listeners) throws TwitterException
onUnmute
in class StatusStreamBase
TwitterException
public void onException(java.lang.Exception ex, StreamListener[] listeners)
onException
in class StatusStreamBase
public void next(StatusListener listener) throws TwitterException
StatusStream
next
in interface StatusStream
next
in class StatusStreamBase
listener
- a StatusListener implementationTwitterException
- when the end of the stream has been reached.public void next(StreamListener[] listeners, RawStreamListener[] rawStreamListeners) throws TwitterException
next
in class StatusStreamBase
TwitterException
public void onDisconnectionNotice(java.lang.String line, StreamListener[] listeners)
onDisconnectionNotice
in class StatusStreamBase