Interface CxfRsBinding
- All Known Implementing Classes:
DefaultCxfRsBinding,SimpleCxfRsBinding
public interface CxfRsBinding
Interface to bind between Camel and CXF exchange for RESTful resources.
-
Method Summary
Modifier and TypeMethodDescriptionbindCamelHeadersToRequestHeaders(Map<String, Object> camelHeaders, org.apache.camel.Exchange camelExchange) Bind the camel headers to request headers that gets passed to CXF RSWebClientAPIs.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 RSWebClientAPIs.jakarta.ws.rs.client.Entity<Object> bindCamelMessageToRequestEntity(Object body, org.apache.camel.Message camelMessage, org.apache.camel.Exchange camelExchange) Bind the Camel message to a requestEntitythat gets passed toAsyncInvoker.method(java.lang.String, jakarta.ws.rs.client.Entity, jakarta.ws.rs.client.InvocationCallback).jakarta.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 requestEntitythat gets passed toAsyncInvoker.method(java.lang.String, jakarta.ws.rs.client.Entity, jakarta.ws.rs.client.InvocationCallback).bindResponseHeadersToCamelHeaders(Object response, org.apache.camel.Exchange camelExchange) Bind the response headers to camel out headers.bindResponseToCamelBody(Object response, org.apache.camel.Exchange camelExchange) Bind the HTTP response body to camel out bodypopulateCxfRsResponseFromExchange(org.apache.camel.Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange) Populate the CxfRsResponse object from the camel exchangevoidpopulateExchangeFromCxfRsRequest(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 Details
-
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:
cxfExchange- cxf exchange objectcamelExchange- camel 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 RSWebClientAPIs.- 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
jakarta.ws.rs.core.MultivaluedMap<String,String> bindCamelHeadersToRequestHeaders(Map<String, Object> camelHeaders, org.apache.camel.Exchange camelExchange) throws ExceptionBind the camel headers to request headers that gets passed to CXF RSWebClientAPIs.- 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
jakarta.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 requestEntitythat gets passed toAsyncInvoker.method(java.lang.String, jakarta.ws.rs.client.Entity, jakarta.ws.rs.client.InvocationCallback).- Parameters:
body- the message bodycamelMessage- the source messagecamelExchange- the Camel exchange- Returns:
- the
Entityto use - Throws:
Exception- can be thrown if error in the binding process
-
bindCamelMessageToRequestEntity
jakarta.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 requestEntitythat gets passed toAsyncInvoker.method(java.lang.String, jakarta.ws.rs.client.Entity, jakarta.ws.rs.client.InvocationCallback).- Parameters:
body- the message bodycamelMessage- the source messagecamelExchange- the Camel exchangewebClient- the CXF JAXRS WebClient- Returns:
- the
Entityto use - Throws:
Exception- can be thrown if error in the binding process
-