org.apache.camel.component.twitter.consumer.streaming
Class StreamingConsumer

java.lang.Object
  extended by org.apache.camel.component.twitter.consumer.Twitter4JConsumer
      extended by org.apache.camel.component.twitter.consumer.streaming.StreamingConsumer
All Implemented Interfaces:
twitter4j.StatusListener
Direct Known Subclasses:
FilterConsumer, SampleConsumer

public abstract class StreamingConsumer
extends Twitter4JConsumer
implements twitter4j.StatusListener

Super class providing consuming capabilities for the streaming API.


Field Summary
protected  twitter4j.TwitterStream twitterStream
           
 
Fields inherited from class org.apache.camel.component.twitter.consumer.Twitter4JConsumer
lastId, te
 
Constructor Summary
StreamingConsumer(TwitterEndpoint te)
           
 
Method Summary
 List<twitter4j.Status> directConsume()
          Called by direct consumers.
 void doStart()
           
 void doStop()
           
 void onDeletionNotice(twitter4j.StatusDeletionNotice statusDeletionNotice)
           
 void onException(Exception ex)
           
 void onScrubGeo(long userId, long upToStatusId)
           
 void onStatus(twitter4j.Status status)
           
 void onTrackLimitationNotice(int numberOfLimitedStatuses)
           
 List<twitter4j.Status> pollConsume()
          Called by polling consumers during each poll.
 void registerTweetListener(TweeterStatusListener tweeterStatusListener)
           
protected abstract  void startStreaming()
           
 void unregisterTweetListener(TweeterStatusListener tweeterStatusListener)
           
 
Methods inherited from class org.apache.camel.component.twitter.consumer.Twitter4JConsumer
checkLastId, setLastId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface twitter4j.StatusListener
onStallWarning
 

Field Detail

twitterStream

protected final twitter4j.TwitterStream twitterStream
Constructor Detail

StreamingConsumer

public StreamingConsumer(TwitterEndpoint te)
Method Detail

pollConsume

public List<twitter4j.Status> pollConsume()
                                   throws twitter4j.TwitterException
Description copied from class: Twitter4JConsumer
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.

Specified by:
pollConsume in class Twitter4JConsumer
Throws:
twitter4j.TwitterException

directConsume

public List<twitter4j.Status> directConsume()
                                     throws twitter4j.TwitterException
Description copied from class: Twitter4JConsumer
Called by direct consumers.

Specified by:
directConsume in class Twitter4JConsumer
Throws:
twitter4j.TwitterException

onException

public void onException(Exception ex)

onStatus

public void onStatus(twitter4j.Status status)
Specified by:
onStatus in interface twitter4j.StatusListener

onDeletionNotice

public void onDeletionNotice(twitter4j.StatusDeletionNotice statusDeletionNotice)
Specified by:
onDeletionNotice in interface twitter4j.StatusListener

onTrackLimitationNotice

public void onTrackLimitationNotice(int numberOfLimitedStatuses)
Specified by:
onTrackLimitationNotice in interface twitter4j.StatusListener

onScrubGeo

public void onScrubGeo(long userId,
                       long upToStatusId)
Specified by:
onScrubGeo in interface twitter4j.StatusListener

registerTweetListener

public void registerTweetListener(TweeterStatusListener tweeterStatusListener)

unregisterTweetListener

public void unregisterTweetListener(TweeterStatusListener tweeterStatusListener)

doStart

public void doStart()

doStop

public void doStop()

startStreaming

protected abstract void startStreaming()


Apache Camel