abstract class StatusStreamBase extends java.lang.Object implements StatusStream
Modifier and Type | Class and Description |
---|---|
(package private) class |
StatusStreamBase.StreamEvent |
Modifier and Type | Field and Description |
---|---|
private java.io.BufferedReader |
br |
protected Configuration |
CONF |
protected twitter4j.internal.async.Dispatcher |
dispatcher |
protected twitter4j.internal.json.z_T4JInternalFactory |
factory |
private java.io.InputStream |
is |
protected static twitter4j.internal.logging.Logger |
logger |
private twitter4j.internal.http.HttpResponse |
response |
private boolean |
streamAlive |
Constructor and Description |
---|
StatusStreamBase(twitter4j.internal.async.Dispatcher dispatcher,
twitter4j.internal.http.HttpResponse response,
Configuration conf) |
StatusStreamBase(twitter4j.internal.async.Dispatcher dispatcher,
java.io.InputStream stream,
Configuration conf) |
Modifier and Type | Method and Description |
---|---|
protected DirectMessage |
asDirectMessage(twitter4j.internal.org.json.JSONObject json) |
protected long[] |
asFriendList(twitter4j.internal.org.json.JSONObject json) |
protected Status |
asStatus(twitter4j.internal.org.json.JSONObject json) |
protected User |
asUser(twitter4j.internal.org.json.JSONObject json) |
protected UserList |
asUserList(twitter4j.internal.org.json.JSONObject json) |
void |
close() |
protected void |
handleNextElement(StreamListener[] listeners,
RawStreamListener[] rawStreamListeners) |
abstract void |
next(StatusListener listener)
Reads next status from this stream.
|
abstract void |
next(StreamListener[] listeners,
RawStreamListener[] rawStreamListeners) |
protected void |
onBlock(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject target,
StreamListener[] listeners) |
protected void |
onDelete(twitter4j.internal.org.json.JSONObject json,
StreamListener[] listeners) |
protected void |
onDirectMessage(twitter4j.internal.org.json.JSONObject json,
StreamListener[] listeners) |
protected void |
onDisconnectionNotice(java.lang.String line,
StreamListener[] listeners) |
protected void |
onException(java.lang.Exception e,
StreamListener[] listeners) |
void |
onException(java.lang.Exception e,
StreamListener[] listeners,
RawStreamListener[] rawStreamListeners) |
protected void |
onFavorite(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject target,
twitter4j.internal.org.json.JSONObject targetObject,
StreamListener[] listeners) |
protected void |
onFollow(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject target,
StreamListener[] listeners) |
protected void |
onFriends(twitter4j.internal.org.json.JSONObject json,
StreamListener[] listeners) |
protected void |
onLimit(twitter4j.internal.org.json.JSONObject json,
StreamListener[] listeners) |
protected void |
onMessage(java.lang.String rawString,
RawStreamListener[] listeners) |
protected void |
onScrubGeo(twitter4j.internal.org.json.JSONObject json,
StreamListener[] listeners) |
protected void |
onSender(twitter4j.internal.org.json.JSONObject json,
StreamListener[] listeners) |
protected void |
onStallWarning(twitter4j.internal.org.json.JSONObject json,
StreamListener[] listeners) |
protected void |
onStatus(twitter4j.internal.org.json.JSONObject json,
StreamListener[] listeners) |
protected void |
onUnblock(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject target,
StreamListener[] listeners) |
protected void |
onUnfavorite(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject target,
twitter4j.internal.org.json.JSONObject targetObject,
StreamListener[] listeners) |
protected void |
onUnfollow(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject target,
StreamListener[] listeners) |
protected void |
onUserListCreation(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListDestroyed(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListMemberAddition(twitter4j.internal.org.json.JSONObject addedMember,
twitter4j.internal.org.json.JSONObject owner,
twitter4j.internal.org.json.JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListMemberDeletion(twitter4j.internal.org.json.JSONObject deletedMember,
twitter4j.internal.org.json.JSONObject owner,
twitter4j.internal.org.json.JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListSubscription(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject owner,
twitter4j.internal.org.json.JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListUnsubscription(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject owner,
twitter4j.internal.org.json.JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserListUpdated(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject userList,
StreamListener[] listeners) |
protected void |
onUserUpdate(twitter4j.internal.org.json.JSONObject source,
twitter4j.internal.org.json.JSONObject target,
StreamListener[] listeners) |
protected java.lang.String |
parseLine(java.lang.String line) |
protected static final twitter4j.internal.logging.Logger logger
private boolean streamAlive
private java.io.BufferedReader br
private java.io.InputStream is
private twitter4j.internal.http.HttpResponse response
protected final twitter4j.internal.async.Dispatcher dispatcher
protected final Configuration CONF
protected twitter4j.internal.json.z_T4JInternalFactory factory
StatusStreamBase(twitter4j.internal.async.Dispatcher dispatcher, java.io.InputStream stream, Configuration conf) throws java.io.IOException
java.io.IOException
StatusStreamBase(twitter4j.internal.async.Dispatcher dispatcher, twitter4j.internal.http.HttpResponse response, Configuration conf) throws java.io.IOException
java.io.IOException
protected java.lang.String parseLine(java.lang.String line)
protected void handleNextElement(StreamListener[] listeners, RawStreamListener[] rawStreamListeners) throws TwitterException
TwitterException
protected void onMessage(java.lang.String rawString, RawStreamListener[] listeners) throws TwitterException
TwitterException
protected void onSender(twitter4j.internal.org.json.JSONObject json, StreamListener[] listeners) throws TwitterException
TwitterException
protected void onStatus(twitter4j.internal.org.json.JSONObject json, StreamListener[] listeners) throws TwitterException
TwitterException
protected void onDirectMessage(twitter4j.internal.org.json.JSONObject json, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onDelete(twitter4j.internal.org.json.JSONObject json, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onLimit(twitter4j.internal.org.json.JSONObject json, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onStallWarning(twitter4j.internal.org.json.JSONObject json, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onScrubGeo(twitter4j.internal.org.json.JSONObject json, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onFriends(twitter4j.internal.org.json.JSONObject json, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onFavorite(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target, twitter4j.internal.org.json.JSONObject targetObject, StreamListener[] listeners) throws TwitterException
TwitterException
protected void onUnfavorite(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target, twitter4j.internal.org.json.JSONObject targetObject, StreamListener[] listeners) throws TwitterException
TwitterException
protected void onFollow(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target, StreamListener[] listeners) throws TwitterException
TwitterException
protected void onUnfollow(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target, StreamListener[] listeners) throws TwitterException
TwitterException
protected void onUserListMemberAddition(twitter4j.internal.org.json.JSONObject addedMember, twitter4j.internal.org.json.JSONObject owner, twitter4j.internal.org.json.JSONObject userList, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onUserListMemberDeletion(twitter4j.internal.org.json.JSONObject deletedMember, twitter4j.internal.org.json.JSONObject owner, twitter4j.internal.org.json.JSONObject userList, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onUserListSubscription(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject owner, twitter4j.internal.org.json.JSONObject userList, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onUserListUnsubscription(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject owner, twitter4j.internal.org.json.JSONObject userList, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onUserListCreation(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject userList, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onUserListUpdated(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject userList, StreamListener[] listeners) throws TwitterException, twitter4j.internal.org.json.JSONException
TwitterException
twitter4j.internal.org.json.JSONException
protected void onUserListDestroyed(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject userList, StreamListener[] listeners) throws TwitterException
TwitterException
protected void onUserUpdate(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target, StreamListener[] listeners) throws TwitterException
TwitterException
protected void onBlock(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target, StreamListener[] listeners) throws TwitterException
TwitterException
protected void onUnblock(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target, StreamListener[] listeners) throws TwitterException
TwitterException
protected void onDisconnectionNotice(java.lang.String line, StreamListener[] listeners)
protected void onException(java.lang.Exception e, StreamListener[] listeners)
public void close() throws java.io.IOException
close
in interface StatusStream
java.io.IOException
protected Status asStatus(twitter4j.internal.org.json.JSONObject json) throws TwitterException
TwitterException
protected DirectMessage asDirectMessage(twitter4j.internal.org.json.JSONObject json) throws TwitterException
TwitterException
protected long[] asFriendList(twitter4j.internal.org.json.JSONObject json) throws TwitterException
TwitterException
protected User asUser(twitter4j.internal.org.json.JSONObject json) throws TwitterException
TwitterException
protected UserList asUserList(twitter4j.internal.org.json.JSONObject json) throws TwitterException
TwitterException
public abstract void next(StatusListener listener) throws TwitterException
StatusStream
next
in interface StatusStream
listener
- a StatusListener implementationTwitterException
- when the end of the stream has been reached.public abstract void next(StreamListener[] listeners, RawStreamListener[] rawStreamListeners) throws TwitterException
TwitterException
public void onException(java.lang.Exception e, StreamListener[] listeners, RawStreamListener[] rawStreamListeners)