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:
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 class  HttpInboundEndpointSupportSpec.CrossOriginSpec
    A fluent API for the CrossOrigin.
    static class  HttpInboundEndpointSupportSpec.RequestMappingSpec
    A fluent API for the RequestMapping.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.Map<java.lang.String,​org.springframework.expression.Expression> headerExpressions  
    protected org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> headerMapper  
    protected RequestMapping 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 HttpInboundEndpointSupportSpec​(E gateway, java.lang.String... path)  
  • Method Summary

    Modifier and Type Method Description
    S crossOrigin​(java.util.function.Consumer<HttpInboundEndpointSupportSpec.CrossOriginSpec> crossOrigin)
    Provide a Consumer for configuring CrossOrigin via HttpInboundEndpointSupportSpec.CrossOriginSpec
    S extractReplyPayload​(boolean extractReplyPayload)
    Specify whether only the reply Message's payload should be passed in the response.
    java.util.Map<java.lang.Object,​java.lang.String> getComponentsToRegister()  
    S headerExpression​(java.lang.String header, java.lang.String expression)
    Specify SpEL expression for provided header to populate.
    S headerExpression​(java.lang.String header, org.springframework.expression.Expression expression)
    Specify SpEL expression for provided header to populate.
    S headerExpressions​(java.util.Map<java.lang.String,​org.springframework.expression.Expression> expressions)
    Specify a Map of SpEL expressions to evaluate in order to generate the Message headers.
    <P> S headerFunction​(java.lang.String header, java.util.function.Function<org.springframework.http.HttpEntity<P>,​?> headerFunction)
    Specify a Function for provided header to populate.
    S headerMapper​(org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> mapper)
    Set the HeaderMapper to use when mapping between HTTP headers and MessageHeaders.
    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 payloadExpression​(java.lang.String payloadExpression)
    Specify a SpEL expression to evaluate in order to generate the Message payload.
    S payloadExpression​(org.springframework.expression.Expression payloadExpression)
    Specify a SpEL expression to evaluate in order to generate the Message payload.
    <P> S payloadFunction​(java.util.function.Function<org.springframework.http.HttpEntity<P>,​?> payloadFunction)
    Specify a Function to evaluate in order to generate the Message payload.
    S requestMapping​(java.util.function.Consumer<HttpInboundEndpointSupportSpec.RequestMappingSpec> mapping)
    S requestPayloadType​(java.lang.Class<?> requestPayloadType)
    Specify the type of payload to be generated when the inbound HTTP request content is read by the HttpMessageConverters.
    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.
    S statusCodeExpression​(java.lang.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 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.
    S statusCodeFunction​(java.util.function.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.
    S 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 java.util.Map<java.lang.String,​org.springframework.expression.Expression> headerExpressions
    • headerMapper

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

  • Method Details

    • requestMapping

      public S requestMapping​(java.util.function.Consumer<HttpInboundEndpointSupportSpec.RequestMappingSpec> mapping)
      Parameters:
      mapping - the Consumer to configure HttpInboundEndpointSupportSpec.RequestMappingSpec.
      Returns:
      the spec
      See Also:
      RequestMapping
    • crossOrigin

      public S crossOrigin​(java.util.function.Consumer<HttpInboundEndpointSupportSpec.CrossOriginSpec> crossOrigin)
      Provide a Consumer for configuring CrossOrigin via HttpInboundEndpointSupportSpec.CrossOriginSpec
      Parameters:
      crossOrigin - the Consumer to configure HttpInboundEndpointSupportSpec.CrossOriginSpec.
      Returns:
      the spec
      See Also:
      CrossOrigin
    • payloadExpression

      public S payloadExpression​(java.lang.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:
      BaseHttpInboundEndpoint.setPayloadExpression(Expression)
    • 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:
      BaseHttpInboundEndpoint.setPayloadExpression(Expression)
    • payloadFunction

      public <P> S payloadFunction​(java.util.function.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:
      BaseHttpInboundEndpoint.setPayloadExpression(Expression)
    • headerExpressions

      public S headerExpressions​(java.util.Map<java.lang.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:
      BaseHttpInboundEndpoint.setHeaderExpressions(Map)
    • headerExpression

      public S headerExpression​(java.lang.String header, java.lang.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:
      BaseHttpInboundEndpoint.setHeaderExpressions(Map)
    • headerExpression

      public S headerExpression​(java.lang.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:
      BaseHttpInboundEndpoint.setHeaderExpressions(Map)
    • headerFunction

      public <P> S headerFunction​(java.lang.String header, java.util.function.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:
      BaseHttpInboundEndpoint.setHeaderExpressions(Map)
    • 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​(java.lang.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:
      DefaultHttpHeaderMapper.setOutboundHeaderNames(String[])
    • mappedResponseHeaders

      public S mappedResponseHeaders​(java.lang.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:
      DefaultHttpHeaderMapper.setInboundHeaderNames(String[])
    • requestPayloadType

      public S requestPayloadType​(java.lang.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​(java.lang.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:
      BaseHttpInboundEndpoint.setStatusCodeExpression(Expression)
    • 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:
      BaseHttpInboundEndpoint.setStatusCodeExpression(Expression)
    • statusCodeFunction

      public S statusCodeFunction​(java.util.function.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:
      BaseHttpInboundEndpoint.setStatusCodeExpression(Expression)
    • 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 java.util.Map<java.lang.Object,​java.lang.String> getComponentsToRegister()
      Specified by:
      getComponentsToRegister in interface org.springframework.integration.dsl.ComponentsRegistration