Class AbstractWsProducer<AuditDatasetType extends WsAuditDataset,ConfigType extends WsTransactionConfiguration<AuditDatasetType>,InType,OutType>
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultProducer
org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsProducer<AuditDatasetType,ConfigType,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
,EndpointAware
,IsSingleton
,Processor
,Producer
,Service
,ShutdownableService
,StatefulService
,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
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
ConstructorDescriptionAbstractWsProducer
(AbstractWsEndpoint<AuditDatasetType, ConfigType> endpoint, JaxWsClientFactory<AuditDatasetType> clientFactory, Class<InType> requestClass, Class<OutType> responseClass) Constructs the producer. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract OutType
callService
(Object client, InType body) Sends the given request body to a Web Service via the given client proxy.protected void
cleanRequestContext
(org.apache.cxf.jaxws.context.WrappedMessageContext requestContext) Request context is shared among subsequent requests, so we have to clean it.protected void
Sets thread safety & timeout options of the given CXF client.protected void
enrichRequestContext
(Exchange exchange, org.apache.cxf.jaxws.context.WrappedMessageContext requestContext) Enriches the given Web Service request context on the basis of the given Camel exchange, and vice versa.protected void
enrichResponseMessage
(Message message, org.apache.cxf.jaxws.context.WrappedMessageContext responseContext) Enriches the given response message from the Web Service request context data.protected String[]
getAlternativeRequestKeys
(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.void
Methods inherited from class org.apache.camel.support.DefaultProducer
createExchange, doStart, doStop, isSingleton, toString
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
AbstractWsProducer
public AbstractWsProducer(AbstractWsEndpoint<AuditDatasetType, ConfigType> endpoint, JaxWsClientFactory<AuditDatasetType> clientFactory, Class<InType> requestClass, Class<OutType> responseClass) Constructs the producer.- Parameters:
endpoint
- the endpoint that creates this producer.clientFactory
- the factory for clients to produce messages for the service.requestClass
- type of request messages.
-
-
Method Details
-
process
- Throws:
Exception
-
callService
Sends the given request body to a Web Service via the given client proxy.- Throws:
Exception
-
enrichRequestContext
protected void enrichRequestContext(Exchange exchange, org.apache.cxf.jaxws.context.WrappedMessageContext requestContext) Enriches the given Web Service request context on the basis of the given Camel exchange, and vice versa. -
getAlternativeRequestKeys
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, ornull
, when no keys could have been extracted.
-
enrichResponseMessage
protected void enrichResponseMessage(Message message, org.apache.cxf.jaxws.context.WrappedMessageContext responseContext) Enriches the given response message from the Web Service request context data. -
getEndpoint
- Specified by:
getEndpoint
in interfaceEndpointAware
- Overrides:
getEndpoint
in classorg.apache.camel.support.DefaultProducer
-
configureClient
Sets thread safety & timeout options of the given CXF client. -
cleanRequestContext
protected void cleanRequestContext(org.apache.cxf.jaxws.context.WrappedMessageContext requestContext) Request context is shared among subsequent requests, so we have to clean it. -
getWsTransactionConfiguration
- Returns:
- the info describing the Web Service.
-
getRequestClass
-
getResponseClass
-