Class LazyBundleProvider

java.lang.Object
org.openehealth.ipf.commons.ihe.fhir.AbstractBundleProvider
org.openehealth.ipf.commons.ihe.fhir.LazyBundleProvider
All Implemented Interfaces:
IBundleProvider

public class LazyBundleProvider extends AbstractBundleProvider
Bundle provider that requests information from the RequestConsumer on request:
  • If only the size of the result set is requested, the request will contain an additional empty message header named Constants.FHIR_REQUEST_SIZE_ONLY, and the response is expected to populate this header with the result size as integer value. The size is cached for further attempts to request the size
  • If a subset of the result is requested, the request will contain in addition the lower and upper index in the message headers Constants.FHIR_FROM_INDEX and Constants.FHIR_TO_INDEX, respectively. The response is expected to contain this result subset.

Note: instances of this class is neither thread-safe nor can they be reused across requests

  • Constructor Details

    • LazyBundleProvider

      public LazyBundleProvider(RequestConsumer consumer, boolean cacheResults, Object payload, Map<String,Object> headers)
      Initializes a lazy bundle provider
      Parameters:
      consumer - FHIR consumer that uses ths provider
      cacheResults - cache results. So far, only the result set size is cached
      payload - incoming payload
      headers - incoming headers
    • LazyBundleProvider

      public LazyBundleProvider(RequestConsumer consumer, boolean cacheResults, boolean sort, Object payload, Map<String,Object> headers)
      Initializes a lazy bundle provider
      Parameters:
      consumer - FHIR consumer that uses ths provider
      cacheResults - cache results. So far, only the result set size is cached
      sort - sort results
      payload - incoming payload
      headers - incoming headers
  • Method Details