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 Type
    Method
    Description
    jakarta.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.
    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.
    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 request Entity that gets passed to AsyncInvoker.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 request Entity that gets passed to AsyncInvoker.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 body
    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 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 object
      camelExchange - camel 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

      jakarta.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
    • 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 request Entity that gets passed to AsyncInvoker.method(java.lang.String, jakarta.ws.rs.client.Entity, jakarta.ws.rs.client.InvocationCallback).
      Parameters:
      body - the message body
      camelMessage - the source message
      camelExchange - the Camel exchange
      Returns:
      the Entity to 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 request Entity that gets passed to AsyncInvoker.method(java.lang.String, jakarta.ws.rs.client.Entity, jakarta.ws.rs.client.InvocationCallback).
      Parameters:
      body - the message body
      camelMessage - the source message
      camelExchange - the Camel exchange
      webClient - the CXF JAXRS WebClient
      Returns:
      the Entity to use
      Throws:
      Exception - can be thrown if error in the binding process