Class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpointSupportSpec<S,E>,E extends BaseHttpInboundEndpoint>
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,G>
org.springframework.integration.dsl.MessagingGatewaySpec<S,E>
org.springframework.integration.http.dsl.HttpInboundEndpointSupportSpec<S,E>
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<E>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
- Direct Known Subclasses:
BaseHttpInboundEndpointSpec
,WebFluxInboundEndpointSpec
public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpointSupportSpec<S,E>,E extends BaseHttpInboundEndpoint> extends MessagingGatewaySpec<S,E> implements ComponentsRegistration
- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpInboundEndpointSupportSpec.CrossOriginSpec
A fluent API for theCrossOrigin
.static class
HttpInboundEndpointSupportSpec.RequestMappingSpec
A fluent API for theRequestMapping
. -
Field Summary
Fields Modifier and Type Field Description protected Map<String,Expression>
headerExpressions
protected HeaderMapper<HttpHeaders>
headerMapper
protected RequestMapping
requestMapping
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
PARSER, target
-
Constructor Summary
Constructors Modifier Constructor Description protected
HttpInboundEndpointSupportSpec(E gateway, String... path)
-
Method Summary
Modifier and Type Method Description S
crossOrigin(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, String expression)
Specify SpEL expression for provided header to populate.S
headerExpression(String header, Expression 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, Function<HttpEntity<P>,?> headerFunction)
Specify aFunction
for provided header to populate.S
headerMapper(HeaderMapper<HttpHeaders> mapper)
Set theHeaderMapper
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(String payloadExpression)
Specify a SpEL expression to evaluate in order to generate the Message payload.S
payloadExpression(Expression payloadExpression)
Specify a SpEL expression to evaluate in order to generate the Message payload.<P> S
payloadFunction(Function<HttpEntity<P>,?> payloadFunction)
Specify aFunction
to evaluate in order to generate the Message payload.S
requestMapping(Consumer<HttpInboundEndpointSupportSpec.RequestMappingSpec> mapping)
Provide aConsumer
for configuringRequestMapping
viaHttpInboundEndpointSupportSpec.RequestMappingSpec
S
requestPayloadType(Class<?> requestPayloadType)
Specify the type of payload to be generated when the inbound HTTP request content is read by theHttpMessageConverter
s.S
requestPayloadType(ResolvableType requestPayloadType)
Specify the type of payload to be generated when the inbound HTTP request content is read by theHttpMessageConverter
s.S
statusCodeExpression(String statusCodeExpression)
Specify theExpression
to resolve a status code for Response to override the default '200 OK' or '500 Internal Server Error' for a timeout.S
statusCodeExpression(Expression statusCodeExpression)
Specify theExpression
to resolve a status code for Response to override the default '200 OK' or '500 Internal Server Error' for a timeout.S
statusCodeFunction(Function<RequestEntity<?>,?> statusCodeFunction)
Specify theFunction
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 aValidator
to validate a converted payload from request.Methods inherited from class org.springframework.integration.dsl.MessagingGatewaySpec
autoStartup, errorChannel, errorChannel, errorOnTimeout, id, phase, replyChannel, replyChannel, replyMapper, replyTimeout, requestChannel, requestChannel, requestMapper, requestTimeout, shouldTrack
Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Field Details
-
Constructor Details
-
Method Details
-
requestMapping
Provide aConsumer
for configuringRequestMapping
viaHttpInboundEndpointSupportSpec.RequestMappingSpec
- Parameters:
mapping
- theConsumer
to configureHttpInboundEndpointSupportSpec.RequestMappingSpec
.- Returns:
- the spec
- See Also:
RequestMapping
-
crossOrigin
- Parameters:
crossOrigin
- theConsumer
to configureHttpInboundEndpointSupportSpec.CrossOriginSpec
.- Returns:
- the spec
- See Also:
CrossOrigin
-
payloadExpression
Specify a SpEL expression to evaluate in order to generate the Message payload.- Parameters:
payloadExpression
- The payload expression.- Returns:
- the spec
- See Also:
BaseHttpInboundEndpoint.setPayloadExpression(Expression)
-
payloadExpression
Specify a SpEL expression to evaluate in order to generate the Message payload.- Parameters:
payloadExpression
- The payload expression.- Returns:
- the spec
- See Also:
BaseHttpInboundEndpoint.setPayloadExpression(Expression)
-
payloadFunction
Specify aFunction
to evaluate in order to generate the Message payload.- Type Parameters:
P
- the expected HTTP request body type.- Parameters:
payloadFunction
- The payloadFunction
.- Returns:
- the spec
- See Also:
BaseHttpInboundEndpoint.setPayloadExpression(Expression)
-
headerExpressions
Specify a Map of SpEL expressions to evaluate in order to generate the Message headers.- Parameters:
expressions
- TheMap
of SpEL expressions for headers.- Returns:
- the spec
- See Also:
BaseHttpInboundEndpoint.setHeaderExpressions(Map)
-
headerExpression
Specify SpEL expression for provided header to populate.- Parameters:
header
- the header name to populate.expression
- the SpEL expression for the header.- Returns:
- the spec
- See Also:
BaseHttpInboundEndpoint.setHeaderExpressions(Map)
-
headerExpression
Specify SpEL expression for provided header to populate.- Parameters:
header
- the header name to populate.expression
- the SpEL expression for the header.- Returns:
- the spec
- See Also:
BaseHttpInboundEndpoint.setHeaderExpressions(Map)
-
headerFunction
Specify aFunction
for provided header to populate.- Type Parameters:
P
- the expected HTTP body type.- Parameters:
header
- the header name to add.headerFunction
- the function to evaluate the header value againstHttpEntity
.- Returns:
- the current Spec.
- See Also:
BaseHttpInboundEndpoint.setHeaderExpressions(Map)
-
headerMapper
Set theHeaderMapper
to use when mapping between HTTP headers and MessageHeaders.- Parameters:
mapper
- The header mapper.- Returns:
- the current Spec.
-
mappedRequestHeaders
Provide the pattern array for request headers to map.- Parameters:
patterns
- the patterns for request headers to map.- Returns:
- the current 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[])
-
requestPayloadType
Specify the type of payload to be generated when the inbound HTTP request content is read by theHttpMessageConverter
s. By default this value is null which means at runtime any "text" Content-Type will result in String while all others default tobyte[].class
.- Parameters:
requestPayloadType
- The payload type.- Returns:
- the current Spec.
-
requestPayloadType
Specify the type of payload to be generated when the inbound HTTP request content is read by theHttpMessageConverter
s. By default this value is null which means at runtime any "text" Content-Type will result in String while all others default tobyte[].class
.- Parameters:
requestPayloadType
- The payload type.- Returns:
- the current Spec.
-
extractReplyPayload
Specify whether only the reply Message's payload should be passed in the response. If this is set tofalse
, the entire Message will be used to generate the response. The default istrue
.- Parameters:
extractReplyPayload
- true to extract the reply payload.- Returns:
- the current Spec.
-
statusCodeExpression
Specify theExpression
to resolve a status code for Response to override the default '200 OK' or '500 Internal Server Error' for a timeout.- Parameters:
statusCodeExpression
- The status code Expression.- Returns:
- the current Spec.
- See Also:
BaseHttpInboundEndpoint.setStatusCodeExpression(Expression)
-
statusCodeExpression
Specify theExpression
to resolve a status code for Response to override the default '200 OK' or '500 Internal Server Error' for a timeout.- Parameters:
statusCodeExpression
- The status code Expression.- Returns:
- the current Spec.
- See Also:
BaseHttpInboundEndpoint.setStatusCodeExpression(Expression)
-
statusCodeFunction
Specify theFunction
to resolve a status code for Response to override the default '200 OK' or '500 Internal Server Error' for a timeout.- Parameters:
statusCodeFunction
- The status codeFunction
.- Returns:
- the current Spec.
- See Also:
BaseHttpInboundEndpoint.setStatusCodeExpression(Expression)
-
validator
Specify aValidator
to validate a converted payload from request.- Parameters:
validator
- theValidator
to use.- Returns:
- the spec
- Since:
- 5.2
-
getComponentsToRegister
- Specified by:
getComponentsToRegister
in interfaceComponentsRegistration
-