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

public abstract class AbstractPlainProvider extends FhirProvider
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 Details

    • AbstractPlainProvider

      public AbstractPlainProvider()
  • Method Details

    • getFhirContext

      protected FhirContext getFhirContext()
      Specified by:
      getFhirContext in class FhirProvider
      Returns:
      FhirContext
    • getRequestConsumer

      protected Optional<RequestConsumer> getRequestConsumer(RequestDetails requestDetails)
      Description copied from class: FhirProvider
      Returns the first consumer that is able to handle the provided payload
      Specified by:
      getRequestConsumer in class FhirProvider
      Parameters:
      requestDetails - FHIR request
      Returns:
      consumer or Optional.empty()
    • setConsumer

      public void setConsumer(RequestConsumer consumer)
      Description copied from class: FhirProvider
      Ensures that the provided consumer is considered by this provider
      Specified by:
      setConsumer in class FhirProvider
      Parameters:
      consumer - request consumer
    • unsetConsumer

      public void unsetConsumer(RequestConsumer consumer)
      Description copied from class: FhirProvider
      Ensures that the provided consumer is not considered by this provider
      Specified by:
      unsetConsumer in class FhirProvider
      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 parameters
      resultType - expected result type
      httpServletRequest - servlet request
      httpServletResponse - servlet response
      requestDetails - 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 parameters
      resourceType - FHIR resource type being searched
      httpServletRequest - servlet request
      httpServletResponse - servlet response
      requestDetails - 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 a IBundleProvider that takes over the responsibility to fetch requested bundles. The type of the returned IBundleProvider instance is determined by the RequestConsumer impelmentation.
      Parameters:
      payload - FHIR request resource (often null)
      searchParameters - FHIR search parameters
      resourceType - FHIR resource type
      httpServletRequest - servlet request
      httpServletResponse - servlet response
      requestDetails - 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 payload
      parameters - parameters
      httpServletRequest - servlet request
      httpServletResponse - servlet response
      Returns:
      result of processing