twitter4j
Class StatusStreamImpl

java.lang.Object
  extended by twitter4j.AbstractStreamImplementation
      extended by twitter4j.StatusStreamImpl
All Implemented Interfaces:
StatusStream, StreamImplementation
Direct Known Subclasses:
UserStreamImpl

 class StatusStreamImpl
extends AbstractStreamImplementation
implements StatusStream

StatusStream implementation. This class is NOT intended to be extended but left non-final for the ease of mock testing.

Since:
Twitter4J 2.1.2
Author:
Yusuke Yamamoto - yusuke at mac.com

Nested Class Summary
 
Nested classes/interfaces inherited from class twitter4j.AbstractStreamImplementation
AbstractStreamImplementation.StreamEvent
 
Field Summary
protected  java.lang.String line
           
protected  StreamListener[] listeners
           
 
Fields inherited from class twitter4j.AbstractStreamImplementation
dispatcher, logger
 
Constructor Summary
StatusStreamImpl(twitter4j.internal.async.Dispatcher dispatcher, twitter4j.internal.http.HttpResponse response, Configuration conf)
           
StatusStreamImpl(twitter4j.internal.async.Dispatcher dispatcher, java.io.InputStream stream, Configuration conf)
           
 
Method Summary
 void next(StatusListener listener)
          Reads next status from this stream.
 void next(StreamListener[] listeners)
           
protected  void onDelete(twitter4j.internal.org.json.JSONObject json)
           
 void onException(java.lang.Exception e)
           
protected  void onLimit(twitter4j.internal.org.json.JSONObject json)
           
protected  void onScrubGeo(twitter4j.internal.org.json.JSONObject json)
           
protected  void onStatus(twitter4j.internal.org.json.JSONObject json)
           
protected  java.lang.String parseLine(java.lang.String line)
           
 
Methods inherited from class twitter4j.AbstractStreamImplementation
asDirectMessage, asFriendList, asStatus, asUser, asUserList, close, handleNextElement, onBlock, onDirectMessage, onFavorite, onFollow, onFriends, onRetweet, onSender, onUnblock, onUnfavorite, onUnfollow, onUserListCreation, onUserListDestroyed, onUserListMemberAddition, onUserListMemberDeletion, onUserListSubscription, onUserListUnsubscription, onUserListUpdated, onUserUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface twitter4j.StatusStream
close
 

Field Detail

line

protected java.lang.String line

listeners

protected StreamListener[] listeners
Constructor Detail

StatusStreamImpl

StatusStreamImpl(twitter4j.internal.async.Dispatcher dispatcher,
                 java.io.InputStream stream,
                 Configuration conf)
           throws java.io.IOException
Throws:
java.io.IOException

StatusStreamImpl

StatusStreamImpl(twitter4j.internal.async.Dispatcher dispatcher,
                 twitter4j.internal.http.HttpResponse response,
                 Configuration conf)
           throws java.io.IOException
Throws:
java.io.IOException
Method Detail

next

public void next(StatusListener listener)
          throws TwitterException
Reads next status from this stream.

Specified by:
next in interface StatusStream
Parameters:
listener - a StatusListener implementation
Throws:
TwitterException - when the end of the stream has been reached.
java.lang.IllegalStateException - when the end of the stream had been reached.

next

public void next(StreamListener[] listeners)
          throws TwitterException
Specified by:
next in interface StreamImplementation
Specified by:
next in class AbstractStreamImplementation
Throws:
TwitterException

parseLine

protected java.lang.String parseLine(java.lang.String line)
Overrides:
parseLine in class AbstractStreamImplementation

onStatus

protected void onStatus(twitter4j.internal.org.json.JSONObject json)
                 throws TwitterException
Overrides:
onStatus in class AbstractStreamImplementation
Throws:
TwitterException

onDelete

protected void onDelete(twitter4j.internal.org.json.JSONObject json)
                 throws TwitterException,
                        twitter4j.internal.org.json.JSONException
Overrides:
onDelete in class AbstractStreamImplementation
Throws:
TwitterException
twitter4j.internal.org.json.JSONException

onLimit

protected void onLimit(twitter4j.internal.org.json.JSONObject json)
                throws TwitterException,
                       twitter4j.internal.org.json.JSONException
Overrides:
onLimit in class AbstractStreamImplementation
Throws:
TwitterException
twitter4j.internal.org.json.JSONException

onScrubGeo

protected void onScrubGeo(twitter4j.internal.org.json.JSONObject json)
                   throws TwitterException,
                          twitter4j.internal.org.json.JSONException
Overrides:
onScrubGeo in class AbstractStreamImplementation
Throws:
TwitterException
twitter4j.internal.org.json.JSONException

onException

public void onException(java.lang.Exception e)
Specified by:
onException in interface StreamImplementation
Overrides:
onException in class AbstractStreamImplementation