org.apache.camel.component.cxf.jaxrs
Interface CxfRsBinding

All Known Implementing Classes:
DefaultCxfRsBinding

public interface CxfRsBinding

Interface to bind between Camel and CXF exchange for RESTful resources.

Version:

Method Summary
 javax.ws.rs.core.MultivaluedMap<String,String> bindCamelHeadersToRequestHeaders(Map<String,Object> camelHeaders, org.apache.camel.Exchange camelExchange)
          Bind the camel headers to request headers that gets passed to CXF RS WebClient APIs.
 Object bindCamelMessageBodyToRequestBody(org.apache.camel.Message camelMessage, org.apache.camel.Exchange camelExchange)
          Bind the camel in message body to a request body that gets passed to CXF RS WebClient APIs.
 Map<String,Object> bindResponseHeadersToCamelHeaders(Object response, org.apache.camel.Exchange camelExchange)
          Bind the response headers to camel out headers.
 Object bindResponseToCamelBody(Object response, org.apache.camel.Exchange camelExchange)
          Bind the HTTP response body to camel out body
 Object populateCxfRsResponseFromExchange(org.apache.camel.Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange)
          Populate the CxfRsResponse object from the camel exchange
 void populateExchangeFromCxfRsRequest(org.apache.cxf.message.Exchange cxfExchange, org.apache.camel.Exchange camelExchange, Method method, Object[] paramArray)
          Populate the camel exchange from the CxfRsRequest, the exchange will be consumed by the processor which the CxfRsConsumer attached.
 

Method Detail

populateExchangeFromCxfRsRequest

void populateExchangeFromCxfRsRequest(org.apache.cxf.message.Exchange cxfExchange,
                                      org.apache.camel.Exchange camelExchange,
                                      Method method,
                                      Object[] paramArray)
Populate the camel exchange from the CxfRsRequest, the exchange will be consumed by the processor which the CxfRsConsumer attached.

Parameters:
camelExchange - camel exchange object
cxfExchange - cxf exchange object
method - the method which is need for the camel component
paramArray - the parameter list for the method invocation

populateCxfRsResponseFromExchange

Object populateCxfRsResponseFromExchange(org.apache.camel.Exchange camelExchange,
                                         org.apache.cxf.message.Exchange cxfExchange)
                                         throws Exception
Populate the CxfRsResponse object from the camel exchange

Parameters:
camelExchange - camel exchange object
cxfExchange - cxf exchange object
Returns:
the response object
Throws:
Exception - can be thrown if error in the binding process

bindCamelMessageBodyToRequestBody

Object bindCamelMessageBodyToRequestBody(org.apache.camel.Message camelMessage,
                                         org.apache.camel.Exchange camelExchange)
                                         throws Exception
Bind the camel in message body to a request body that gets passed to CXF RS WebClient APIs.

Parameters:
camelMessage - the source message
camelExchange - the Camel exchange
Returns:
the request object to be passed to invoke a WebClient
Throws:
Exception - can be thrown if error in the binding process

bindCamelHeadersToRequestHeaders

javax.ws.rs.core.MultivaluedMap<String,String> bindCamelHeadersToRequestHeaders(Map<String,Object> camelHeaders,
                                                                                org.apache.camel.Exchange camelExchange)
                                                                                throws Exception
Bind the camel headers to request headers that gets passed to CXF RS WebClient APIs.

Parameters:
camelHeaders - the source headers
camelExchange - the Camel exchange
Returns:
the headers
Throws:
Exception - can be thrown if error in the binding process

bindResponseToCamelBody

Object bindResponseToCamelBody(Object response,
                               org.apache.camel.Exchange camelExchange)
                               throws Exception
Bind the HTTP response body to camel out body

Parameters:
response - the response
camelExchange - the exchange
Returns:
the object to be set in the Camel out message body
Throws:
Exception - can be thrown if error in the binding process

bindResponseHeadersToCamelHeaders

Map<String,Object> bindResponseHeadersToCamelHeaders(Object response,
                                                     org.apache.camel.Exchange camelExchange)
                                                     throws Exception
Bind the response headers to camel out headers.

Parameters:
response - the response
camelExchange - the exchange
Returns:
headers to be set in the Camel out message
Throws:
Exception - can be thrown if error in the binding process


Apache CAMEL