public class DirectMessageReceivingMessageSource extends IntegrationObjectSupport
logger
Constructor and Description |
---|
DirectMessageReceivingMessageSource(Twitter twitter,
String metadataKey) |
Modifier and Type | Method and Description |
---|---|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
long |
getLastProcessedId() |
protected int |
getPageSize() |
protected Twitter |
getTwitter() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
protected List<DirectMessage> |
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 |
setPageSize(int pageSize)
Set the limit for the number of results returned on each poll; default 20.
|
void |
setPrefetchThreshold(int prefetchThreshold) |
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toString
public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected List<DirectMessage> pollForTweets(long sinceId)
sinceId
- The id of the last reported tweet.public void setMetadataStore(MetadataStore metadataStore)
public void setPrefetchThreshold(int prefetchThreshold)
protected Twitter getTwitter()
protected int getPageSize()
public void setPageSize(int pageSize)
pageSize
- The pageSize.protected void onInit() throws Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
Exception
- Any 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.