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 config) |
| 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 config)
public static void main(String[] args) throws Exception
args - argsException - Exceptionpublic TwitterFollowingConfiguration getConfig()
public String getId()
getId in interface StreamsOperationpublic void prepare(Object configurationObject)
prepare in interface StreamsOperationpublic void startStream()
startStream in interface StreamsProviderprotected void submitTask(Runnable providerTask)
protected Twitter getTwitterClient() throws InstantiationException
InstantiationExceptionpublic StreamsResultSet readCurrent()
readCurrent in interface StreamsProviderpublic StreamsResultSet readNew(BigInteger sequence)
readNew in interface StreamsProviderpublic StreamsResultSet readRange(org.joda.time.DateTime start, org.joda.time.DateTime end)
readRange in interface StreamsProviderpublic boolean isRunning()
isRunning in interface StreamsProviderprotected Queue<StreamsDatum> constructQueue()
public void cleanUp()
cleanUp in interface StreamsOperationCopyright © 2018 The Apache Software Foundation. All rights reserved.