Class FhirComponent<AuditDatasetType extends FhirAuditDataset>
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultComponent
-
- org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirComponent<AuditDatasetType>
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Component
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
,AuditableComponent<AuditDatasetType>
,InterceptableComponent
- Direct Known Subclasses:
CustomFhirComponent
,Iti65Component
,Iti66Component
,Iti67Component
,Iti78Component
,Iti81Component
,Iti83Component
,Pcc44Component
public abstract class FhirComponent<AuditDatasetType extends FhirAuditDataset> extends org.apache.camel.support.DefaultComponent implements AuditableComponent<AuditDatasetType>, InterceptableComponent
Abstract FHIR Camel component- Since:
- 3.1
- Author:
- Christian Ohr
-
-
Constructor Summary
Constructors Constructor Description FhirComponent(org.apache.camel.CamelContext context, FhirInteractionId<AuditDatasetType> fhirInteractionId)
FhirComponent(FhirInteractionId<AuditDatasetType> fhirInteractionId)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
connect(FhirConsumer<AuditDatasetType> consumer, FhirProvider resourceProvider)
Connects the URL specified on the endpoint to the specified processor.protected FhirEndpointConfiguration<AuditDatasetType>
createConfig(String remaining, Map<String,Object> parameters)
protected org.apache.camel.Endpoint
createEndpoint(String uri, String remaining, Map<String,Object> parameters)
void
disconnect(FhirConsumer<AuditDatasetType> consumer, FhirProvider resourceProvider)
Disconnects the URL specified on the endpoint from the specified processor.protected abstract FhirEndpoint<?,?>
doCreateEndpoint(String uri, FhirEndpointConfiguration<AuditDatasetType> config)
Returns a new endpoint instanceList<Interceptor<?>>
getAdditionalConsumerInterceptors()
Returns a list of component-specific (i.e.List<Interceptor<?>>
getAdditionalProducerInterceptors()
Returns a list of component-specific (i.e.AuditStrategy<AuditDatasetType>
getClientAuditStrategy()
Returns client-side audit strategy instance.FhirTransactionConfiguration<AuditDatasetType>
getFhirTransactionConfiguration()
FhirInteractionId<AuditDatasetType>
getInteractionId()
AuditStrategy<AuditDatasetType>
getServerAuditStrategy()
Returns server-side audit strategy instance.FhirContext
initializeFhirContext()
Initializes a default FHIR context for this component.boolean
isCompatibleContext(FhirContext fhirContext)
void
setFhirInteractionId(FhirInteractionId<AuditDatasetType> fhirInteractionId)
Sets the FHIR interactionID.-
Methods inherited from class org.apache.camel.support.DefaultComponent
afterConfiguration, createEndpoint, createEndpoint, doBuild, doInit, doStart, doStop, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, setProperties, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
-
Methods inherited from interface org.apache.camel.Component
createEndpoint, createEndpoint, getComponentPropertyConfigurer, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, useRawUri
-
-
-
-
Constructor Detail
-
FhirComponent
public FhirComponent(FhirInteractionId<AuditDatasetType> fhirInteractionId)
-
FhirComponent
public FhirComponent(org.apache.camel.CamelContext context, FhirInteractionId<AuditDatasetType> fhirInteractionId)
-
-
Method Detail
-
connect
public void connect(FhirConsumer<AuditDatasetType> consumer, FhirProvider resourceProvider)
Connects the URL specified on the endpoint to the specified processor.- Parameters:
consumer
- the consumerresourceProvider
- the resource provider
-
disconnect
public void disconnect(FhirConsumer<AuditDatasetType> consumer, FhirProvider resourceProvider) throws Exception
Disconnects the URL specified on the endpoint from the specified processor.- Parameters:
consumer
- the consumer- Throws:
Exception
- can be thrown
-
initializeFhirContext
public FhirContext initializeFhirContext()
Initializes a default FHIR context for this component. ONly called if the endpoint does not define its own.- Returns:
- initialized default FHIR context
-
isCompatibleContext
public boolean isCompatibleContext(FhirContext fhirContext)
-
createConfig
protected FhirEndpointConfiguration<AuditDatasetType> createConfig(String remaining, Map<String,Object> parameters) throws Exception
- Throws:
Exception
-
createEndpoint
protected org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
- Specified by:
createEndpoint
in classorg.apache.camel.support.DefaultComponent
- Throws:
Exception
-
getAdditionalConsumerInterceptors
public List<Interceptor<?>> getAdditionalConsumerInterceptors()
Description copied from interface:InterceptableComponent
Returns a list of component-specific (i.e. transaction-specific) interceptors which will be integrated into the interceptor chain of each consumer instance created by this component. Per default returns an empty list.
When overwriting this method, please note:- Neither the returned list nor any element of it
are allowed to be
null
. - Each invocation should return freshly created instances of interceptors (like prototype-scope beans in Spring), because interceptors cannot be reused by multiple endpoints.
- Specified by:
getAdditionalConsumerInterceptors
in interfaceInterceptableComponent
- Returns:
- a list of component-specific (i.e. transaction-specific) FHIR interceptors
- Neither the returned list nor any element of it
are allowed to be
-
getAdditionalProducerInterceptors
public List<Interceptor<?>> getAdditionalProducerInterceptors()
Description copied from interface:InterceptableComponent
Returns a list of component-specific (i.e. transaction-specific) FHIR interceptors which will be integrated into the interceptor chain of each producer instance created by this component. Per default returns an empty list.
When overwriting this method, please note:- Neither the returned list nor any element of it
are allowed to be
null
. - Each invocation should return freshly created instances of interceptors (like prototype-scope beans in Spring), because interceptors cannot be reused by multiple endpoints.
- Specified by:
getAdditionalProducerInterceptors
in interfaceInterceptableComponent
- Returns:
- a list of component-specific (i.e. transaction-specific) FHIR interceptors
- Neither the returned list nor any element of it
are allowed to be
-
doCreateEndpoint
protected abstract FhirEndpoint<?,?> doCreateEndpoint(String uri, FhirEndpointConfiguration<AuditDatasetType> config)
Returns a new endpoint instance- Parameters:
uri
- the endpoint URIconfig
- FhirEndpointConfiguration- Returns:
- a new endpoint instance
-
getFhirTransactionConfiguration
public FhirTransactionConfiguration<AuditDatasetType> getFhirTransactionConfiguration()
- Returns:
- component-specific configuration
-
getServerAuditStrategy
public AuditStrategy<AuditDatasetType> getServerAuditStrategy()
Description copied from interface:AuditableComponent
Returns server-side audit strategy instance.- Specified by:
getServerAuditStrategy
in interfaceAuditableComponent<AuditDatasetType extends FhirAuditDataset>
- Returns:
- server-side audit strategy instance
-
getClientAuditStrategy
public AuditStrategy<AuditDatasetType> getClientAuditStrategy()
Description copied from interface:AuditableComponent
Returns client-side audit strategy instance.- Specified by:
getClientAuditStrategy
in interfaceAuditableComponent<AuditDatasetType extends FhirAuditDataset>
- Returns:
- client-side audit strategy instance
-
getInteractionId
public FhirInteractionId<AuditDatasetType> getInteractionId()
-
setFhirInteractionId
public void setFhirInteractionId(FhirInteractionId<AuditDatasetType> fhirInteractionId)
Sets the FHIR interactionID.- Parameters:
fhirInteractionId
- interactionID
-
-