public interface TwitterStream extends OAuthSupport, TwitterBase
Modifier and Type | Method and Description |
---|---|
TwitterStream |
addConnectionLifeCycleListener(ConnectionLifeCycleListener listener)
Adds a ConnectionLifeCycleListener
|
TwitterStream |
addListener(StreamListener listener) |
TwitterStream |
cleanUp()
shutdown internal stream consuming thread
|
TwitterStream |
clearListeners()
clear status listeners
|
TwitterStream |
filter(FilterQuery query)
Start consuming public statuses that match one or more filter predicates.
|
TwitterStream |
filter(java.lang.String... track)
Start consuming public statuses that match the filter predicate.
|
TwitterStream |
firehose(int count)
Starts listening on all public statuses.
|
TwitterStream |
links(int count)
Starts listening on all public statuses containing links.
|
TwitterStream |
onException(Consumer<java.lang.Exception> action) |
TwitterStream |
onStatus(Consumer<Status> action) |
TwitterStream |
removeListener(StreamListener listener) |
TwitterStream |
replaceListener(StreamListener toBeRemoved,
StreamListener toBeAdded)
replace existing listener
|
TwitterStream |
retweet()
Starts listening on all retweets.
|
TwitterStream |
sample()
Starts listening on random sample of all public statuses.
|
TwitterStream |
sample(java.lang.String language)
Starts listening on random sample of all public statuses.
|
TwitterStream |
shutdown()
Shuts down internal dispatcher thread shared by all TwitterStream instances.
|
StreamController |
site(boolean withFollowings,
long... follow)
Deprecated.
Since Twitter4J 4.0.7
|
TwitterStream |
user()
Deprecated.
Since Twitter4J 4.0.7
|
TwitterStream |
user(java.lang.String... track)
Deprecated.
Since Twitter4J 4.0.7
|
getOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthRequestToken, getOAuthRequestToken, getOAuthRequestToken, getOAuthRequestToken, setOAuthAccessToken, setOAuthConsumer
addRateLimitStatusListener, getAuthorization, getConfiguration, getId, getScreenName, onRateLimitReached, onRateLimitStatus
TwitterStream addConnectionLifeCycleListener(ConnectionLifeCycleListener listener)
listener
- listener to be addedTwitterStream addListener(StreamListener listener)
listener
- listener to addTwitterStream onStatus(Consumer<Status> action)
action
- action when receiving StatusTwitterStream onException(Consumer<java.lang.Exception> action)
action
- action when receiving TwitterExceptionTwitterStream removeListener(StreamListener listener)
listener
- listener to removeTwitterStream clearListeners()
TwitterStream replaceListener(StreamListener toBeRemoved, StreamListener toBeAdded)
toBeRemoved
- listener to be removedtoBeAdded
- listener to be addedTwitterStream firehose(int count)
count
- Indicates the number of previous statuses to stream before transitioning to the live stream.StatusStream
,
Streaming API Methods statuses/firehoseTwitterStream links(int count)
count
- Indicates the number of previous statuses to stream before transitioning to the live stream.StatusStream
,
Streaming API Methods statuses/linksTwitterStream retweet()
StatusStream
,
Streaming API Methods statuses/retweetTwitterStream sample()
StatusStream
,
Streaming API: Methods statuses/sampleTwitterStream sample(java.lang.String language)
Only samples Tweets written in the given language.
language
- language to be sampledStatusStream
,
Streaming API: Methods statuses/sampleTwitterStream user()
java.lang.IllegalStateException
- when non-UserStreamListener is set, or no listener is setTwitterStream user(java.lang.String... track)
track
- keywords to trackjava.lang.IllegalStateException
- when non-UserStreamListener is set, or no listener is setStreamController site(boolean withFollowings, long... follow)
withFollowings
- whether to receive status updates from people followingfollow
- an array of users to include in the streamTwitterStream filter(FilterQuery query)
query
- Filter queryStatusStream
,
Streaming API Methods statuses/filterTwitterStream filter(java.lang.String... track)
track
- words to be filteredTwitterStream cleanUp()
TwitterStream shutdown()
Copyright © 2018. All Rights Reserved.