Class LazyBundleProvider
java.lang.Object
org.openehealth.ipf.commons.ihe.fhir.AbstractBundleProvider
org.openehealth.ipf.commons.ihe.fhir.LazyBundleProvider
- All Implemented Interfaces:
IBundleProvider
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
andConstants.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
-
Field Summary
Fields inherited from class org.openehealth.ipf.commons.ihe.fhir.AbstractBundleProvider
httpServletResponse
-
Constructor Summary
ConstructorDescriptionLazyBundleProvider
(RequestConsumer consumer, boolean cacheResults, boolean sort, Object payload, Map<String, Object> headers, jakarta.servlet.http.HttpServletResponse httpServletResponse) Initializes a lazy bundle providerLazyBundleProvider
(RequestConsumer consumer, boolean cacheResults, Object payload, Map<String, Object> headers, jakarta.servlet.http.HttpServletResponse httpServletResponse) Initializes a lazy bundle provider -
Method Summary
Modifier and TypeMethodDescription@NonNull List
<IBaseResource> getResources
(int fromIndex, int toIndex) size()
Methods inherited from class org.openehealth.ipf.commons.ihe.fhir.AbstractBundleProvider
getConsumer, getHeaders, getPayload, getPublished, getUuid, obtainResources, preferredPageSize, sortIfApplicable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ca.uhn.fhir.rest.api.server.IBundleProvider
getAllResourceIds, getAllResources, getCurrentPageId, getCurrentPageOffset, getCurrentPageSize, getNextPageId, getPreviousPageId, getResources, isEmpty, sizeOrThrowNpe
-
Constructor Details
-
LazyBundleProvider
public LazyBundleProvider(RequestConsumer consumer, boolean cacheResults, Object payload, Map<String, Object> headers, jakarta.servlet.http.HttpServletResponse httpServletResponse) Initializes a lazy bundle provider- Parameters:
consumer
- FHIR consumer that uses ths providercacheResults
- cache results. So far, only the result set size is cachedpayload
- incoming payloadheaders
- incoming headershttpServletResponse
- HTTP servlet response
-
LazyBundleProvider
public LazyBundleProvider(RequestConsumer consumer, boolean cacheResults, boolean sort, Object payload, Map<String, Object> headers, jakarta.servlet.http.HttpServletResponse httpServletResponse) Initializes a lazy bundle provider- Parameters:
consumer
- FHIR consumer that uses ths providercacheResults
- cache results. So far, only the result set size is cachedsort
- sort resultspayload
- incoming payloadheaders
- incoming headershttpServletResponse
- HTTP servlet response
-
-
Method Details
-
getResources
-
size
-