Class BaseHttpMessageHandlerSpec<S extends BaseHttpMessageHandlerSpec<S,E>,E extends AbstractHttpRequestExecutingMessageHandler>
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
org.springframework.integration.dsl.MessageHandlerSpec<S,E>
org.springframework.integration.http.dsl.BaseHttpMessageHandlerSpec<S,E>
- Type Parameters:
S- the targetBaseHttpMessageHandlerSpecimplementation type.E- the targetAbstractHttpRequestExecutingMessageHandlerimplementation type.
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<E>,org.springframework.beans.factory.InitializingBean,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,org.springframework.integration.dsl.ComponentsRegistration
- Direct Known Subclasses:
HttpMessageHandlerSpec
public abstract class BaseHttpMessageHandlerSpec<S extends BaseHttpMessageHandlerSpec<S,E>,E extends AbstractHttpRequestExecutingMessageHandler>
extends org.springframework.integration.dsl.MessageHandlerSpec<S,E>
implements org.springframework.integration.dsl.ComponentsRegistration
The base
MessageHandlerSpec for AbstractHttpRequestExecutingMessageHandlers.- Since:
- 5.0
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BaseHttpMessageHandlerSpec(E handler) -
Method Summary
Modifier and Type Method Description Scharset(java.lang.String charset)Specify the charset name to use for converting String-typed payloads to bytes.SencodeUri(boolean encodeUri)Deprecated.since 5.3 in favor ofencodingMode(org.springframework.web.util.DefaultUriBuilderFactory.EncodingMode)SencodingMode(org.springframework.web.util.DefaultUriBuilderFactory.EncodingMode encodingMode)Specify aDefaultUriBuilderFactory.EncodingModefor uri construction.SexpectedResponseType(java.lang.Class<?> expectedResponseType)Specify the expected response type for the REST request.SexpectedResponseType(org.springframework.core.ParameterizedTypeReference<?> expectedResponseType)Specify aParameterizedTypeReferencefor the expected response type for the REST request.SexpectedResponseTypeExpression(org.springframework.expression.Expression expectedResponseTypeExpression)Specify a SpELExpressionto determine the type for the expected response The returned value of the expression could be an instance ofClassorStringrepresenting a fully qualified class name.<P> SexpectedResponseTypeFunction(java.util.function.Function<org.springframework.messaging.Message<P>,?> expectedResponseTypeFunction)Specify aFunctionto determine the type for the expected response The returned value of the expression could be an instance ofClassorStringrepresenting a fully qualified class name.protected SexpectReply(boolean expectReply)SextractPayload(boolean extractPayload)Specify whether the outbound message's payload should be extracted when preparing the request body.java.util.Map<java.lang.Object,java.lang.String>getComponentsToRegister()SheaderMapper(org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> headerMapper)Set theHeaderMapperto use when mapping between HTTP headers andMessageHeaders.ShttpMethod(org.springframework.http.HttpMethod httpMethod)Specify theHttpMethodfor requests.ShttpMethodExpression(org.springframework.expression.Expression httpMethodExpression)Specify the SpELExpressionto determineHttpMethodat runtime.<P> ShttpMethodFunction(java.util.function.Function<org.springframework.messaging.Message<P>,?> httpMethodFunction)Specify aFunctionto determineHttpMethodat runtime.protected abstract booleanisClientSet()SmappedRequestHeaders(java.lang.String... patterns)Provide the pattern array for request headers to map.SmappedResponseHeaders(java.lang.String... patterns)Provide the pattern array for response headers to map.StransferCookies(boolean transferCookies)Set totrueif you wishSet-Cookieheader in response to be transferred asCookieheader in subsequent interaction for a message.SuriVariable(java.lang.String variable, java.lang.String expression)Specify a value SpEL expression for the uri template variable.<P> SuriVariable(java.lang.String variable, java.util.function.Function<org.springframework.messaging.Message<P>,?> valueFunction)Specify aFunctionto evaluate a value for the uri template variable.SuriVariable(java.lang.String variable, org.springframework.expression.Expression expression)Specify anExpressionto evaluate a value for the uri template variable.SuriVariableExpressions(java.util.Map<java.lang.String,org.springframework.expression.Expression> uriVariableExpressions)Set the Map of URI variable expressions to evaluate against the outbound message when replacing the variable placeholders in a URI template.SuriVariablesExpression(java.lang.String uriVariablesExpression)Specify a SpEL expression to evaluate aMapof URI variables at runtime against request message.SuriVariablesExpression(org.springframework.expression.Expression uriVariablesExpression)Specify a SpEL expression to evaluate aMapof URI variables at runtime against request message.<P> SuriVariablesFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.util.Map<java.lang.String,?>> uriVariablesFunction)Specify aFunctionto evaluate aMapof URI variables at runtime against request message.Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
-
Constructor Details
-
Method Details
-
expectReply
-
encodeUri
Deprecated.since 5.3 in favor ofencodingMode(org.springframework.web.util.DefaultUriBuilderFactory.EncodingMode)Specify whether the real URI should be encoded afteruriVariablesexpanding and before send request via underlying implementation. The default value istrue.- Parameters:
encodeUri- true if the URI should be encoded.- Returns:
- the spec
-
encodingMode
public S encodingMode(org.springframework.web.util.DefaultUriBuilderFactory.EncodingMode encodingMode)Specify aDefaultUriBuilderFactory.EncodingModefor uri construction.- Parameters:
encodingMode- to use for uri construction.- Returns:
- the spec
- Since:
- 5.3
-
httpMethodExpression
Specify the SpELExpressionto determineHttpMethodat runtime.- Parameters:
httpMethodExpression- The method expression.- Returns:
- the spec
-
httpMethodFunction
public <P> S httpMethodFunction(java.util.function.Function<org.springframework.messaging.Message<P>,?> httpMethodFunction)Specify aFunctionto determineHttpMethodat runtime.- Type Parameters:
P- the payload type.- Parameters:
httpMethodFunction- The HTTP methodFunction.- Returns:
- the spec
-
httpMethod
Specify theHttpMethodfor requests. The default method isPOST.- Parameters:
httpMethod- theHttpMethodto use.- Returns:
- the spec
-
extractPayload
Specify whether the outbound message's payload should be extracted when preparing the request body. Otherwise the Message instance itself is serialized. The default value istrue.- Parameters:
extractPayload- true if the payload should be extracted.- Returns:
- the spec
-
charset
Specify the charset name to use for converting String-typed payloads to bytes. The default isUTF-8.- Parameters:
charset- The charset.- Returns:
- the spec
-
expectedResponseType
Specify the expected response type for the REST request.- Parameters:
expectedResponseType- The expected type.- Returns:
- the spec
-
expectedResponseType
public S expectedResponseType(org.springframework.core.ParameterizedTypeReference<?> expectedResponseType)Specify aParameterizedTypeReferencefor the expected response type for the REST request.- Parameters:
expectedResponseType- TheParameterizedTypeReferencefor expected type.- Returns:
- the spec
-
expectedResponseTypeExpression
public S expectedResponseTypeExpression(org.springframework.expression.Expression expectedResponseTypeExpression)Specify a SpELExpressionto determine the type for the expected response The returned value of the expression could be an instance ofClassorStringrepresenting a fully qualified class name.- Parameters:
expectedResponseTypeExpression- The expected response type expression.- Returns:
- the spec
-
expectedResponseTypeFunction
public <P> S expectedResponseTypeFunction(java.util.function.Function<org.springframework.messaging.Message<P>,?> expectedResponseTypeFunction)Specify aFunctionto determine the type for the expected response The returned value of the expression could be an instance ofClassorStringrepresenting a fully qualified class name.- Type Parameters:
P- the payload type.- Parameters:
expectedResponseTypeFunction- The expected response typeFunction.- Returns:
- the spec
-
headerMapper
public S headerMapper(org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> headerMapper)Set theHeaderMapperto use when mapping between HTTP headers andMessageHeaders.- Parameters:
headerMapper- The header mapper.- Returns:
- the spec
-
mappedRequestHeaders
Provide the pattern array for request headers to map.- Parameters:
patterns- the patterns for request headers to map.- Returns:
- the spec
- See Also:
DefaultHttpHeaderMapper.setOutboundHeaderNames(String[])
-
mappedResponseHeaders
Provide the pattern array for response headers to map.- Parameters:
patterns- the patterns for response headers to map.- Returns:
- the current Spec.
- See Also:
DefaultHttpHeaderMapper.setInboundHeaderNames(String[])
-
uriVariableExpressions
public S uriVariableExpressions(java.util.Map<java.lang.String,org.springframework.expression.Expression> uriVariableExpressions)Set the Map of URI variable expressions to evaluate against the outbound message when replacing the variable placeholders in a URI template.- Parameters:
uriVariableExpressions- The URI variable expressions.- Returns:
- the current Spec.
- See Also:
AbstractHttpRequestExecutingMessageHandler.setUriVariableExpressions(Map)
-
uriVariable
public S uriVariable(java.lang.String variable, org.springframework.expression.Expression expression)Specify anExpressionto evaluate a value for the uri template variable.- Parameters:
variable- the uri template variable.expression- the expression to evaluate value for te uri template variable.- Returns:
- the current Spec.
- See Also:
AbstractHttpRequestExecutingMessageHandler.setUriVariableExpressions(Map),ValueExpression,LiteralExpression
-
uriVariable
Specify a value SpEL expression for the uri template variable.- Parameters:
variable- the uri template variable.expression- the expression to evaluate value for te uri template variable.- Returns:
- the current Spec.
- See Also:
AbstractHttpRequestExecutingMessageHandler.setUriVariableExpressions(Map)
-
uriVariable
public <P> S uriVariable(java.lang.String variable, java.util.function.Function<org.springframework.messaging.Message<P>,?> valueFunction)Specify aFunctionto evaluate a value for the uri template variable.- Type Parameters:
P- the payload type.- Parameters:
variable- the uri template variable.valueFunction- theFunctionto evaluate a value for the uri template variable.- Returns:
- the current Spec.
- See Also:
AbstractHttpRequestExecutingMessageHandler.setUriVariableExpressions(Map)
-
uriVariablesExpression
Specify a SpEL expression to evaluate aMapof URI variables at runtime against request message.- Parameters:
uriVariablesExpression- to use.- Returns:
- the current Spec.
- See Also:
AbstractHttpRequestExecutingMessageHandler.setUriVariablesExpression(Expression)
-
uriVariablesExpression
Specify a SpEL expression to evaluate aMapof URI variables at runtime against request message.- Parameters:
uriVariablesExpression- to use.- Returns:
- the current Spec.
- See Also:
AbstractHttpRequestExecutingMessageHandler.setUriVariablesExpression(Expression)
-
uriVariablesFunction
public <P> S uriVariablesFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.util.Map<java.lang.String,?>> uriVariablesFunction)Specify aFunctionto evaluate aMapof URI variables at runtime against request message.- Type Parameters:
P- the payload type.- Parameters:
uriVariablesFunction- theFunctionto use.- Returns:
- the current Spec.
- See Also:
AbstractHttpRequestExecutingMessageHandler.setUriVariablesExpression(Expression)
-
transferCookies
Set totrueif you wishSet-Cookieheader in response to be transferred asCookieheader in subsequent interaction for a message.- Parameters:
transferCookies- the transferCookies to set.- Returns:
- the current Spec.
-
getComponentsToRegister
public java.util.Map<java.lang.Object,java.lang.String> getComponentsToRegister()- Specified by:
getComponentsToRegisterin interfaceorg.springframework.integration.dsl.ComponentsRegistration
-
isClientSet
protected abstract boolean isClientSet()
-