twitter4j
Class SiteStreamsImpl

java.lang.Object
  extended by twitter4j.AbstractStreamImplementation
      extended by twitter4j.SiteStreamsImpl
All Implemented Interfaces:
StreamImplementation, StreamListener

 class SiteStreamsImpl
extends AbstractStreamImplementation
implements StreamImplementation, StreamListener

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

Nested Class Summary
 
Nested classes/interfaces inherited from class twitter4j.AbstractStreamImplementation
AbstractStreamImplementation.StreamEvent
 
Field Summary
private static java.lang.ThreadLocal<java.lang.Integer> forUser
           
(package private)  SiteStreamsListener listener
           
 
Fields inherited from class twitter4j.AbstractStreamImplementation
dispatcher, logger
 
Constructor Summary
SiteStreamsImpl(twitter4j.internal.async.Dispatcher dispatcher, twitter4j.internal.http.HttpResponse response, Configuration conf)
           
SiteStreamsImpl(twitter4j.internal.async.Dispatcher dispatcher, java.io.InputStream stream, Configuration conf)
           
 
Method Summary
 void next(StreamListener[] listeners)
           
protected  void onBlock(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target)
           
protected  void onDelete(twitter4j.internal.org.json.JSONObject json)
           
protected  void onDirectMessage(twitter4j.internal.org.json.JSONObject json)
           
 void onException(java.lang.Exception ex)
           
protected  void onFavorite(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target, twitter4j.internal.org.json.JSONObject targetObject)
           
protected  void onFollow(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target)
           
protected  void onFriends(twitter4j.internal.org.json.JSONObject json)
           
protected  void onStatus(twitter4j.internal.org.json.JSONObject json)
           
protected  void onUnblock(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target)
           
protected  void onUnfavorite(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target, twitter4j.internal.org.json.JSONObject targetObject)
           
protected  void onUnfollow(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target)
           
protected  void onUserListCreation(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject userList)
           
protected  void onUserListDestroyed(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject userList)
           
protected  void onUserListMemberAddition(twitter4j.internal.org.json.JSONObject addedMember, twitter4j.internal.org.json.JSONObject owner, twitter4j.internal.org.json.JSONObject userList)
           
protected  void onUserListMemberDeletion(twitter4j.internal.org.json.JSONObject deletedMember, twitter4j.internal.org.json.JSONObject owner, twitter4j.internal.org.json.JSONObject userList)
           
protected  void onUserListSubscription(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject owner, twitter4j.internal.org.json.JSONObject userList)
           
protected  void onUserListUnsubscription(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject owner, twitter4j.internal.org.json.JSONObject userList)
           
protected  void onUserListUpdated(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject userList)
           
protected  void onUserUpdate(twitter4j.internal.org.json.JSONObject source, twitter4j.internal.org.json.JSONObject target)
           
protected  java.lang.String parseLine(java.lang.String line)
           
 
Methods inherited from class twitter4j.AbstractStreamImplementation
asDirectMessage, asFriendList, asStatus, asUser, asUserList, close, handleNextElement, onLimit, onRetweet, onScrubGeo, onSender
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface twitter4j.StreamImplementation
close
 

Field Detail

listener

SiteStreamsListener listener

forUser

private static java.lang.ThreadLocal<java.lang.Integer> forUser
Constructor Detail

SiteStreamsImpl

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

SiteStreamsImpl

SiteStreamsImpl(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(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 twitter4j.internal.org.json.JSONException
Overrides:
onDelete in class AbstractStreamImplementation
Throws:
twitter4j.internal.org.json.JSONException

onDirectMessage

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

onFriends

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

onFavorite

protected void onFavorite(twitter4j.internal.org.json.JSONObject source,
                          twitter4j.internal.org.json.JSONObject target,
                          twitter4j.internal.org.json.JSONObject targetObject)
                   throws TwitterException
Overrides:
onFavorite in class AbstractStreamImplementation
Throws:
TwitterException

onUnfavorite

protected void onUnfavorite(twitter4j.internal.org.json.JSONObject source,
                            twitter4j.internal.org.json.JSONObject target,
                            twitter4j.internal.org.json.JSONObject targetObject)
                     throws TwitterException
Overrides:
onUnfavorite in class AbstractStreamImplementation
Throws:
TwitterException

onFollow

protected void onFollow(twitter4j.internal.org.json.JSONObject source,
                        twitter4j.internal.org.json.JSONObject target)
                 throws TwitterException
Overrides:
onFollow in class AbstractStreamImplementation
Throws:
TwitterException

onUnfollow

protected void onUnfollow(twitter4j.internal.org.json.JSONObject source,
                          twitter4j.internal.org.json.JSONObject target)
                   throws TwitterException
Overrides:
onUnfollow in class AbstractStreamImplementation
Throws:
TwitterException

onUserListMemberAddition

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

onUserListMemberDeletion

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

onUserListSubscription

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

onUserListUnsubscription

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

onUserListCreation

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

onUserListUpdated

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

onUserListDestroyed

protected void onUserListDestroyed(twitter4j.internal.org.json.JSONObject source,
                                   twitter4j.internal.org.json.JSONObject userList)
                            throws TwitterException
Overrides:
onUserListDestroyed in class AbstractStreamImplementation
Throws:
TwitterException

onUserUpdate

protected void onUserUpdate(twitter4j.internal.org.json.JSONObject source,
                            twitter4j.internal.org.json.JSONObject target)
                     throws TwitterException
Overrides:
onUserUpdate in class AbstractStreamImplementation
Throws:
TwitterException

onBlock

protected void onBlock(twitter4j.internal.org.json.JSONObject source,
                       twitter4j.internal.org.json.JSONObject target)
                throws TwitterException
Overrides:
onBlock in class AbstractStreamImplementation
Throws:
TwitterException

onUnblock

protected void onUnblock(twitter4j.internal.org.json.JSONObject source,
                         twitter4j.internal.org.json.JSONObject target)
                  throws TwitterException
Overrides:
onUnblock in class AbstractStreamImplementation
Throws:
TwitterException

onException

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