Interface NettyHttpBinding

All Known Implementing Classes:
DefaultNettyHttpBinding, RestNettyHttpBinding

public interface NettyHttpBinding
To bind Netty http codec with the Camel Message api.
  • Method Details

    • toCamelMessage

      org.apache.camel.Message toCamelMessage(io.netty.handler.codec.http.FullHttpRequest request, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration) throws Exception
      Binds from Netty HttpRequest to Camel Message.

      Will use the populateCamelHeaders method for populating the headers.

      Parameters:
      request - the netty http request
      exchange - the exchange that should contain the returned message.
      configuration - the endpoint configuration
      Returns:
      the message to store on the given exchange
      Throws:
      Exception - is thrown if error during binding
    • toCamelMessage

      org.apache.camel.Message toCamelMessage(InboundStreamHttpRequest request, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration) throws Exception
      Binds from Netty InboundStreamHttpRequest to Camel Message.

      Parameters:
      request - the netty http request
      exchange - the exchange that should contain the returned message.
      configuration - the endpoint configuration
      Returns:
      the message to store on the given exchange
      Throws:
      Exception - is thrown if error during binding
    • populateCamelHeaders

      void populateCamelHeaders(io.netty.handler.codec.http.HttpRequest request, Map<String,Object> headers, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration) throws Exception
      Binds from Netty HttpRequest to Camel headers as a Map. Will use the populateCamelHeaders method for populating the headers.
      Parameters:
      request - the netty http request
      headers - the Camel headers that should be populated
      exchange - the exchange that should contain the returned message.
      configuration - the endpoint configuration
      Throws:
      Exception - is thrown if error during binding
    • toCamelMessage

      org.apache.camel.Message toCamelMessage(io.netty.handler.codec.http.FullHttpResponse response, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration) throws Exception
      Binds from Netty HttpResponse to Camel Message.

      Will use the populateCamelHeaders method for populating the headers.

      Parameters:
      response - the netty http response
      exchange - the exchange that should contain the returned message.
      configuration - the endpoint configuration
      Returns:
      the message to store on the given exchange
      Throws:
      Exception - is thrown if error during binding
    • toCamelMessage

      org.apache.camel.Message toCamelMessage(InboundStreamHttpResponse response, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration) throws Exception
      Binds from Netty InboundStreamHttpResponse to Camel Message.

      Will use the populateCamelHeaders method for populating the headers.

      Parameters:
      response - the netty http response
      exchange - the exchange that should contain the returned message.
      configuration - the endpoint configuration
      Returns:
      the message to store on the given exchange
      Throws:
      Exception - is thrown if error during binding
    • populateCamelHeaders

      void populateCamelHeaders(io.netty.handler.codec.http.HttpResponse response, Map<String,Object> headers, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration) throws Exception
      Binds from Netty HttpResponse to Camel headers as a Map.
      Parameters:
      response - the netty http response
      headers - the Camel headers that should be populated
      exchange - the exchange that should contain the returned message.
      configuration - the endpoint configuration
      Throws:
      Exception - is thrown if error during binding
    • toNettyResponse

      io.netty.handler.codec.http.HttpResponse toNettyResponse(org.apache.camel.Message message, NettyHttpConfiguration configuration) throws Exception
      Binds from Camel Message to Netty HttpResponse.
      Parameters:
      message - the Camel message
      configuration - the endpoint configuration
      Returns:
      the http response
      Throws:
      Exception - is thrown if error during binding
    • toNettyRequest

      io.netty.handler.codec.http.HttpRequest toNettyRequest(org.apache.camel.Message message, String uri, NettyHttpConfiguration configuration) throws Exception
      Binds from Camel Message to Netty HttpRequest.
      Parameters:
      message - the Camel message
      uri - the uri which is the intended uri to call, though the message may override the uri
      configuration - the endpoint configuration
      Returns:
      the http request
      Throws:
      Exception - is thrown if error during binding
    • getHeaderFilterStrategy

      org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
      Gets the header filter strategy
      Returns:
      the strategy
    • setHeaderFilterStrategy

      void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
      Sets the header filter strategy to use.
      Parameters:
      headerFilterStrategy - the custom strategy