Class BaseHttpMessageHandlerSpec<S extends BaseHttpMessageHandlerSpec<S,E>,E extends AbstractHttpRequestExecutingMessageHandler>
java.lang.Object
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 targetBaseHttpMessageHandlerSpec
implementation type.E
- the targetAbstractHttpRequestExecutingMessageHandler
implementation type.
- All Implemented Interfaces:
DisposableBean
,FactoryBean<E>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
- Direct Known Subclasses:
HttpMessageHandlerSpec
,WebFluxMessageHandlerSpec
public abstract class BaseHttpMessageHandlerSpec<S extends BaseHttpMessageHandlerSpec<S,E>,E extends AbstractHttpRequestExecutingMessageHandler>
extends MessageHandlerSpec<S,E>
implements ComponentsRegistration
The base
MessageHandlerSpec
for AbstractHttpRequestExecutingMessageHandler
s.- Since:
- 5.0
- Author:
- Artem Bilan, Shiliang Li
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, target
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSpecify the charset name to use for converting String-typed payloads to bytes.encodingMode
(DefaultUriBuilderFactory.EncodingMode encodingMode) Specify aDefaultUriBuilderFactory.EncodingMode
for uri construction.expectedResponseType
(Class<?> expectedResponseType) Specify the expected response type for the REST request.expectedResponseType
(ParameterizedTypeReference<?> expectedResponseType) Specify aParameterizedTypeReference
for the expected response type for the REST request.expectedResponseTypeExpression
(Expression expectedResponseTypeExpression) Specify a SpELExpression
to determine the type for the expected response The returned value of the expression could be an instance ofClass
orString
representing a fully qualified class name.<P> S
expectedResponseTypeFunction
(Function<Message<P>, ?> expectedResponseTypeFunction) protected S
expectReply
(boolean expectReply) extractPayload
(boolean extractPayload) Specify whether the outbound message's payload should be extracted when preparing the request body.extractResponseBody
(boolean extractResponseBody) The flag to extract a body of theResponseEntity
for reply message payload.headerMapper
(HeaderMapper<HttpHeaders> headerMapper) Set theHeaderMapper
to use when mapping between HTTP headers andMessageHeaders
.httpMethod
(HttpMethod httpMethod) Specify theHttpMethod
for requests.httpMethodExpression
(Expression httpMethodExpression) Specify the SpELExpression
to determineHttpMethod
at runtime.<P> S
httpMethodFunction
(Function<Message<P>, ?> httpMethodFunction) Specify aFunction
to determineHttpMethod
at runtime.protected abstract boolean
mappedRequestHeaders
(String... patterns) Provide the pattern array for request headers to map.mappedResponseHeaders
(String... patterns) Provide the pattern array for response headers to map.transferCookies
(boolean transferCookies) Set totrue
if you wishSet-Cookie
header in response to be transferred asCookie
header in subsequent interaction for a message.uriVariable
(String variable, String expression) Specify a value SpEL expression for the uri template variable.<P> S
uriVariable
(String variable, Function<Message<P>, ?> valueFunction) Specify aFunction
to evaluate a value for the uri template variable.uriVariable
(String variable, Expression expression) Specify anExpression
to evaluate a value for the uri template variable.uriVariableExpressions
(Map<String, Expression> uriVariableExpressions) Set the Map of URI variable expressions to evaluate against the outbound message when replacing the variable placeholders in a URI template.uriVariablesExpression
(String uriVariablesExpression) Specify a SpEL expression to evaluate aMap
of URI variables at runtime against request message.uriVariablesExpression
(Expression uriVariablesExpression) Specify a SpEL expression to evaluate aMap
of URI variables at runtime against request message.<P> S
uriVariablesFunction
(Function<Message<P>, Map<String, ?>> uriVariablesFunction) Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, afterPropertiesSet, destroy, doGet, get, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
Constructor Details
-
BaseHttpMessageHandlerSpec
-
-
Method Details
-
expectReply
-
encodingMode
Specify aDefaultUriBuilderFactory.EncodingMode
for uri construction.- Parameters:
encodingMode
- to use for uri construction.- Returns:
- the spec
- Since:
- 5.3
-
httpMethodExpression
Specify the SpELExpression
to determineHttpMethod
at runtime.- Parameters:
httpMethodExpression
- The method expression.- Returns:
- the spec
-
httpMethodFunction
Specify aFunction
to determineHttpMethod
at runtime.- Type Parameters:
P
- the payload type.- Parameters:
httpMethodFunction
- The HTTP methodFunction
.- Returns:
- the spec
-
httpMethod
Specify theHttpMethod
for requests. The default method isPOST
.- Parameters:
httpMethod
- theHttpMethod
to 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
Specify aParameterizedTypeReference
for the expected response type for the REST request.- Parameters:
expectedResponseType
- TheParameterizedTypeReference
for expected type.- Returns:
- the spec
-
expectedResponseTypeExpression
Specify a SpELExpression
to determine the type for the expected response The returned value of the expression could be an instance ofClass
orString
representing a fully qualified class name.- Parameters:
expectedResponseTypeExpression
- The expected response type expression.- Returns:
- the spec
-
expectedResponseTypeFunction
Specify aFunction
to determine the type for the expected response The returned value of the expression could be an instance ofClass
orString
representing a fully qualified class name.- Type Parameters:
P
- the payload type.- Parameters:
expectedResponseTypeFunction
- The expected response typeFunction
.- Returns:
- the spec
-
headerMapper
Set theHeaderMapper
to 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:
-
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:
-
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:
-
uriVariable
Specify anExpression
to 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:
-
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:
-
uriVariable
Specify aFunction
to evaluate a value for the uri template variable.- Type Parameters:
P
- the payload type.- Parameters:
variable
- the uri template variable.valueFunction
- theFunction
to evaluate a value for the uri template variable.- Returns:
- the current Spec.
- See Also:
-
uriVariablesExpression
Specify a SpEL expression to evaluate aMap
of URI variables at runtime against request message.- Parameters:
uriVariablesExpression
- to use.- Returns:
- the current Spec.
- See Also:
-
uriVariablesExpression
Specify a SpEL expression to evaluate aMap
of URI variables at runtime against request message.- Parameters:
uriVariablesExpression
- to use.- Returns:
- the current Spec.
- See Also:
-
uriVariablesFunction
- Type Parameters:
P
- the payload type.- Parameters:
uriVariablesFunction
- theFunction
to use.- Returns:
- the current Spec.
- See Also:
-
transferCookies
Set totrue
if you wishSet-Cookie
header in response to be transferred asCookie
header in subsequent interaction for a message. Defaults to false.- Parameters:
transferCookies
- the transferCookies to set.- Returns:
- the current Spec.
-
extractResponseBody
The flag to extract a body of theResponseEntity
for reply message payload. Defaults to true.- Parameters:
extractResponseBody
- produce a reply message with a wholeResponseEntity
or just its body.- Returns:
- the current Spec.
- Since:
- 5.5
-
getComponentsToRegister
- Specified by:
getComponentsToRegister
in interfaceComponentsRegistration
-
isClientSet
protected abstract boolean isClientSet()
-