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
,CamelContextAware
,Endpoint
,IsSingleton
,Service
,ShutdownableService
,HasId
,StatefulService
,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
Modifier and TypeFieldDescriptionstatic final String
Name of Camel message header where the user should store the optional correlation key.static final String
Name of Camel message header where incoming HTTP headers will be stored as aMap<String, String>
.static final String
static final String
Name of Camel message header from where additional user-defined HTTP headers will be taken as aMap<String, String>
.static final String
static final String
Name of incoming Camel header where the user should store the URL of asynchronous response endpoint (WS-Addressing header "ReplyTo").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
ModifierConstructorDescriptionprotected
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, org.apache.cxf.transports.http.configuration.HTTPClientPolicy httpClientPolicy, Class<? extends AbstractWebService> serviceClass) Constructs the endpoint. -
Method Summary
Modifier and TypeMethodDescriptioncreateConsumer
(Processor processor) Returns client-side audit strategy instance.Returns the correlator.Returns custom interceptors configured for this endpoint.Deprecated.protected AbstractWebService
Returns a new instance of a service class.org.apache.cxf.transports.http.configuration.HTTPClientPolicy
abstract JaxWsClientFactory<AuditDatasetType>
abstract JaxWsServiceFactory<AuditDatasetType>
abstract AbstractWsProducer<AuditDatasetType,
ConfigType, ?, ?> getProducer
(AbstractWsEndpoint<AuditDatasetType, ConfigType> endpoint, JaxWsClientFactory<AuditDatasetType> clientFactory) Constructs and returns a transaction-specific Camel producer instanceReturns server-side audit strategy instance.Returns the address of the service.Constructs and returns a transaction-specific service class instance for the given endpoint.Returns the URL of the service.boolean
boolean
isAudit()
boolean
isMtom()
boolean
isSecure()
boolean
boolean
void
setAuditContext
(AuditContext auditContext) void
setCorrelator
(AsynchronyCorrelator<AuditDatasetType> correlator) Configures the asynchrony correlator for this endpoint.void
setHomeCommunityId
(String homeCommunityId) Configures homeCommunityId for this endpoint.void
setHomeCommunityId
(URN urn) Configures homeCommunityId for this endpoint.void
setHostnameVerifier
(HostnameVerifier hostnameVerifier) void
setHttpClientPolicy
(org.apache.cxf.transports.http.configuration.HTTPClientPolicy httpClientPolicy) void
setPassword
(String password) void
setRejectionHandlingStrategy
(WsRejectionHandlingStrategy rejectionHandlingStrategy) void
setSecure
(boolean secure) void
setSslContextParameters
(SSLContextParameters sslContextParameters) void
setUsername
(String username) Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, 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, isPollingConsumerCopy, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, 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
configureExchange, configureProperties, createAsyncProducer, createExchange, createExchange, createPollingConsumer, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, getExchangePattern, isLenientProperties, isSingletonProducer, setCamelContext
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
-
Field Details
-
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
Name of Camel message header where the user should store the optional correlation key. -
INCOMING_HTTP_HEADERS
Name of Camel message header where incoming HTTP headers will be stored as aMap<String, 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
-
OUTGOING_SOAP_HEADERS
-
-
Constructor Details
-
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, org.apache.cxf.transports.http.configuration.HTTPClientPolicy httpClientPolicy, 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 Details
-
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
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
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 interfaceIsSingleton
- Overrides:
isSingleton
in classorg.apache.camel.support.DefaultEndpoint
-
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
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
- Specified by:
getAuditContext
in interfaceAuditableEndpoint<AuditDatasetType extends WsAuditDataset>
- Returns:
- audit context to be used for this endpoint
-
setAuditContext
-
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
-
setUsername
@ManagedAttribute(description="Basic Authentication Username") public void setUsername(String username) -
getPassword
-
setPassword
-
getSslContextParameters
-
setSslContextParameters
-
getHostnameVerifier
-
setHostnameVerifier
-
setCorrelator
Configures the asynchrony correlator for this endpoint. -
getCorrelator
Returns the correlator. -
getCustomCxfInterceptors
Returns custom interceptors configured for this endpoint. -
getCustomInterceptors
Deprecated.Returns custom interceptors configured for this endpoint. -
getHomeCommunityId
- Returns:
- homeCommunityId of this endpoint.
-
setHomeCommunityId
Configures homeCommunityId for this endpoint.- Parameters:
homeCommunityId
- homeCommunityId in format "urn:oid:1.2.3.4.5".
-
setHomeCommunityId
Configures homeCommunityId for this endpoint.- Parameters:
urn
- homeCommunityId in format "urn:oid:1.2.3.4.5".
-
getRejectionHandlingStrategy
- Returns:
- rejection handling strategy, if any configured.
-
setRejectionHandlingStrategy
- Parameters:
rejectionHandlingStrategy
- a rejection handling strategy instance.
-
getFeatures
- Returns:
- CXF features configured for this endpoint.
-
getSchemaLocations
- Returns:
- CXF schema locations configured for this endpoint.
-
getProperties
- Returns:
- CXF schema locations configured for this endpoint.
-
setHttpClientPolicy
public void setHttpClientPolicy(org.apache.cxf.transports.http.configuration.HTTPClientPolicy httpClientPolicy) -
getHttpClientPolicy
public org.apache.cxf.transports.http.configuration.HTTPClientPolicy getHttpClientPolicy() -
getComponent
- Overrides:
getComponent
in classorg.apache.camel.support.DefaultEndpoint
-
getJaxWsClientFactory
- Returns:
- JAX-WS client object factory.
-
getJaxWsServiceFactory
- Returns:
- JAX-WS service object factory.
-
createConsumer
- Specified by:
createConsumer
in interfaceEndpoint
-
createProducer
- Specified by:
createProducer
in interfaceEndpoint
-
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
-
getCustomCxfInterceptors()