public class TwitterFollowingProvider extends Object implements StreamsProvider, Serializable
Modifier and Type | Field and Description |
---|---|
protected Twitter |
client |
protected com.google.common.util.concurrent.ListeningExecutorService |
executor |
protected List<Long> |
ids |
static int |
MAX_NUMBER_WAITING |
protected List<String> |
names |
protected Queue<StreamsDatum> |
providerQueue |
protected AtomicBoolean |
running |
static String |
STREAMS_ID |
Constructor and Description |
---|
TwitterFollowingProvider() |
TwitterFollowingProvider(TwitterFollowingConfiguration configurationObject) |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp() |
protected Queue<StreamsDatum> |
constructQueue() |
protected Runnable |
createTask(Long id,
String name) |
TwitterFollowingConfiguration |
getConfig() |
String |
getId() |
protected Twitter |
getTwitterClient() |
boolean |
isRunning() |
static void |
main(String[] args)
To use from command line:
Supply (at least) the following required configuration in application.conf:
twitter.oauth.consumerKey
twitter.oauth.consumerSecret
twitter.oauth.accessToken
twitter.oauth.accessTokenSecret
twitter.info
Launch using:
mvn exec:java -Dexec.mainClass=org.apache.streams.twitter.provider.TwitterFollowingProvider -Dexec.args="application.conf tweets.json"
|
void |
prepare(Object configurationObject) |
StreamsResultSet |
readCurrent() |
StreamsResultSet |
readNew(BigInteger sequence) |
StreamsResultSet |
readRange(org.joda.time.DateTime start,
org.joda.time.DateTime end) |
boolean |
shouldContinuePulling(List<User> users) |
void |
startStream() |
protected void |
submitTask(Runnable providerTask) |
public static final String STREAMS_ID
protected Twitter client
protected com.google.common.util.concurrent.ListeningExecutorService executor
protected final AtomicBoolean running
protected volatile Queue<StreamsDatum> providerQueue
public static final int MAX_NUMBER_WAITING
public TwitterFollowingProvider()
public TwitterFollowingProvider(TwitterFollowingConfiguration configurationObject)
public static void main(String[] args) throws Exception
args
- argsException
- Exceptionpublic TwitterFollowingConfiguration getConfig()
public String getId()
getId
in interface StreamsOperation
public void prepare(Object configurationObject)
prepare
in interface StreamsOperation
public void startStream()
startStream
in interface StreamsProvider
protected void submitTask(Runnable providerTask)
protected Twitter getTwitterClient() throws InstantiationException
InstantiationException
public StreamsResultSet readCurrent()
readCurrent
in interface StreamsProvider
public StreamsResultSet readNew(BigInteger sequence)
readNew
in interface StreamsProvider
public StreamsResultSet readRange(org.joda.time.DateTime start, org.joda.time.DateTime end)
readRange
in interface StreamsProvider
public boolean isRunning()
isRunning
in interface StreamsProvider
protected Queue<StreamsDatum> constructQueue()
public void cleanUp()
cleanUp
in interface StreamsOperation
Copyright © 2018 The Apache Software Foundation. All rights reserved.