S - the target BaseHttpMessageHandlerSpec implementation type.E - the target AbstractHttpRequestExecutingMessageHandler implementation type.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
MessageHandlerSpec for AbstractHttpRequestExecutingMessageHandlers.| Constructor and Description |
|---|
BaseHttpMessageHandlerSpec(E handler) |
| Modifier and Type | Method and Description |
|---|---|
S |
charset(java.lang.String charset)
Specify the charset name to use for converting String-typed payloads to bytes.
|
S |
encodeUri(boolean encodeUri)
Specify whether the real URI should be encoded after
uriVariables
expanding and before send request via underlying implementation. |
S |
expectedResponseType(java.lang.Class<?> expectedResponseType)
Specify the expected response type for the REST request.
|
S |
expectedResponseType(org.springframework.core.ParameterizedTypeReference<?> expectedResponseType)
Specify a
ParameterizedTypeReference for the expected response type for the REST request. |
S |
expectedResponseTypeExpression(org.springframework.expression.Expression expectedResponseTypeExpression)
Specify a SpEL
Expression to determine the type for the expected response
The returned value of the expression could be an instance of Class or
String representing a fully qualified class name. |
<P> S |
expectedResponseTypeFunction(java.util.function.Function<org.springframework.messaging.Message<P>,?> expectedResponseTypeFunction)
Specify a
Function to determine the type for the expected response
The returned value of the expression could be an instance of Class or
String representing a fully qualified class name. |
protected S |
expectReply(boolean expectReply) |
S |
extractPayload(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() |
S |
headerMapper(org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> headerMapper)
Set the
HeaderMapper to use when mapping between HTTP headers and MessageHeaders. |
S |
httpMethod(org.springframework.http.HttpMethod httpMethod)
Specify the
HttpMethod for requests. |
S |
httpMethodExpression(org.springframework.expression.Expression httpMethodExpression)
Specify the SpEL
Expression to determine HttpMethod at runtime. |
<P> S |
httpMethodFunction(java.util.function.Function<org.springframework.messaging.Message<P>,?> httpMethodFunction)
Specify a
Function to determine HttpMethod at runtime. |
protected abstract boolean |
isClientSet() |
S |
mappedRequestHeaders(java.lang.String... patterns)
Provide the pattern array for request headers to map.
|
S |
mappedResponseHeaders(java.lang.String... patterns)
Provide the pattern array for response headers to map.
|
S |
transferCookies(boolean transferCookies)
Set to
true if you wish Set-Cookie header in response to be
transferred as Cookie header in subsequent interaction for a message. |
S |
uriVariable(java.lang.String variable,
org.springframework.expression.Expression expression)
Specify an
Expression to evaluate a value for the uri template variable. |
<P> S |
uriVariable(java.lang.String variable,
java.util.function.Function<org.springframework.messaging.Message<P>,?> valueFunction)
Specify a
Function to evaluate a value for the uri template variable. |
S |
uriVariable(java.lang.String variable,
java.lang.String expression)
Specify a value SpEL expression for the uri template variable.
|
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.
|
S |
uriVariablesExpression(org.springframework.expression.Expression uriVariablesExpression)
Specify a SpEL expression to evaluate a
Map of URI variables at runtime against request message. |
S |
uriVariablesExpression(java.lang.String uriVariablesExpression)
Specify a SpEL expression to evaluate a
Map of URI variables at runtime against request message. |
<P> S |
uriVariablesFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.util.Map<java.lang.String,?>> uriVariablesFunction)
Specify a
Function to evaluate a Map of URI variables at runtime against request message. |
public BaseHttpMessageHandlerSpec(E handler)
protected S expectReply(boolean expectReply)
public S encodeUri(boolean encodeUri)
uriVariables
expanding and before send request via underlying implementation. The default value is true.encodeUri - true if the URI should be encoded.public S httpMethodExpression(org.springframework.expression.Expression httpMethodExpression)
Expression to determine HttpMethod at runtime.httpMethodExpression - The method expression.public <P> S httpMethodFunction(java.util.function.Function<org.springframework.messaging.Message<P>,?> httpMethodFunction)
Function to determine HttpMethod at runtime.P - the payload type.httpMethodFunction - The HTTP method Function.public S httpMethod(org.springframework.http.HttpMethod httpMethod)
HttpMethod for requests.
The default method is POST.httpMethod - the HttpMethod to use.public S extractPayload(boolean extractPayload)
true.extractPayload - true if the payload should be extracted.public S charset(java.lang.String charset)
UTF-8.charset - The charset.public S expectedResponseType(java.lang.Class<?> expectedResponseType)
expectedResponseType - The expected type.public S expectedResponseType(org.springframework.core.ParameterizedTypeReference<?> expectedResponseType)
ParameterizedTypeReference for the expected response type for the REST request.expectedResponseType - The ParameterizedTypeReference for expected type.public S expectedResponseTypeExpression(org.springframework.expression.Expression expectedResponseTypeExpression)
Expression to determine the type for the expected response
The returned value of the expression could be an instance of Class or
String representing a fully qualified class name.expectedResponseTypeExpression - The expected response type expression.public <P> S expectedResponseTypeFunction(java.util.function.Function<org.springframework.messaging.Message<P>,?> expectedResponseTypeFunction)
Function to determine the type for the expected response
The returned value of the expression could be an instance of Class or
String representing a fully qualified class name.P - the payload type.expectedResponseTypeFunction - The expected response type Function.public S headerMapper(org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> headerMapper)
HeaderMapper to use when mapping between HTTP headers and MessageHeaders.headerMapper - The header mapper.public S mappedRequestHeaders(java.lang.String... patterns)
patterns - the patterns for request headers to map.DefaultHttpHeaderMapper.setOutboundHeaderNames(String[])public S mappedResponseHeaders(java.lang.String... patterns)
patterns - the patterns for response headers to map.DefaultHttpHeaderMapper.setInboundHeaderNames(String[])public S uriVariableExpressions(java.util.Map<java.lang.String,org.springframework.expression.Expression> uriVariableExpressions)
uriVariableExpressions - The URI variable expressions.AbstractHttpRequestExecutingMessageHandler.setUriVariableExpressions(Map)public S uriVariable(java.lang.String variable, org.springframework.expression.Expression expression)
Expression to evaluate a value for the uri template variable.variable - the uri template variable.expression - the expression to evaluate value for te uri template variable.AbstractHttpRequestExecutingMessageHandler.setUriVariableExpressions(Map),
ValueExpression,
LiteralExpressionpublic S uriVariable(java.lang.String variable, java.lang.String expression)
variable - the uri template variable.expression - the expression to evaluate value for te uri template variable.AbstractHttpRequestExecutingMessageHandler.setUriVariableExpressions(Map)public <P> S uriVariable(java.lang.String variable, java.util.function.Function<org.springframework.messaging.Message<P>,?> valueFunction)
Function to evaluate a value for the uri template variable.P - the payload type.variable - the uri template variable.valueFunction - the Function to evaluate a value for the uri template variable.AbstractHttpRequestExecutingMessageHandler.setUriVariableExpressions(Map)public S uriVariablesExpression(java.lang.String uriVariablesExpression)
Map of URI variables at runtime against request message.uriVariablesExpression - to use.AbstractHttpRequestExecutingMessageHandler.setUriVariablesExpression(Expression)public S uriVariablesExpression(org.springframework.expression.Expression uriVariablesExpression)
Map of URI variables at runtime against request message.uriVariablesExpression - to use.AbstractHttpRequestExecutingMessageHandler.setUriVariablesExpression(Expression)public <P> S uriVariablesFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.util.Map<java.lang.String,?>> uriVariablesFunction)
Function to evaluate a Map of URI variables at runtime against request message.P - the payload type.uriVariablesFunction - the Function to use.AbstractHttpRequestExecutingMessageHandler.setUriVariablesExpression(Expression)public S transferCookies(boolean transferCookies)
true if you wish Set-Cookie header in response to be
transferred as Cookie header in subsequent interaction for a message.transferCookies - the transferCookies to set.public java.util.Map<java.lang.Object,java.lang.String> getComponentsToRegister()
getComponentsToRegister in interface org.springframework.integration.dsl.ComponentsRegistrationprotected abstract boolean isClientSet()