public class DefaultCxfRsBinding extends Object implements CxfRsBinding, org.apache.camel.spi.HeaderFilterStrategyAware
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
camelToCxfHeaderMap |
protected Map<String,String> |
cxfToCamelHeaderMap |
Constructor and Description |
---|
DefaultCxfRsBinding() |
Modifier and Type | Method and 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 RS
WebClient APIs. |
Object |
bindCamelMessageBodyToRequestBody(org.apache.camel.Message camelMessage,
org.apache.camel.Exchange camelExchange)
This method call Message.getBody(
MessageContentsList ) to allow
an appropriate converter to kick in even through we only read the first
element off the MessageContextList. |
Map<String,Object> |
bindResponseHeadersToCamelHeaders(Object response,
org.apache.camel.Exchange camelExchange)
We will return an empty Map unless the response parameter is a
Response object. |
Object |
bindResponseToCamelBody(Object response,
org.apache.camel.Exchange camelExchange)
By default, we just return the response object.
|
protected void |
copyMessageHeader(org.apache.cxf.message.Message cxfMessage,
org.apache.camel.Message camelMessage,
String cxfKey,
String camelKey) |
protected void |
copyOperationResourceInfoStack(org.apache.cxf.message.Message cxfMessage,
org.apache.camel.Message camelMessage) |
protected void |
copyProtocolHeader(org.apache.cxf.message.Message cxfMessage,
org.apache.camel.Message camelMessage,
org.apache.camel.Exchange camelExchange) |
Map<String,String> |
getCamelToCxfHeaderMap() |
Map<String,String> |
getCxfToCamelHeaderMap() |
org.apache.camel.spi.HeaderFilterStrategy |
getHeaderFilterStrategy() |
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.
|
void |
setCamelToCxfHeaderMap(Map<String,String> camelToCxfHeaderMap) |
protected void |
setCharsetWithContentType(org.apache.camel.Exchange camelExchange) |
void |
setCxfToCamelHeaderMap(Map<String,String> cxfToCamelHeaderMap) |
void |
setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy strategy) |
public Object populateCxfRsResponseFromExchange(org.apache.camel.Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange) throws Exception
CxfRsBinding
populateCxfRsResponseFromExchange
in interface CxfRsBinding
camelExchange
- camel exchange objectcxfExchange
- cxf exchange objectException
- can be thrown if error in the binding processpublic void populateExchangeFromCxfRsRequest(org.apache.cxf.message.Exchange cxfExchange, org.apache.camel.Exchange camelExchange, Method method, Object[] paramArray)
CxfRsBinding
populateExchangeFromCxfRsRequest
in interface CxfRsBinding
cxfExchange
- cxf exchange objectcamelExchange
- camel exchange objectmethod
- the method which is need for the camel componentparamArray
- the parameter list for the method invocationprotected void setCharsetWithContentType(org.apache.camel.Exchange camelExchange)
public javax.ws.rs.core.MultivaluedMap<String,String> bindCamelHeadersToRequestHeaders(Map<String,Object> camelHeaders, org.apache.camel.Exchange camelExchange) throws Exception
CxfRsBinding
WebClient
APIs.bindCamelHeadersToRequestHeaders
in interface CxfRsBinding
camelHeaders
- the source headerscamelExchange
- the Camel exchangeException
- can be thrown if error in the binding processpublic Object bindCamelMessageBodyToRequestBody(org.apache.camel.Message camelMessage, org.apache.camel.Exchange camelExchange) throws Exception
MessageContentsList
) to allow
an appropriate converter to kick in even through we only read the first
element off the MessageContextList. If that returns null, we check
the body to see if it is a List or an array and then return the first
element. If that fails, we will simply return the object.bindCamelMessageBodyToRequestBody
in interface CxfRsBinding
camelMessage
- the source messagecamelExchange
- the Camel exchangeException
- can be thrown if error in the binding processpublic Map<String,Object> bindResponseHeadersToCamelHeaders(Object response, org.apache.camel.Exchange camelExchange) throws Exception
Response
object.bindResponseHeadersToCamelHeaders
in interface CxfRsBinding
response
- the responsecamelExchange
- the exchangeException
- can be thrown if error in the binding processpublic Object bindResponseToCamelBody(Object response, org.apache.camel.Exchange camelExchange) throws Exception
bindResponseToCamelBody
in interface CxfRsBinding
response
- the responsecamelExchange
- the exchangeException
- can be thrown if error in the binding processpublic org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
getHeaderFilterStrategy
in interface org.apache.camel.spi.HeaderFilterStrategyAware
public void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy strategy)
setHeaderFilterStrategy
in interface org.apache.camel.spi.HeaderFilterStrategyAware
protected void copyMessageHeader(org.apache.cxf.message.Message cxfMessage, org.apache.camel.Message camelMessage, String cxfKey, String camelKey)
protected void copyProtocolHeader(org.apache.cxf.message.Message cxfMessage, org.apache.camel.Message camelMessage, org.apache.camel.Exchange camelExchange)
protected void copyOperationResourceInfoStack(org.apache.cxf.message.Message cxfMessage, org.apache.camel.Message camelMessage)
Apache Camel