Interface NettyHttpBinding
-
- All Known Implementing Classes:
DefaultNettyHttpBinding,RestNettyHttpBinding
public interface NettyHttpBindingTo bind Netty http codec with the CamelMessageapi.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.camel.spi.HeaderFilterStrategygetHeaderFilterStrategy()Gets the header filter strategyvoidpopulateCamelHeaders(io.netty.handler.codec.http.HttpRequest request, Map<String,Object> headers, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration)Binds from NettyHttpRequestto Camel headers as aMap.voidpopulateCamelHeaders(io.netty.handler.codec.http.HttpResponse response, Map<String,Object> headers, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration)Binds from NettyHttpResponseto Camel headers as aMap.voidsetHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)Sets the header filter strategy to use.org.apache.camel.MessagetoCamelMessage(io.netty.handler.codec.http.FullHttpRequest request, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration)Binds from NettyHttpRequestto CamelMessage.org.apache.camel.MessagetoCamelMessage(io.netty.handler.codec.http.FullHttpResponse response, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration)Binds from NettyHttpResponseto CamelMessage.org.apache.camel.MessagetoCamelMessage(InboundStreamHttpRequest request, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration)Binds from NettyInboundStreamHttpRequestto CamelMessage.org.apache.camel.MessagetoCamelMessage(InboundStreamHttpResponse response, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration)Binds from NettyInboundStreamHttpResponseto CamelMessage.io.netty.handler.codec.http.HttpRequesttoNettyRequest(org.apache.camel.Message message, String uri, NettyHttpConfiguration configuration)Binds from CamelMessageto NettyHttpRequest.io.netty.handler.codec.http.HttpResponsetoNettyResponse(org.apache.camel.Message message, NettyHttpConfiguration configuration)Binds from CamelMessageto NettyHttpResponse.
-
-
-
Method Detail
-
toCamelMessage
org.apache.camel.Message toCamelMessage(io.netty.handler.codec.http.FullHttpRequest request, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration) throws ExceptionBinds from NettyHttpRequestto CamelMessage. Will use the populateCamelHeaders method for populating the headers.- Parameters:
request- the netty http requestexchange- 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 NettyInboundStreamHttpRequestto CamelMessage.- Parameters:
request- the netty http requestexchange- 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 ExceptionBinds from NettyHttpRequestto Camel headers as aMap. Will use the populateCamelHeaders method for populating the headers.- Parameters:
request- the netty http requestheaders- the Camel headers that should be populatedexchange- 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 ExceptionBinds from NettyHttpResponseto CamelMessage. Will use the populateCamelHeaders method for populating the headers.- Parameters:
response- the netty http responseexchange- 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 NettyInboundStreamHttpResponseto CamelMessage. Will use the populateCamelHeaders method for populating the headers.- Parameters:
response- the netty http responseexchange- 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 ExceptionBinds from NettyHttpResponseto Camel headers as aMap.- Parameters:
response- the netty http responseheaders- the Camel headers that should be populatedexchange- 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 ExceptionBinds from CamelMessageto NettyHttpResponse.- Parameters:
message- the Camel messageconfiguration- 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 ExceptionBinds from CamelMessageto NettyHttpRequest.- Parameters:
message- the Camel messageuri- the uri which is the intended uri to call, though the message may override the uriconfiguration- 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
-
-