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_INDEXandConstants.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 AbstractBundleProvider
httpServletResponse -
Constructor Summary
ConstructorsConstructorDescriptionLazyBundleProvider(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 TypeMethodDescriptionboundTo(RequestDetails requestDetails) Further pages are loaded by calling the consumer again, which must not see the servlet request and response of the original request anymore.@NonNull List<IBaseResource> getResources(int fromIndex, int toIndex) size()Methods inherited from class AbstractBundleProvider
getConsumer, getHeaders, getPayload, getPublished, getUuid, obtainResources, preferredPageSize, sortIfApplicableMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IBundleProvider
containsAllResources, getAllResourceIds, getAllResources, getCurrentPageId, getCurrentPageOffset, getCurrentPageSize, getNextPageId, getPreviousPageId, getResourceListComplete, 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
-
boundTo
Further pages are loaded by calling the consumer again, which must not see the servlet request and response of the original request anymore.- Overrides:
boundToin classAbstractBundleProvider- Parameters:
requestDetails- the request that is being processed now- Returns:
- a bundle provider bound to the request, or this instance if it does not need to be bound
-
getResources
-
size
-