Interface CxfRsBinding
-
- All Known Implementing Classes:
DefaultCxfRsBinding
,SimpleCxfRsBinding
public interface CxfRsBinding
Interface to bind between Camel and CXF exchange for RESTful resources.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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 RSWebClient
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 RSWebClient
APIs.javax.ws.rs.client.Entity<Object>
bindCamelMessageToRequestEntity(Object body, org.apache.camel.Message camelMessage, org.apache.camel.Exchange camelExchange)
Bind the Camel message to a requestEntity
that gets passed toAsyncInvoker.method(java.lang.String, javax.ws.rs.client.Entity, javax.ws.rs.client.InvocationCallback)
.javax.ws.rs.client.Entity<Object>
bindCamelMessageToRequestEntity(Object body, org.apache.camel.Message camelMessage, org.apache.camel.Exchange camelExchange, org.apache.cxf.jaxrs.client.WebClient webClient)
Bind the Camel message to a requestEntity
that gets passed toAsyncInvoker.method(java.lang.String, javax.ws.rs.client.Entity, javax.ws.rs.client.InvocationCallback)
.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 bodyObject
populateCxfRsResponseFromExchange(org.apache.camel.Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange)
Populate the CxfRsResponse object from the camel exchangevoid
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 objectcxfExchange
- cxf exchange objectmethod
- the method which is need for the camel componentparamArray
- 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 objectcxfExchange
- 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 RSWebClient
APIs.- Parameters:
camelMessage
- the source messagecamelExchange
- 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 RSWebClient
APIs.- Parameters:
camelHeaders
- the source headerscamelExchange
- 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 responsecamelExchange
- 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 responsecamelExchange
- the exchange- Returns:
- headers to be set in the Camel out message
- Throws:
Exception
- can be thrown if error in the binding process
-
bindCamelMessageToRequestEntity
javax.ws.rs.client.Entity<Object> bindCamelMessageToRequestEntity(Object body, org.apache.camel.Message camelMessage, org.apache.camel.Exchange camelExchange) throws Exception
Bind the Camel message to a requestEntity
that gets passed toAsyncInvoker.method(java.lang.String, javax.ws.rs.client.Entity, javax.ws.rs.client.InvocationCallback)
.- Parameters:
camelMessage
- the source messagecamelExchange
- the Camel exchangebody
- the message body- Returns:
- the
Entity
to use - Throws:
Exception
- can be thrown if error in the binding process
-
bindCamelMessageToRequestEntity
javax.ws.rs.client.Entity<Object> bindCamelMessageToRequestEntity(Object body, org.apache.camel.Message camelMessage, org.apache.camel.Exchange camelExchange, org.apache.cxf.jaxrs.client.WebClient webClient) throws Exception
Bind the Camel message to a requestEntity
that gets passed toAsyncInvoker.method(java.lang.String, javax.ws.rs.client.Entity, javax.ws.rs.client.InvocationCallback)
.- Parameters:
camelMessage
- the source messagecamelExchange
- the Camel exchangebody
- the message bodywebClient
- the CXF JAXRS WebClient- Returns:
- the
Entity
to use - Throws:
Exception
- can be thrown if error in the binding process
-
-