Class AbstractWsProducer<AuditDatasetType extends WsAuditDataset,​ConfigType extends WsTransactionConfiguration<AuditDatasetType>,​InType,​OutType>

  • Type Parameters:
    InType - type of input data (i.e. of the data got from the route).
    OutType - type of output data (i.e. of the data returned to the route).
    All Implemented Interfaces:
    AutoCloseable, org.apache.camel.EndpointAware, org.apache.camel.IsSingleton, org.apache.camel.Processor, org.apache.camel.Producer, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.StatefulService, org.apache.camel.SuspendableService
    Direct Known Subclasses:
    ChPpq1Producer, Hl7v3ContinuationAwareProducer, Iti44Producer, Iti55DeferredResponseProducer, SimpleWsProducer, XdsSubmissionProducer

    public abstract class AbstractWsProducer<AuditDatasetType extends WsAuditDataset,​ConfigType extends WsTransactionConfiguration<AuditDatasetType>,​InType,​OutType>
    extends org.apache.camel.support.DefaultProducer
    Camel producer used to make calls to a Web Service.
    Author:
    Jens Riemschneider, Dmytro Rud
    • Method Detail

      • process

        public void process​(org.apache.camel.Exchange exchange)
                     throws Exception
        Throws:
        Exception
      • callService

        protected abstract OutType callService​(Object client,
                                               InType body)
                                        throws Exception
        Sends the given request body to a Web Service via the given client proxy.
        Throws:
        Exception
      • enrichRequestContext

        protected void enrichRequestContext​(org.apache.camel.Exchange exchange,
                                            WrappedMessageContext requestContext)
        Enriches the given Web Service request context on the basis of the given Camel exchange, and vice versa.
      • getAlternativeRequestKeys

        protected String[] getAlternativeRequestKeys​(org.apache.camel.Exchange exchange)
        Determines the set of correlation keys for the request message contained in the given exchange, which are alternative to the WS-Addressing message ID. An example of alternative key is the query ID in HL7v3-based transactions.

        Per default, this method returns null.

        Parameters:
        exchange - Camel exchange containing a request message.
        Returns:
        A non-empty collection of non-null alternative keys, or null, when no keys could have been extracted.
      • enrichResponseMessage

        protected void enrichResponseMessage​(org.apache.camel.Message message,
                                             WrappedMessageContext responseContext)
        Enriches the given response message from the Web Service request context data.
      • getEndpoint

        public AbstractWsEndpoint<AuditDatasetType,​ConfigType> getEndpoint()
        Specified by:
        getEndpoint in interface org.apache.camel.EndpointAware
        Overrides:
        getEndpoint in class org.apache.camel.support.DefaultProducer
      • configureClient

        protected void configureClient​(Object o)
        Sets thread safety & timeout options of the given CXF client.
      • cleanRequestContext

        protected void cleanRequestContext​(WrappedMessageContext requestContext)
        Request context is shared among subsequent requests, so we have to clean it.
      • getWsTransactionConfiguration

        public WsTransactionConfiguration getWsTransactionConfiguration()
        Returns:
        the info describing the Web Service.
      • getRequestClass

        public Class<InType> getRequestClass()
      • getResponseClass

        public Class<OutType> getResponseClass()