Class AbstractWsEndpoint<AuditDatasetType extends WsAuditDataset,ConfigType extends WsTransactionConfiguration<AuditDatasetType>>
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.openehealth.ipf.platform.camel.ihe.ws.AbstractWsEndpoint<AuditDatasetType,ConfigType>
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
,AuditableEndpoint<AuditDatasetType>
- Direct Known Subclasses:
Hl7v3AsyncResponseEndpoint
,Hl7v3Endpoint
,HpdEndpoint
,SimpleHl7v2WsEndpoint
,Xacml20Endpoint
,XdsAsyncResponseEndpoint
,XdsEndpoint
@ManagedResource(description="Managed IPF eHealth Web Service Endpoint") public abstract class AbstractWsEndpoint<AuditDatasetType extends WsAuditDataset,ConfigType extends WsTransactionConfiguration<AuditDatasetType>> extends org.apache.camel.support.DefaultEndpoint implements AuditableEndpoint<AuditDatasetType>
Camel endpoint used to create producers and consumers based on webservice calls.- Author:
- Jens Riemschneider, Dmytro Rud
-
-
Field Summary
Fields Modifier and Type Field Description static String
CORRELATION_KEY_HEADER_NAME
Name of Camel message header where the user should store the optional correlation key.static String
INCOMING_HTTP_HEADERS
Name of Camel message header where incoming HTTP headers will be stored as aMap<String, String>
.static String
INCOMING_SOAP_HEADERS
static String
OUTGOING_HTTP_HEADERS
Name of Camel message header from where additional user-defined HTTP headers will be taken as aMap<String, String>
.static String
OUTGOING_SOAP_HEADERS
static String
WSA_REPLYTO_HEADER_NAME
Name of incoming Camel header where the user should store the URL of asynchronous response endpoint (WS-Addressing header "ReplyTo").
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractWsEndpoint(String endpointUri, String address, AbstractWsComponent<AuditDatasetType,ConfigType,? extends WsInteractionId<ConfigType>> component, Map<String,Object> parameters, Class<? extends AbstractWebService> serviceClass)
protected
AbstractWsEndpoint(String endpointUri, String address, AbstractWsComponent<AuditDatasetType,ConfigType,? extends WsInteractionId<ConfigType>> component, AuditContext auditContext, InterceptorProvider customInterceptors, List<AbstractFeature> features, List<String> schemaLocations, Map<String,Object> properties, Class<? extends AbstractWebService> serviceClass)
Constructs the endpoint.
-
Method Summary
-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, doStart, doStop, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, 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, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.camel.Endpoint
configureProperties, createAsyncProducer, createExchange, createExchange, createPollingConsumer, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, isLenientProperties, isSingletonProducer, setCamelContext
-
-
-
-
Field Detail
-
WSA_REPLYTO_HEADER_NAME
public static final String WSA_REPLYTO_HEADER_NAME
Name of incoming Camel header where the user should store the URL of asynchronous response endpoint (WS-Addressing header "ReplyTo").
-
CORRELATION_KEY_HEADER_NAME
public static final String CORRELATION_KEY_HEADER_NAME
Name of Camel message header where the user should store the optional correlation key.
-
INCOMING_HTTP_HEADERS
public static final String INCOMING_HTTP_HEADERS
Name of Camel message header where incoming HTTP headers will be stored as aMap<String, String>
.
-
OUTGOING_HTTP_HEADERS
public static final String OUTGOING_HTTP_HEADERS
Name of Camel message header from where additional user-defined HTTP headers will be taken as aMap<String, String>
.
-
INCOMING_SOAP_HEADERS
public static final String INCOMING_SOAP_HEADERS
-
OUTGOING_SOAP_HEADERS
public static final String OUTGOING_SOAP_HEADERS
-
-
Constructor Detail
-
AbstractWsEndpoint
protected AbstractWsEndpoint(String endpointUri, String address, AbstractWsComponent<AuditDatasetType,ConfigType,? extends WsInteractionId<ConfigType>> component, Map<String,Object> parameters, Class<? extends AbstractWebService> serviceClass)
-
AbstractWsEndpoint
protected AbstractWsEndpoint(String endpointUri, String address, AbstractWsComponent<AuditDatasetType,ConfigType,? extends WsInteractionId<ConfigType>> component, AuditContext auditContext, InterceptorProvider customInterceptors, List<AbstractFeature> features, List<String> schemaLocations, Map<String,Object> properties, Class<? extends AbstractWebService> serviceClass)
Constructs the endpoint.- Parameters:
endpointUri
- the URI of the endpoint.address
- the endpoint address from the URI.component
- the component creating this endpoint.auditContext
- the audit contextcustomInterceptors
- user-defined set of additional CXF interceptors.features
- user-defined list of CXF features.
-
-
Method Detail
-
getServiceInstance
public AbstractWebService getServiceInstance()
Constructs and returns a transaction-specific service class instance for the given endpoint.- Returns:
- service class instance for the given endpoint.
-
getCustomServiceInstance
protected AbstractWebService getCustomServiceInstance(AbstractWsEndpoint<AuditDatasetType,ConfigType> endpoint)
Returns a new instance of a service class. Overwrite this method if a simple call toClass.newInstance()
is not sufficient.- Parameters:
endpoint
- this endpoint as paramater- Returns:
- service class instance
-
getClientAuditStrategy
public AuditStrategy<AuditDatasetType> getClientAuditStrategy()
Description copied from interface:AuditableEndpoint
Returns client-side audit strategy instance.- Specified by:
getClientAuditStrategy
in interfaceAuditableEndpoint<AuditDatasetType extends WsAuditDataset>
- Returns:
- client-side audit strategy instance
-
getServerAuditStrategy
public AuditStrategy<AuditDatasetType> getServerAuditStrategy()
Description copied from interface:AuditableEndpoint
Returns server-side audit strategy instance.- Specified by:
getServerAuditStrategy
in interfaceAuditableEndpoint<AuditDatasetType extends WsAuditDataset>
- Returns:
- server-side audit strategy instance
-
isSingleton
@ManagedAttribute public boolean isSingleton()
- Specified by:
isSingleton
in interfaceorg.apache.camel.IsSingleton
- Overrides:
isSingleton
in classorg.apache.camel.support.DefaultEndpoint
-
getServiceUrl
public String getServiceUrl()
Returns the URL of the service. The URL is derived from the endpoint URI defined in the constructor. If the URI does not represent a producer, this method throws an exception.- Returns:
- the service URL.
-
getServiceAddress
@ManagedAttribute(description="Service Address") public String getServiceAddress()
Returns the address of the service. The address is derived from the endpoint URI defined in the constructor. If the URI does not represent a consumer, this method throws an exception.- Returns:
- the service address.
-
isAudit
@ManagedAttribute(description="Audit Enabled") public boolean isAudit()
- Specified by:
isAudit
in interfaceAuditableEndpoint<AuditDatasetType extends WsAuditDataset>
- Returns:
true
if auditing is turned on.true
by default.
-
getAuditContext
public AuditContext getAuditContext()
- Specified by:
getAuditContext
in interfaceAuditableEndpoint<AuditDatasetType extends WsAuditDataset>
- Returns:
- audit context to be used for this endpoint
-
setAuditContext
public void setAuditContext(AuditContext auditContext)
-
isSecure
@ManagedAttribute(description="Security Enabled") public boolean isSecure()
- Returns:
true
if https should be used instead of http. Defaults tofalse
.
-
setSecure
public void setSecure(boolean secure)
- Parameters:
secure
-true
if https should be used instead of http.
-
getUsername
public String getUsername()
-
setUsername
@ManagedAttribute(description="Basic Authentication Username") public void setUsername(String username)
-
getPassword
@ManagedAttribute(description="Basic Authentication Password") public String getPassword()
-
setPassword
public void setPassword(String password)
-
getSslContextParameters
public org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters()
-
setSslContextParameters
public void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
-
getHostnameVerifier
public HostnameVerifier getHostnameVerifier()
-
setHostnameVerifier
public void setHostnameVerifier(HostnameVerifier hostnameVerifier)
-
setCorrelator
public void setCorrelator(AsynchronyCorrelator<AuditDatasetType> correlator)
Configures the asynchrony correlator for this endpoint.
-
getCorrelator
public AsynchronyCorrelator<AuditDatasetType> getCorrelator()
Returns the correlator.
-
getCustomInterceptors
public InterceptorProvider getCustomInterceptors()
Returns custom interceptors configured for this endpoint.
-
getHomeCommunityId
@ManagedAttribute(description="HomeCommunityId") public String getHomeCommunityId()
- Returns:
- homeCommunityId of this endpoint.
-
setHomeCommunityId
public void setHomeCommunityId(String homeCommunityId)
Configures homeCommunityId for this endpoint.- Parameters:
homeCommunityId
- homeCommunityId in format "urn:oid:1.2.3.4.5".
-
setHomeCommunityId
public void setHomeCommunityId(URN urn)
Configures homeCommunityId for this endpoint.- Parameters:
urn
- homeCommunityId in format "urn:oid:1.2.3.4.5".
-
getRejectionHandlingStrategy
public WsRejectionHandlingStrategy getRejectionHandlingStrategy()
- Returns:
- rejection handling strategy, if any configured.
-
setRejectionHandlingStrategy
public void setRejectionHandlingStrategy(WsRejectionHandlingStrategy rejectionHandlingStrategy)
- Parameters:
rejectionHandlingStrategy
- a rejection handling strategy instance.
-
getFeatures
public List<AbstractFeature> getFeatures()
- Returns:
- CXF features configured for this endpoint.
-
getSchemaLocations
public List<String> getSchemaLocations()
- Returns:
- CXF schema locations configured for this endpoint.
-
getProperties
public Map<String,Object> getProperties()
- Returns:
- CXF schema locations configured for this endpoint.
-
getComponent
public AbstractWsComponent<AuditDatasetType,ConfigType,? extends WsInteractionId> getComponent()
- Overrides:
getComponent
in classorg.apache.camel.support.DefaultEndpoint
-
getJaxWsClientFactory
public abstract JaxWsClientFactory<AuditDatasetType> getJaxWsClientFactory()
- Returns:
- JAX-WS client object factory.
-
getJaxWsServiceFactory
public abstract JaxWsServiceFactory<AuditDatasetType> getJaxWsServiceFactory()
- Returns:
- JAX-WS service object factory.
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
- Specified by:
createConsumer
in interfaceorg.apache.camel.Endpoint
-
createProducer
public org.apache.camel.Producer createProducer()
- Specified by:
createProducer
in interfaceorg.apache.camel.Endpoint
-
getProducer
public abstract AbstractWsProducer<AuditDatasetType,ConfigType,?,?> getProducer(AbstractWsEndpoint<AuditDatasetType,ConfigType> endpoint, JaxWsClientFactory<AuditDatasetType> clientFactory)
Constructs and returns a transaction-specific Camel producer instance- Parameters:
clientFactory
- JAX-WS client factory instance.- Returns:
- Camel producer instance.
- Since:
- 3.1
-
isAddressing
@ManagedAttribute(description="Addressing Enabled") public boolean isAddressing()
- Returns:
true
if WS-Addressing enabled.
-
isMtom
@ManagedAttribute(description="Mtom Enabled") public boolean isMtom()
- Returns:
true
if MTOM enabled.
-
isSwaOutSupport
@ManagedAttribute(description="SOAP With Attachments Output Enabled") public boolean isSwaOutSupport()
- Returns:
true
if SOAP With Attachments Output enabled.
-
getSecurityInformation
public WsSecurityInformation getSecurityInformation()
-
-