org.springframework.integration.twitter.inbound
Class DirectMessageReceivingMessageSource

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.twitter.inbound.DirectMessageReceivingMessageSource
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, NamedComponent, MessageSource

public class DirectMessageReceivingMessageSource
extends IntegrationObjectSupport

This class handles support for receiving DMs (direct messages) using Twitter.

Since:
2.0

Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
DirectMessageReceivingMessageSource(TwitterOperations twitter)
           
 
Method Summary
 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.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectMessageReceivingMessageSource

public DirectMessageReceivingMessageSource(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