Class AbstractPlainProvider
java.lang.Object
org.openehealth.ipf.commons.ihe.fhir.FhirProvider
org.openehealth.ipf.commons.ihe.fhir.AbstractPlainProvider
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractResourceProvider
,Iti66DocumentManifestResourceProvider
,Iti66ListResourceProvider
,Iti66StrictResourceProvider
,Iti67ResourceProvider
,Iti67StrictResourceProvider
,Iti68BinaryResourceProvider
,Iti78ResourceProvider
,Iti81ResourceProvider
,Iti83ResourceProvider
,Pharm5ResourceProvider
Abstract plain provider that allows subclasses to forward the received payload into the
Camel route served by the consumer. Note that this can be subclassed for writing so-called
plain providers, while resource-specific providers should extend from
AbstractResourceProvider
.
Providers that inherit from this class may only be connected to one consumer.- Since:
- 3.1
- Author:
- Christian Ohr
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected FhirContext
protected Optional<RequestConsumer>
getRequestConsumer
(RequestDetails requestDetails) Returns the first consumer that is able to handle the provided payloadprotected final MethodOutcome
requestAction
(Object payload, FhirSearchParameters parameters, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, RequestDetails requestDetails) Submits a resource to be created or updatedprotected final <R extends IBaseResource>
List<R>requestBundle
(Object payload, FhirSearchParameters parameters, String resourceType, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, RequestDetails requestDetails) Requests a list of resources with parametersprotected final IBundleProvider
requestBundleProvider
(Object payload, FhirSearchParameters searchParameters, String resourceType, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, RequestDetails requestDetails) Requests aIBundleProvider
that takes over the responsibility to fetch requested bundles.protected final <R extends IBaseResource>
RrequestResource
(Object payload, FhirSearchParameters parameters, Class<R> resultType, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, RequestDetails requestDetails) Requests a single resource with parametersvoid
setConsumer
(RequestConsumer consumer) Ensures that the provided consumer is considered by this providervoid
unsetConsumer
(RequestConsumer consumer) Ensures that the provided consumer is not considered by this providerMethods inherited from class org.openehealth.ipf.commons.ihe.fhir.FhirProvider
enrichParameters, requiresDeregistration, requiresRegistration
-
Constructor Details
-
AbstractPlainProvider
public AbstractPlainProvider()
-
-
Method Details
-
getFhirContext
- Specified by:
getFhirContext
in classFhirProvider
- Returns:
- FhirContext
-
getRequestConsumer
Description copied from class:FhirProvider
Returns the first consumer that is able to handle the provided payload- Specified by:
getRequestConsumer
in classFhirProvider
- Parameters:
requestDetails
- FHIR request- Returns:
- consumer or
Optional.empty()
-
setConsumer
Description copied from class:FhirProvider
Ensures that the provided consumer is considered by this provider- Specified by:
setConsumer
in classFhirProvider
- Parameters:
consumer
- request consumer
-
unsetConsumer
Description copied from class:FhirProvider
Ensures that the provided consumer is not considered by this provider- Specified by:
unsetConsumer
in classFhirProvider
- Parameters:
consumer
- request consumer
-
requestResource
protected final <R extends IBaseResource> R requestResource(Object payload, FhirSearchParameters parameters, Class<R> resultType, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, RequestDetails requestDetails) Requests a single resource with parameters- Type Parameters:
R
- Result type- Parameters:
payload
- FHIR request resource (often null)parameters
- FHIR parametersresultType
- expected result typehttpServletRequest
- servlet requesthttpServletResponse
- servlet responserequestDetails
- request details- Returns:
- result of processing
-
requestBundle
protected final <R extends IBaseResource> List<R> requestBundle(Object payload, FhirSearchParameters parameters, String resourceType, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, RequestDetails requestDetails) Requests a list of resources with parameters- Type Parameters:
R
- Result type- Parameters:
payload
- FHIR request resource (often null)parameters
- FHIR search parametersresourceType
- FHIR resource type being searchedhttpServletRequest
- servlet requesthttpServletResponse
- servlet responserequestDetails
- request details- Returns:
- result of processing
-
requestBundleProvider
protected final IBundleProvider requestBundleProvider(Object payload, FhirSearchParameters searchParameters, String resourceType, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, RequestDetails requestDetails) Requests aIBundleProvider
that takes over the responsibility to fetch requested bundles. The type of the returnedIBundleProvider
instance is determined by theRequestConsumer
impelmentation.- Parameters:
payload
- FHIR request resource (often null)searchParameters
- FHIR search parametersresourceType
- FHIR resource typehttpServletRequest
- servlet requesthttpServletResponse
- servlet responserequestDetails
- request details- Returns:
- IBundleProvider
-
requestAction
protected final MethodOutcome requestAction(Object payload, FhirSearchParameters parameters, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, RequestDetails requestDetails) Submits a resource to be created or updated- Parameters:
payload
- resource payloadparameters
- parametershttpServletRequest
- servlet requesthttpServletResponse
- servlet response- Returns:
- result of processing
-