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 MessageHandlerSpec<S,E> implements ComponentsRegistration
MessageHandlerSpec for AbstractHttpRequestExecutingMessageHandlers.PARSER, targetloggerDEFAULT_PHASEOBJECT_TYPE_ATTRIBUTE| Constructor and Description |
|---|
BaseHttpMessageHandlerSpec(E handler) |
| Modifier and Type | Method and Description |
|---|---|
S |
charset(String charset)
Specify the charset name to use for converting String-typed payloads to bytes.
|
S |
encodeUri(boolean encodeUri)
Deprecated.
since 5.3 in favor of
encodingMode(org.springframework.web.util.DefaultUriBuilderFactory.EncodingMode) |
S |
encodingMode(DefaultUriBuilderFactory.EncodingMode encodingMode)
Specify a
DefaultUriBuilderFactory.EncodingMode for uri construction. |
S |
expectedResponseType(Class<?> expectedResponseType)
Specify the expected response type for the REST request.
|
S |
expectedResponseType(ParameterizedTypeReference<?> expectedResponseType)
Specify a
ParameterizedTypeReference for the expected response type for the REST request. |
S |
expectedResponseTypeExpression(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<Message<P>,?> expectedResponseTypeFunction)
|
protected S |
expectReply(boolean expectReply) |
S |
extractPayload(boolean extractPayload)
Specify whether the outbound message's payload should be extracted
when preparing the request body.
|
Map<Object,String> |
getComponentsToRegister() |
S |
headerMapper(HeaderMapper<HttpHeaders> headerMapper)
Set the
HeaderMapper to use when mapping between HTTP headers and MessageHeaders. |
S |
httpMethod(HttpMethod httpMethod)
Specify the
HttpMethod for requests. |
S |
httpMethodExpression(Expression httpMethodExpression)
Specify the SpEL
Expression to determine HttpMethod at runtime. |
<P> S |
httpMethodFunction(java.util.function.Function<Message<P>,?> httpMethodFunction)
Specify a
Function to determine HttpMethod at runtime. |
protected abstract boolean |
isClientSet() |
S |
mappedRequestHeaders(String... patterns)
Provide the pattern array for request headers to map.
|
S |
mappedResponseHeaders(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(String variable,
Expression expression)
Specify an
Expression to evaluate a value for the uri template variable. |
<P> S |
uriVariable(String variable,
java.util.function.Function<Message<P>,?> valueFunction)
Specify a
Function to evaluate a value for the uri template variable. |
S |
uriVariable(String variable,
String expression)
Specify a value SpEL expression for the uri template variable.
|
S |
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.
|
S |
uriVariablesExpression(Expression uriVariablesExpression)
Specify a SpEL expression to evaluate a
Map of URI variables at runtime against request message. |
S |
uriVariablesExpression(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<Message<P>,Map<String,?>> uriVariablesFunction)
|
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stopafterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingletonpublic BaseHttpMessageHandlerSpec(E handler)
protected S expectReply(boolean expectReply)
@Deprecated public S encodeUri(boolean encodeUri)
encodingMode(org.springframework.web.util.DefaultUriBuilderFactory.EncodingMode)uriVariables
expanding and before send request via underlying implementation. The default value is true.encodeUri - true if the URI should be encoded.public S encodingMode(DefaultUriBuilderFactory.EncodingMode encodingMode)
DefaultUriBuilderFactory.EncodingMode for uri construction.encodingMode - to use for uri construction.public S httpMethodExpression(Expression httpMethodExpression)
Expression to determine HttpMethod at runtime.httpMethodExpression - The method expression.public <P> S httpMethodFunction(java.util.function.Function<Message<P>,?> httpMethodFunction)
Function to determine HttpMethod at runtime.P - the payload type.httpMethodFunction - The HTTP method Function.public S httpMethod(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(String charset)
UTF-8.charset - The charset.public S expectedResponseType(Class<?> expectedResponseType)
expectedResponseType - The expected type.public S expectedResponseType(ParameterizedTypeReference<?> expectedResponseType)
ParameterizedTypeReference for the expected response type for the REST request.expectedResponseType - The ParameterizedTypeReference for expected type.public S expectedResponseTypeExpression(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<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(HeaderMapper<HttpHeaders> headerMapper)
HeaderMapper to use when mapping between HTTP headers and MessageHeaders.headerMapper - The header mapper.public S mappedRequestHeaders(String... patterns)
patterns - the patterns for request headers to map.DefaultHttpHeaderMapper.setOutboundHeaderNames(String[])public S mappedResponseHeaders(String... patterns)
patterns - the patterns for response headers to map.DefaultHttpHeaderMapper.setInboundHeaderNames(String[])public S uriVariableExpressions(Map<String,Expression> uriVariableExpressions)
uriVariableExpressions - The URI variable expressions.AbstractHttpRequestExecutingMessageHandler.setUriVariableExpressions(Map)public S uriVariable(String variable, 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(String variable, 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(String variable, java.util.function.Function<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(String uriVariablesExpression)
Map of URI variables at runtime against request message.uriVariablesExpression - to use.AbstractHttpRequestExecutingMessageHandler.setUriVariablesExpression(Expression)public S uriVariablesExpression(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<Message<P>,Map<String,?>> uriVariablesFunction)
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 Map<Object,String> getComponentsToRegister()
getComponentsToRegister in interface ComponentsRegistrationprotected abstract boolean isClientSet()