org.apache.camel.component.twitter.consumer
Class Twitter4JConsumer

java.lang.Object
  extended by org.apache.camel.component.twitter.consumer.Twitter4JConsumer
Direct Known Subclasses:
DirectMessageConsumer, HomeConsumer, MentionsConsumer, RetweetsConsumer, SearchConsumer, StreamingConsumer, UserConsumer

public abstract class Twitter4JConsumer
extends Object


Field Summary
protected  long lastId
          The last tweet ID received.
protected  TwitterEndpoint te
          Instance of TwitterEndpoint.
 
Constructor Summary
protected Twitter4JConsumer(TwitterEndpoint te)
           
 
Method Summary
protected  void checkLastId(long newId)
          Can't assume that the end of the list will be the most recent ID.
abstract  List<? extends Serializable> directConsume()
          Called by direct consumers.
abstract  List<? extends Serializable> pollConsume()
          Called by polling consumers during each poll.
 void setLastId(long sinceId)
          Support to update the Consumer's lastId when starting the consumer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

te

protected TwitterEndpoint te
Instance of TwitterEndpoint.


lastId

protected long lastId
The last tweet ID received.

Constructor Detail

Twitter4JConsumer

protected Twitter4JConsumer(TwitterEndpoint te)
Method Detail

checkLastId

protected void checkLastId(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.


pollConsume

public abstract List<? extends Serializable> pollConsume()
                                                  throws twitter4j.TwitterException
Called by polling consumers during each poll. It needs to be separate from directConsume() since, as an example, streaming API polling allows tweets to build up between polls.

Throws:
twitter4j.TwitterException

directConsume

public abstract List<? extends Serializable> directConsume()
                                                    throws twitter4j.TwitterException
Called by direct consumers.

Throws:
twitter4j.TwitterException

setLastId

public void setLastId(long sinceId)
Support to update the Consumer's lastId when starting the consumer

Parameters:
sinceId -


Apache Camel