public class SevenDaySearchProvider extends Object implements StreamsProvider, Serializable
Modifier and Type | Field and Description |
---|---|
protected Twitter |
client |
protected com.google.common.util.concurrent.ListeningExecutorService |
executor |
protected ReadWriteLock |
lock |
static int |
MAX_NUMBER_WAITING |
protected Queue<StreamsDatum> |
providerQueue |
protected SevenDaySearchRequest |
request |
protected AtomicBoolean |
running |
Constructor and Description |
---|
SevenDaySearchProvider() |
SevenDaySearchProvider(SevenDaySearchProviderConfiguration config) |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp() |
protected Queue<StreamsDatum> |
constructQueue() |
SevenDaySearchProviderConfiguration |
getConfig() |
String |
getId() |
Queue<StreamsDatum> |
getProviderQueue() |
Twitter |
getTwitterClient()
get Twitter Client from TwitterUserInformationConfiguration.
|
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.TwitterTimelineProvider -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) |
void |
startStream() |
protected void |
submitSearchThread() |
public static final int MAX_NUMBER_WAITING
protected final ReadWriteLock lock
protected volatile Queue<StreamsDatum> providerQueue
protected SevenDaySearchRequest request
protected Twitter client
protected com.google.common.util.concurrent.ListeningExecutorService executor
protected final AtomicBoolean running
public SevenDaySearchProvider()
public SevenDaySearchProvider(SevenDaySearchProviderConfiguration config)
public SevenDaySearchProviderConfiguration getConfig()
public static void main(String[] args) throws Exception
args
- argsException
- Exceptionpublic Queue<StreamsDatum> getProviderQueue()
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 submitSearchThread()
public StreamsResultSet readCurrent()
readCurrent
in interface StreamsProvider
protected Queue<StreamsDatum> constructQueue()
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 Twitter getTwitterClient() throws InstantiationException
InstantiationException
public void cleanUp()
cleanUp
in interface StreamsOperation
public boolean isRunning()
isRunning
in interface StreamsProvider
Copyright © 2018 The Apache Software Foundation. All rights reserved.