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 TwitterEndpoint
endpoint
Instance of TwitterEndpoint.protected org.slf4j.Logger
log
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTwitterConsumerHandler(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 long
getLastId()
protected twitter4j.Paging
getLastIdPaging()
protected twitter4j.Twitter
getTwitter()
abstract List<org.apache.camel.Exchange>
pollConsume()
Called by polling consumers during each poll.void
setLastId(long sinceId)
Support to update the Consumer's lastId when starting the consumerprotected void
setLastIdIfGreater(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()
-
-