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>
Type Parameters:
S - the target spec extension type.
E - the target endpoint type.
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<E>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.integration.dsl.ComponentsRegistration
Direct Known Subclasses:
BaseHttpInboundEndpointSpec

public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpointSupportSpec<S,E>,E extends BaseHttpInboundEndpoint> extends org.springframework.integration.dsl.MessagingGatewaySpec<S,E> implements org.springframework.integration.dsl.ComponentsRegistration
Since:
5.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A fluent API for the CrossOrigin.
    static final class 
    A fluent API for the RequestMapping.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Map<String,org.springframework.expression.Expression>
     
    protected final org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders>
     
    protected final RequestMapping
     

    Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec

    PARSER, target

    Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    logger

    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
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    extractReplyPayload(boolean extractReplyPayload)
    Specify whether only the reply Message's payload should be passed in the response.
     
    headerExpression(String header, String expression)
    Specify SpEL expression for provided header to populate.
    headerExpression(String header, org.springframework.expression.Expression expression)
    Specify SpEL expression for provided header to populate.
    headerExpressions(Map<String,org.springframework.expression.Expression> expressions)
    Specify a Map of SpEL expressions to evaluate in order to generate the Message headers.
    <P> S
    headerFunction(String header, Function<org.springframework.http.HttpEntity<P>,?> headerFunction)
    Specify a Function for provided header to populate.
    headerMapper(org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> mapper)
    Set the HeaderMapper to use when mapping between HTTP headers and MessageHeaders.
    Provide the pattern array for request headers to map.
    Provide the pattern array for response headers to map.
    payloadExpression(String payloadExpression)
    Specify a SpEL expression to evaluate in order to generate the Message payload.
    payloadExpression(org.springframework.expression.Expression payloadExpression)
    Specify a SpEL expression to evaluate in order to generate the Message payload.
    <P> S
    payloadFunction(Function<org.springframework.http.HttpEntity<P>,?> payloadFunction)
    Specify a Function to evaluate in order to generate the Message payload.
    requestPayloadType(Class<?> requestPayloadType)
    Specify the type of payload to be generated when the inbound HTTP request content is read by the HttpMessageConverters.
    requestPayloadType(org.springframework.core.ResolvableType requestPayloadType)
    Specify the type of payload to be generated when the inbound HTTP request content is read by the HttpMessageConverters.
    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.
    statusCodeExpression(org.springframework.expression.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.
    statusCodeFunction(Function<org.springframework.http.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.
    validator(org.springframework.validation.Validator validator)
    Specify a Validator 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • requestMapping

      protected final RequestMapping requestMapping
    • headerExpressions

      protected final Map<String,org.springframework.expression.Expression> headerExpressions
    • headerMapper

      protected final org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> headerMapper
  • Constructor Details

    • HttpInboundEndpointSupportSpec

      protected HttpInboundEndpointSupportSpec(E gateway, String... path)
  • Method Details

    • requestMapping

      Parameters:
      mapping - the Consumer to configure HttpInboundEndpointSupportSpec.RequestMappingSpec.
      Returns:
      the spec
      See Also:
    • crossOrigin

      public S crossOrigin(Consumer<HttpInboundEndpointSupportSpec.CrossOriginSpec> crossOrigin)
      Parameters:
      crossOrigin - the Consumer to configure HttpInboundEndpointSupportSpec.CrossOriginSpec.
      Returns:
      the spec
      See Also:
    • payloadExpression

      public S payloadExpression(String payloadExpression)
      Specify a SpEL expression to evaluate in order to generate the Message payload.
      Parameters:
      payloadExpression - The payload expression.
      Returns:
      the spec
      See Also:
    • payloadExpression

      public S payloadExpression(org.springframework.expression.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:
    • payloadFunction

      public <P> S payloadFunction(Function<org.springframework.http.HttpEntity<P>,?> payloadFunction)
      Specify a Function to evaluate in order to generate the Message payload.
      Type Parameters:
      P - the expected HTTP request body type.
      Parameters:
      payloadFunction - The payload Function.
      Returns:
      the spec
      See Also:
    • headerExpressions

      public S headerExpressions(Map<String,org.springframework.expression.Expression> expressions)
      Specify a Map of SpEL expressions to evaluate in order to generate the Message headers.
      Parameters:
      expressions - The Map of SpEL expressions for headers.
      Returns:
      the spec
      See Also:
    • headerExpression

      public S headerExpression(String header, String expression)
      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:
    • headerExpression

      public S headerExpression(String header, org.springframework.expression.Expression expression)
      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:
    • headerFunction

      public <P> S headerFunction(String header, Function<org.springframework.http.HttpEntity<P>,?> headerFunction)
      Specify a Function 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 against HttpEntity.
      Returns:
      the current Spec.
      See Also:
    • headerMapper

      public S headerMapper(org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> mapper)
      Set the HeaderMapper to use when mapping between HTTP headers and MessageHeaders.
      Parameters:
      mapper - The header mapper.
      Returns:
      the current Spec.
    • mappedRequestHeaders

      public S mappedRequestHeaders(String... patterns)
      Provide the pattern array for request headers to map.
      Parameters:
      patterns - the patterns for request headers to map.
      Returns:
      the current Spec.
      See Also:
    • mappedResponseHeaders

      public S mappedResponseHeaders(String... patterns)
      Provide the pattern array for response headers to map.
      Parameters:
      patterns - the patterns for response headers to map.
      Returns:
      the current Spec.
      See Also:
    • requestPayloadType

      public S requestPayloadType(Class<?> requestPayloadType)
      Specify the type of payload to be generated when the inbound HTTP request content is read by the HttpMessageConverters. 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.
      Parameters:
      requestPayloadType - The payload type.
      Returns:
      the current Spec.
    • requestPayloadType

      public S requestPayloadType(org.springframework.core.ResolvableType requestPayloadType)
      Specify the type of payload to be generated when the inbound HTTP request content is read by the HttpMessageConverters. 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.
      Parameters:
      requestPayloadType - The payload type.
      Returns:
      the current Spec.
    • extractReplyPayload

      public S extractReplyPayload(boolean extractReplyPayload)
      Specify whether only the reply Message's payload should be passed in the response. If this is set to false, the entire Message will be used to generate the response. The default is true.
      Parameters:
      extractReplyPayload - true to extract the reply payload.
      Returns:
      the current Spec.
    • statusCodeExpression

      public 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.
      Parameters:
      statusCodeExpression - The status code Expression.
      Returns:
      the current Spec.
      See Also:
    • statusCodeExpression

      public S statusCodeExpression(org.springframework.expression.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.
      Parameters:
      statusCodeExpression - The status code Expression.
      Returns:
      the current Spec.
      See Also:
    • statusCodeFunction

      public S statusCodeFunction(Function<org.springframework.http.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.
      Parameters:
      statusCodeFunction - The status code Function.
      Returns:
      the current Spec.
      See Also:
    • validator

      public S validator(org.springframework.validation.Validator validator)
      Specify a Validator to validate a converted payload from request.
      Parameters:
      validator - the Validator to use.
      Returns:
      the spec
      Since:
      5.2
    • getComponentsToRegister

      public Map<Object,String> getComponentsToRegister()
      Specified by:
      getComponentsToRegister in interface org.springframework.integration.dsl.ComponentsRegistration