Class AbstractTwitterConsumerHandler
- java.lang.Object
-
- org.apache.camel.component.twitter.consumer.AbstractTwitterConsumerHandler
-
- Direct Known Subclasses:
DirectMessageConsumerHandler,HomeConsumerHandler,MentionsConsumerHandler,RetweetsConsumerHandler,SearchConsumerHandler,UserConsumerHandler,UserListConsumerHandler
public abstract class AbstractTwitterConsumerHandler extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected TwitterEndpointendpointInstance of TwitterEndpoint.protected org.slf4j.Loggerlog
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTwitterConsumerHandler(TwitterEndpoint endpoint)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract List<org.apache.camel.Exchange>directConsume()Called by direct consumers.protected longgetLastId()protected twitter4j.PaginggetLastIdPaging()protected twitter4j.TwittergetTwitter()abstract List<org.apache.camel.Exchange>pollConsume()Called by polling consumers during each poll.voidsetLastId(long sinceId)Support to update the Consumer's lastId when starting the consumerprotected voidsetLastIdIfGreater(long newId)Can't assume that the end of the list will be the most recent ID.
-
-
-
Field Detail
-
log
protected final org.slf4j.Logger log
-
endpoint
protected final TwitterEndpoint endpoint
Instance of TwitterEndpoint.
-
-
Constructor Detail
-
AbstractTwitterConsumerHandler
protected AbstractTwitterConsumerHandler(TwitterEndpoint endpoint)
-
-
Method Detail
-
pollConsume
public abstract List<org.apache.camel.Exchange> pollConsume() throws twitter4j.TwitterException
Called by polling consumers during each poll. It needs to be separate from directConsume() since, as an example, to allow tweets to build up between polls.- Throws:
twitter4j.TwitterException
-
directConsume
public abstract List<org.apache.camel.Exchange> directConsume() throws twitter4j.TwitterException
Called by direct consumers.- Throws:
twitter4j.TwitterException
-
setLastIdIfGreater
protected void setLastIdIfGreater(long newId)
Can't assume that the end of the list will be the most recent ID. The Twitter API sometimes returns them slightly out of order.
-
setLastId
public void setLastId(long sinceId)
Support to update the Consumer's lastId when starting the consumer
-
getTwitter
protected twitter4j.Twitter getTwitter()
-
getLastId
protected long getLastId()
-
getLastIdPaging
protected twitter4j.Paging getLastIdPaging()
-
-