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 Dispatcher |
dispatcher |
protected ObjectFactory |
factory |
private java.io.InputStream |
is |
protected static Logger |
logger |
private HttpResponse |
response |
private boolean |
streamAlive |
| Constructor and Description |
|---|
StatusStreamBase(Dispatcher dispatcher,
HttpResponse response,
Configuration conf) |
StatusStreamBase(Dispatcher dispatcher,
java.io.InputStream stream,
Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
protected DirectMessage |
asDirectMessage(JSONObject json) |
protected long[] |
asFriendList(JSONObject json) |
protected Status |
asStatus(JSONObject json) |
protected User |
asUser(JSONObject json) |
protected UserList |
asUserList(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(JSONObject source,
JSONObject target,
StreamListener[] listeners) |
protected void |
onDelete(JSONObject json,
StreamListener[] listeners) |
protected void |
onDirectMessage(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(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 |
onLimit(JSONObject json,
StreamListener[] listeners) |
protected void |
onMessage(java.lang.String rawString,
RawStreamListener[] listeners) |
protected void |
onScrubGeo(JSONObject json,
StreamListener[] listeners) |
protected void |
onSender(JSONObject json,
StreamListener[] listeners) |
protected void |
onStallWarning(JSONObject json,
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) |
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 |
onUserUpdate(JSONObject source,
JSONObject target,
StreamListener[] listeners) |
protected java.lang.String |
parseLine(java.lang.String line) |
protected static final Logger logger
private boolean streamAlive
private java.io.BufferedReader br
private java.io.InputStream is
private HttpResponse response
protected final Dispatcher dispatcher
protected final Configuration CONF
protected ObjectFactory factory
StatusStreamBase(Dispatcher dispatcher,
java.io.InputStream stream,
Configuration conf)
throws java.io.IOException
java.io.IOExceptionStatusStreamBase(Dispatcher dispatcher,
HttpResponse response,
Configuration conf)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String parseLine(java.lang.String line)
protected void handleNextElement(StreamListener[] listeners, RawStreamListener[] rawStreamListeners) throws TwitterException
TwitterExceptionprotected void onMessage(java.lang.String rawString,
RawStreamListener[] listeners)
throws TwitterException
TwitterExceptionprotected void onSender(JSONObject json,
StreamListener[] listeners)
throws TwitterException
TwitterExceptionprotected void onStatus(JSONObject json,
StreamListener[] listeners)
throws TwitterException
TwitterExceptionprotected void onDirectMessage(JSONObject json,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onDelete(JSONObject json,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onLimit(JSONObject json,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onStallWarning(JSONObject json,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onScrubGeo(JSONObject json,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onFriends(JSONObject json,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onFavorite(JSONObject source,
JSONObject target,
JSONObject targetObject,
StreamListener[] listeners)
throws TwitterException
TwitterExceptionprotected void onUnfavorite(JSONObject source,
JSONObject target,
JSONObject targetObject,
StreamListener[] listeners)
throws TwitterException
TwitterExceptionprotected void onFollow(JSONObject source,
JSONObject target,
StreamListener[] listeners)
throws TwitterException
TwitterExceptionprotected void onUnfollow(JSONObject source,
JSONObject target,
StreamListener[] listeners)
throws TwitterException
TwitterExceptionprotected void onUserListMemberAddition(JSONObject addedMember,
JSONObject owner,
JSONObject userList,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onUserListMemberDeletion(JSONObject deletedMember,
JSONObject owner,
JSONObject userList,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onUserListSubscription(JSONObject source,
JSONObject owner,
JSONObject userList,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onUserListUnsubscription(JSONObject source,
JSONObject owner,
JSONObject userList,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onUserListCreation(JSONObject source,
JSONObject userList,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onUserListUpdated(JSONObject source,
JSONObject userList,
StreamListener[] listeners)
throws TwitterException,
JSONException
TwitterExceptionJSONExceptionprotected void onUserListDestroyed(JSONObject source,
JSONObject userList,
StreamListener[] listeners)
throws TwitterException
TwitterExceptionprotected void onUserUpdate(JSONObject source,
JSONObject target,
StreamListener[] listeners)
throws TwitterException
TwitterExceptionprotected void onBlock(JSONObject source,
JSONObject target,
StreamListener[] listeners)
throws TwitterException
TwitterExceptionprotected void onUnblock(JSONObject source,
JSONObject target,
StreamListener[] listeners)
throws TwitterException
TwitterExceptionprotected 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 StatusStreamjava.io.IOExceptionprotected Status asStatus(JSONObject json) throws TwitterException
TwitterExceptionprotected DirectMessage asDirectMessage(JSONObject json) throws TwitterException
TwitterExceptionprotected long[] asFriendList(JSONObject json)
throws TwitterException
TwitterExceptionprotected User asUser(JSONObject json) throws TwitterException
TwitterExceptionprotected UserList asUserList(JSONObject json) throws TwitterException
TwitterExceptionpublic abstract void next(StatusListener listener) throws TwitterException
StatusStreamnext in interface StatusStreamlistener - a StatusListener implementationTwitterException - when the end of the stream has been reached.public abstract void next(StreamListener[] listeners, RawStreamListener[] rawStreamListeners) throws TwitterException
TwitterExceptionpublic void onException(java.lang.Exception e,
StreamListener[] listeners,
RawStreamListener[] rawStreamListeners)