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() |
org.apache.camel.spi.HeaderFilterStrategy |
getHeaderFilterStrategy()
Gets the header filter strategy
|
void |
populateCamelHeaders(org.jboss.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(org.jboss.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(org.jboss.netty.handler.codec.http.HttpRequest request,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
Binds from Netty
HttpRequest to Camel Message. |
org.apache.camel.Message |
toCamelMessage(org.jboss.netty.handler.codec.http.HttpResponse response,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
Binds from Netty
HttpResponse to Camel Message. |
org.jboss.netty.handler.codec.http.HttpRequest |
toNettyRequest(org.apache.camel.Message message,
String uri,
NettyHttpConfiguration configuration)
Binds from Camel
Message to Netty HttpRequest. |
org.jboss.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(org.jboss.netty.handler.codec.http.HttpRequest request,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
throws Exception
NettyHttpBindingHttpRequest to Camel Message.
Will use NettyHttpBinding.populateCamelHeaders(org.jboss.netty.handler.codec.http.HttpRequest, java.util.Map, org.apache.camel.Exchange, NettyHttpConfiguration)
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 void populateCamelHeaders(org.jboss.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.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 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(org.jboss.netty.handler.codec.http.HttpResponse response,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
throws Exception
NettyHttpBindingHttpResponse to Camel Message.
Will use NettyHttpBinding.populateCamelHeaders(org.jboss.netty.handler.codec.http.HttpResponse, java.util.Map, org.apache.camel.Exchange, NettyHttpConfiguration)
for populating the headers.toCamelMessage in interface NettyHttpBindingresponse - the netty http responseexchange - the exchange that should contain the returned message.configuration - the endpoint configurationException - is thrown if error during bindingpublic void populateCamelHeaders(org.jboss.netty.handler.codec.http.HttpResponse response,
Map<String,Object> headers,
org.apache.camel.Exchange exchange,
NettyHttpConfiguration configuration)
throws Exception
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 configurationException - is thrown if error during bindingpublic org.jboss.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 org.jboss.netty.handler.codec.http.HttpRequest toNettyRequest(org.apache.camel.Message message,
String uri,
NettyHttpConfiguration configuration)
throws Exception
NettyHttpBindingMessage to Netty HttpRequest.toNettyRequest in interface NettyHttpBindingmessage - the Camel messageuri - 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