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
,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
-
-
Constructor Summary
Constructors Constructor Description AbstractWsProducer(AbstractWsEndpoint<AuditDatasetType,ConfigType> endpoint, JaxWsClientFactory<AuditDatasetType> clientFactory, Class<InType> requestClass, Class<OutType> responseClass)
Constructs the producer.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract OutType
callService(Object client, InType body)
Sends the given request body to a Web Service via the given client proxy.protected void
cleanRequestContext(WrappedMessageContext requestContext)
Request context is shared among subsequent requests, so we have to clean it.protected void
configureClient(Object o)
Sets thread safety & timeout options of the given CXF client.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.protected void
enrichResponseMessage(org.apache.camel.Message message, WrappedMessageContext responseContext)
Enriches the given response message from the Web Service request context data.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.AbstractWsEndpoint<AuditDatasetType,ConfigType>
getEndpoint()
Class<InType>
getRequestClass()
Class<OutType>
getResponseClass()
WsTransactionConfiguration
getWsTransactionConfiguration()
void
process(org.apache.camel.Exchange exchange)
-
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
-
-
-
-
Constructor Detail
-
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 Detail
-
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, ornull
, 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 interfaceorg.apache.camel.EndpointAware
- Overrides:
getEndpoint
in classorg.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.
-
-