public class DefaultNettyHttpBinding extends Object implements NettyHttpBinding, Cloneable
NettyHttpBinding.| Constructor and Description |
|---|
DefaultNettyHttpBinding() |
DefaultNettyHttpBinding(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy) |
| Modifier and Type | Method and Description |
|---|---|
DefaultNettyHttpBinding |
copy() |
protected void |
copyCamelHeaders(Map<String,Object> headers,
org.apache.camel.Exchange exchange)
Copy camel header from exchange to headers map.
|
org.apache.camel.spi.HeaderFilterStrategy |
getHeaderFilterStrategy()
Gets the header filter strategy
|
void |
populateCamelHeaders(io.netty.handler.codec.http.HttpRequest request,
Map<String,Object> headers,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
Binds from Netty
HttpRequest to Camel headers as a Map. |
void |
populateCamelHeaders(io.netty.handler.codec.http.HttpResponse response,
Map<String,Object> headers,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
Binds from Netty
HttpResponse to Camel headers as a Map. |
void |
setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
Sets the header filter strategy to use.
|
protected String |
shouldUrlDecodeHeader(NettyHttpConfiguration configuration,
String headerName,
Object value,
String charset)
Decodes the header if needed to, or returns the header value as is.
|
org.apache.camel.Message |
toCamelMessage(io.netty.handler.codec.http.FullHttpRequest request,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
Binds from Netty
HttpRequest to Camel Message. |
org.apache.camel.Message |
toCamelMessage(io.netty.handler.codec.http.FullHttpResponse response,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
Binds from Netty
HttpResponse to Camel Message. |
org.apache.camel.Message |
toCamelMessage(InboundStreamHttpRequest request,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
Binds from Netty
InboundStreamHttpRequest to Camel Message. |
org.apache.camel.Message |
toCamelMessage(InboundStreamHttpResponse response,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
Binds from Netty
InboundStreamHttpResponse to Camel Message. |
io.netty.handler.codec.http.HttpRequest |
toNettyRequest(org.apache.camel.Message message,
String fullUri,
NettyHttpConfiguration configuration)
Binds from Camel
Message to Netty HttpRequest. |
io.netty.handler.codec.http.HttpResponse |
toNettyResponse(org.apache.camel.Message message,
NettyHttpConfiguration configuration)
Binds from Camel
Message to Netty HttpResponse. |
public DefaultNettyHttpBinding()
public DefaultNettyHttpBinding(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
public DefaultNettyHttpBinding copy()
public org.apache.camel.Message toCamelMessage(io.netty.handler.codec.http.FullHttpRequest request,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
throws Exception
NettyHttpBindingHttpRequest to Camel Message.
Will use the populateCamelHeaders method for populating the headers.toCamelMessage in interface NettyHttpBindingrequest - the netty http requestexchange - the exchange that should contain the returned message.configuration - the endpoint configurationException - is thrown if error during bindingpublic org.apache.camel.Message toCamelMessage(InboundStreamHttpRequest request, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration) throws Exception
NettyHttpBindingInboundStreamHttpRequest to Camel Message.
toCamelMessage in interface NettyHttpBindingrequest - the netty http requestexchange - the exchange that should contain the returned message.configuration - the endpoint configurationException - is thrown if error during bindingpublic void populateCamelHeaders(io.netty.handler.codec.http.HttpRequest request,
Map<String,Object> headers,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
throws Exception
NettyHttpBindingHttpRequest to Camel headers as a Map. Will use the
populateCamelHeaders method for populating the headers.populateCamelHeaders in interface NettyHttpBindingrequest - the netty http requestheaders - the Camel headers that should be populatedexchange - the exchange that should contain the returned message.configuration - the endpoint configurationException - is thrown if error during bindingprotected void copyCamelHeaders(Map<String,Object> headers, org.apache.camel.Exchange exchange)
headers - the map headersexchange - the exchangeprotected String shouldUrlDecodeHeader(NettyHttpConfiguration configuration, String headerName, Object value, String charset) throws UnsupportedEncodingException
configuration - the configurationheaderName - the header namevalue - the current header valuecharset - the charset to use for decodingUnsupportedEncodingException - is thrown if error decoding.public org.apache.camel.Message toCamelMessage(io.netty.handler.codec.http.FullHttpResponse response,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
NettyHttpBindingHttpResponse to Camel Message.
Will use the populateCamelHeaders method for populating the headers.toCamelMessage in interface NettyHttpBindingresponse - the netty http responseexchange - the exchange that should contain the returned message.configuration - the endpoint configurationpublic org.apache.camel.Message toCamelMessage(InboundStreamHttpResponse response, org.apache.camel.Exchange exchange, NettyHttpConfiguration configuration)
NettyHttpBindingInboundStreamHttpResponse to Camel Message.
Will use the populateCamelHeaders method for populating the headers.toCamelMessage in interface NettyHttpBindingresponse - the netty http responseexchange - the exchange that should contain the returned message.configuration - the endpoint configurationpublic void populateCamelHeaders(io.netty.handler.codec.http.HttpResponse response,
Map<String,Object> headers,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
NettyHttpBindingHttpResponse to Camel headers as a Map.populateCamelHeaders in interface NettyHttpBindingresponse - the netty http responseheaders - the Camel headers that should be populatedexchange - the exchange that should contain the returned message.configuration - the endpoint configurationpublic io.netty.handler.codec.http.HttpResponse toNettyResponse(org.apache.camel.Message message,
NettyHttpConfiguration configuration)
throws Exception
NettyHttpBindingMessage to Netty HttpResponse.toNettyResponse in interface NettyHttpBindingmessage - the Camel messageconfiguration - the endpoint configurationException - is thrown if error during bindingpublic io.netty.handler.codec.http.HttpRequest toNettyRequest(org.apache.camel.Message message,
String fullUri,
NettyHttpConfiguration configuration)
throws Exception
NettyHttpBindingMessage to Netty HttpRequest.toNettyRequest in interface NettyHttpBindingmessage - the Camel messagefullUri - the uri which is the intended uri to call, though the message may override the uriconfiguration - the endpoint configurationException - is thrown if error during bindingpublic org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
NettyHttpBindinggetHeaderFilterStrategy in interface NettyHttpBindingpublic void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
NettyHttpBindingsetHeaderFilterStrategy in interface NettyHttpBindingheaderFilterStrategy - the custom strategyApache Camel