public class TimelineReceivingMessageSource extends IntegrationObjectSupport
MessageSource
lets Spring Integration consume
given account's timeline as messages. It has support for dynamic throttling of API requests.logger
Constructor and Description |
---|
TimelineReceivingMessageSource(org.springframework.social.twitter.api.Twitter twitter,
java.lang.String metadataKey) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
long |
getLastProcessedId() |
protected org.springframework.social.twitter.api.Twitter |
getTwitter() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
protected java.util.List<org.springframework.social.twitter.api.Tweet> |
pollForTweets(long sinceId)
Subclasses must implement this to return tweets.
|
Message<?> |
receive()
Retrieve the next available message from this source.
|
void |
setMetadataStore(MetadataStore metadataStore) |
void |
setPrefetchThreshold(int prefetchThreshold) |
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
public TimelineReceivingMessageSource(org.springframework.social.twitter.api.Twitter twitter, java.lang.String metadataKey)
public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected java.util.List<org.springframework.social.twitter.api.Tweet> pollForTweets(long sinceId)
public void setMetadataStore(MetadataStore metadataStore)
public void setPrefetchThreshold(int prefetchThreshold)
protected org.springframework.social.twitter.api.Twitter getTwitter()
protected void onInit() throws java.lang.Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
java.lang.Exception
public Message<?> receive()
MessageSource
null
if no message is available.receive
in interface MessageSource
@ManagedAttribute public long getLastProcessedId()
-1
if lastProcessedId is not set, yet.