public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpointSupportSpec<S,E>,E extends BaseHttpInboundEndpoint> extends MessagingGatewaySpec<S,E> implements ComponentsRegistration
Modifier and Type | Class and Description |
---|---|
static class |
HttpInboundEndpointSupportSpec.CrossOriginSpec
A fluent API for the
CrossOrigin . |
static class |
HttpInboundEndpointSupportSpec.RequestMappingSpec
A fluent API for the
RequestMapping . |
Modifier and Type | Field and Description |
---|---|
protected Map<String,Expression> |
headerExpressions |
protected HeaderMapper<HttpHeaders> |
headerMapper |
protected RequestMapping |
requestMapping |
PARSER, target
logger
DEFAULT_PHASE
OBJECT_TYPE_ATTRIBUTE
Modifier | Constructor and Description |
---|---|
protected |
HttpInboundEndpointSupportSpec(E gateway,
String... path) |
Modifier and Type | Method and Description |
---|---|
S |
crossOrigin(java.util.function.Consumer<HttpInboundEndpointSupportSpec.CrossOriginSpec> crossOrigin)
|
S |
extractReplyPayload(boolean extractReplyPayload)
Specify whether only the reply Message's payload should be passed in the response.
|
Map<Object,String> |
getComponentsToRegister() |
S |
headerExpression(String header,
Expression expression)
Specify SpEL expression for provided header to populate.
|
S |
headerExpression(String header,
String expression)
Specify SpEL expression for provided header to populate.
|
S |
headerExpressions(Map<String,Expression> expressions)
Specify a Map of SpEL expressions to evaluate in order to generate the Message headers.
|
<P> S |
headerFunction(String header,
java.util.function.Function<HttpEntity<P>,?> headerFunction)
Specify a
Function for provided header to populate. |
S |
headerMapper(HeaderMapper<HttpHeaders> mapper)
Set the
HeaderMapper to use when mapping between HTTP headers and MessageHeaders. |
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 |
payloadExpression(Expression payloadExpression)
Specify a SpEL expression to evaluate in order to generate the Message payload.
|
S |
payloadExpression(String payloadExpression)
Specify a SpEL expression to evaluate in order to generate the Message payload.
|
<P> S |
payloadFunction(java.util.function.Function<HttpEntity<P>,?> payloadFunction)
Specify a
Function to evaluate in order to generate the Message payload. |
S |
requestMapping(java.util.function.Consumer<HttpInboundEndpointSupportSpec.RequestMappingSpec> mapping)
Provide a
Consumer for configuring RequestMapping via HttpInboundEndpointSupportSpec.RequestMappingSpec |
S |
requestPayloadType(Class<?> requestPayloadType)
Specify the type of payload to be generated when the inbound HTTP request content is read by the
HttpMessageConverter s. |
S |
requestPayloadType(ResolvableType requestPayloadType)
Specify the type of payload to be generated when the inbound HTTP request content is read by the
HttpMessageConverter s. |
S |
statusCodeExpression(Expression statusCodeExpression)
Specify the
Expression to resolve a status code for Response to override
the default '200 OK' or '500 Internal Server Error' for a timeout. |
S |
statusCodeExpression(String statusCodeExpression)
Specify the
Expression to resolve a status code for Response to override
the default '200 OK' or '500 Internal Server Error' for a timeout. |
S |
statusCodeFunction(java.util.function.Function<RequestEntity<?>,?> statusCodeFunction)
Specify the
Function to resolve a status code for Response to override
the default '200 OK' or '500 Internal Server Error' for a timeout. |
S |
validator(Validator validator)
Specify a
Validator to validate a converted payload from request. |
autoStartup, errorChannel, errorChannel, errorOnTimeout, id, phase, replyChannel, replyChannel, replyMapper, replyTimeout, requestChannel, requestChannel, requestMapper, requestTimeout, shouldTrack
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
protected final RequestMapping requestMapping
protected final Map<String,Expression> headerExpressions
protected final HeaderMapper<HttpHeaders> headerMapper
public S requestMapping(java.util.function.Consumer<HttpInboundEndpointSupportSpec.RequestMappingSpec> mapping)
Consumer
for configuring RequestMapping
via HttpInboundEndpointSupportSpec.RequestMappingSpec
mapping
- the Consumer
to configure HttpInboundEndpointSupportSpec.RequestMappingSpec
.RequestMapping
public S crossOrigin(java.util.function.Consumer<HttpInboundEndpointSupportSpec.CrossOriginSpec> crossOrigin)
crossOrigin
- the Consumer
to configure HttpInboundEndpointSupportSpec.CrossOriginSpec
.CrossOrigin
public S payloadExpression(String payloadExpression)
payloadExpression
- The payload expression.BaseHttpInboundEndpoint.setPayloadExpression(Expression)
public S payloadExpression(Expression payloadExpression)
payloadExpression
- The payload expression.BaseHttpInboundEndpoint.setPayloadExpression(Expression)
public <P> S payloadFunction(java.util.function.Function<HttpEntity<P>,?> payloadFunction)
Function
to evaluate in order to generate the Message payload.P
- the expected HTTP request body type.payloadFunction
- The payload Function
.BaseHttpInboundEndpoint.setPayloadExpression(Expression)
public S headerExpressions(Map<String,Expression> expressions)
expressions
- The Map
of SpEL expressions for headers.BaseHttpInboundEndpoint.setHeaderExpressions(Map)
public S headerExpression(String header, String expression)
header
- the header name to populate.expression
- the SpEL expression for the header.BaseHttpInboundEndpoint.setHeaderExpressions(Map)
public S headerExpression(String header, Expression expression)
header
- the header name to populate.expression
- the SpEL expression for the header.BaseHttpInboundEndpoint.setHeaderExpressions(Map)
public <P> S headerFunction(String header, java.util.function.Function<HttpEntity<P>,?> headerFunction)
Function
for provided header to populate.P
- the expected HTTP body type.header
- the header name to add.headerFunction
- the function to evaluate the header value against HttpEntity
.BaseHttpInboundEndpoint.setHeaderExpressions(Map)
public S headerMapper(HeaderMapper<HttpHeaders> mapper)
HeaderMapper
to use when mapping between HTTP headers and MessageHeaders.mapper
- 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 requestPayloadType(Class<?> requestPayloadType)
HttpMessageConverter
s.
By default this value is null which means at runtime any "text" Content-Type will
result in String while all others default to byte[].class
.requestPayloadType
- The payload type.public S requestPayloadType(ResolvableType requestPayloadType)
HttpMessageConverter
s.
By default this value is null which means at runtime any "text" Content-Type will
result in String while all others default to byte[].class
.requestPayloadType
- The payload type.public S extractReplyPayload(boolean extractReplyPayload)
false
, the entire Message will be used to generate the response.
The default is true
.extractReplyPayload
- true to extract the reply payload.public S statusCodeExpression(String statusCodeExpression)
Expression
to resolve a status code for Response to override
the default '200 OK' or '500 Internal Server Error' for a timeout.statusCodeExpression
- The status code Expression.BaseHttpInboundEndpoint.setStatusCodeExpression(Expression)
public S statusCodeExpression(Expression statusCodeExpression)
Expression
to resolve a status code for Response to override
the default '200 OK' or '500 Internal Server Error' for a timeout.statusCodeExpression
- The status code Expression.BaseHttpInboundEndpoint.setStatusCodeExpression(Expression)
public S statusCodeFunction(java.util.function.Function<RequestEntity<?>,?> statusCodeFunction)
Function
to resolve a status code for Response to override
the default '200 OK' or '500 Internal Server Error' for a timeout.statusCodeFunction
- The status code Function
.BaseHttpInboundEndpoint.setStatusCodeExpression(Expression)
public S validator(Validator validator)
Validator
to validate a converted payload from request.validator
- the Validator
to use.public Map<Object,String> getComponentsToRegister()
getComponentsToRegister
in interface ComponentsRegistration