org.apache.camel.component.netty.http
Interface NettyHttpBinding

All Known Implementing Classes:
DefaultNettyHttpBinding

public interface NettyHttpBinding

To bind Netty http codec with the Camel Message api.


Method Summary
 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.
 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.
 

Method Detail

toCamelMessage

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

Will use populateCamelHeaders(org.jboss.netty.handler.codec.http.HttpRequest, java.util.Map, org.apache.camel.Exchange, NettyHttpConfiguration) 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

populateCamelHeaders

void populateCamelHeaders(org.jboss.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.

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(org.jboss.netty.handler.codec.http.HttpResponse response,
                                        org.apache.camel.Exchange exchange,
                                        NettyHttpConfiguration configuration)
                                        throws Exception
Binds from Netty HttpResponse to Camel Message.

Will use populateCamelHeaders(org.jboss.netty.handler.codec.http.HttpResponse, java.util.Map, org.apache.camel.Exchange, NettyHttpConfiguration) 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(org.jboss.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

org.jboss.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

org.jboss.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


Apache Camel