org.springframework.integration.twitter.inbound
Class MentionsReceivingMessageSource

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.endpoint.AbstractEndpoint
          extended by org.springframework.integration.twitter.inbound.MentionsReceivingMessageSource
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, Lifecycle, Phased, SmartLifecycle, NamedComponent, MessageSource

public class MentionsReceivingMessageSource
extends AbstractEndpoint

Handles forwarding all new Status that are 'replies' or 'mentions' to some other tweet.

Since:
2.0

Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
MentionsReceivingMessageSource(TwitterOperations twitter)
           
 
Method Summary
protected  void doStart()
          Subclasses must implement this method with the start behavior.
protected  void doStop()
          Subclasses must implement this method with the stop behavior.
 java.lang.String getComponentType()
          Subclasses may implement this method to provide component type information.
protected  TwitterOperations getTwitterOperations()
           
protected  void onInit()
          Subclasses may implement this for initialization logic.
protected  java.util.List<Tweet> pollForTweets(long sinceId)
          Subclasses must implement this to return tweets.
 Message<?> receive()
          Retrieve the next available message from this source.
 
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MentionsReceivingMessageSource

public MentionsReceivingMessageSource(TwitterOperations twitter)
Method Detail

getComponentType

public java.lang.String getComponentType()
Description copied from class: IntegrationObjectSupport
Subclasses may implement this method to provide component type information.

Specified by:
getComponentType in interface NamedComponent
Overrides:
getComponentType in class IntegrationObjectSupport

pollForTweets

protected java.util.List<Tweet> pollForTweets(long sinceId)
Subclasses must implement this to return tweets. The 'sinceId' value will be negative if no last id is known.


getTwitterOperations

protected TwitterOperations getTwitterOperations()

onInit

protected void onInit()
               throws java.lang.Exception
Description copied from class: IntegrationObjectSupport
Subclasses may implement this for initialization logic.

Overrides:
onInit in class IntegrationObjectSupport
Throws:
java.lang.Exception

receive

public Message<?> receive()
Description copied from interface: MessageSource
Retrieve the next available message from this source. Returns null if no message is available.

Specified by:
receive in interface MessageSource

doStart

protected void doStart()
Description copied from class: AbstractEndpoint
Subclasses must implement this method with the start behavior. This method will be invoked while holding the AbstractEndpoint.lifecycleLock.

Specified by:
doStart in class AbstractEndpoint

doStop

protected void doStop()
Description copied from class: AbstractEndpoint
Subclasses must implement this method with the stop behavior. This method will be invoked while holding the AbstractEndpoint.lifecycleLock.

Specified by:
doStop in class AbstractEndpoint