public class TwitterSearchOutboundGateway
extends org.springframework.integration.handler.AbstractReplyProducingMessageHandler
implements org.springframework.integration.expression.IntegrationEvaluationContextAware
AbstractReplyProducingMessageHandler
implementation to perform request/reply
Twitter search with SearchParameters
as the result of searchArgsExpression
expression evaluation.Constructor and Description |
---|
TwitterSearchOutboundGateway(org.springframework.social.twitter.api.Twitter twitter) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getComponentType() |
protected org.springframework.social.twitter.api.Twitter |
getTwitter() |
protected java.lang.Object |
handleRequestMessage(org.springframework.messaging.Message<?> requestMessage) |
void |
setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext) |
void |
setSearchArgsExpression(org.springframework.expression.Expression searchArgsExpression)
An expression that is used to build the search; must resolve to a
SearchParameters object, or a
String , in which case the default page size of 20 is applied,
or a list of up to 4 arguments, such as
"{payload, headers.pageSize, headers.sinceId, headers.maxId}" . |
doInit, doInvokeAdvisedRequestHandler, handleMessageInternal, hasAdviceChain, onInit, produceReply, setAdviceChain, setBeanClassLoader, setChannelResolver, setRequiresReply, shouldCopyRequestHeaders
getOutputChannel, setOutputChannel, setOutputChannelName, setSendTimeout
getOrder, handleMessage, setOrder, setShouldTrack
afterPropertiesSet, getApplicationContext, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toString
public TwitterSearchOutboundGateway(org.springframework.social.twitter.api.Twitter twitter)
public void setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext)
setIntegrationEvaluationContext
in interface org.springframework.integration.expression.IntegrationEvaluationContextAware
public void setSearchArgsExpression(org.springframework.expression.Expression searchArgsExpression)
SearchParameters
object, or a
String
, in which case the default page size of 20 is applied,
or a list of up to 4 arguments, such as
"{payload, headers.pageSize, headers.sinceId, headers.maxId}"
.
The first (required) argument must resolve to a String (query), the
optional arguments must resolve to an Number and represent the
page size, sinceId, and maxId respectively. Refer to the 'Spring
Social Twitter' documentation for more details.
When using a SearchParameters
directly, it is not necessary
to include the package: "new SearchParameters("#foo").count(20)")
.
Default: "payload"
.
searchArgsExpression
- The expression.public java.lang.String getComponentType()
getComponentType
in interface org.springframework.integration.support.context.NamedComponent
getComponentType
in class org.springframework.integration.handler.AbstractMessageHandler
protected org.springframework.social.twitter.api.Twitter getTwitter()
protected java.lang.Object handleRequestMessage(org.springframework.messaging.Message<?> requestMessage)
handleRequestMessage
in class org.springframework.integration.handler.AbstractReplyProducingMessageHandler