Class BundleProviderWithNamedPages
- All Implemented Interfaces:
IBundleProvider
-
Constructor Summary
ConstructorDescriptionBundleProviderWithNamedPages
(List<org.hl7.fhir.instance.model.api.IBaseResource> theResultsInThisPage, String theSearchId, String thePageId, Integer theTotalResults) Constructor -
Method Summary
Modifier and TypeMethodDescriptionIf this method is implemented, provides an ID for the current page of results.If this method is implemented, provides an ID for the next page of results.If this method is implemented, provides an ID for the previous page of results.List
<org.hl7.fhir.instance.model.api.IBaseResource> getResources
(int theFromIndex, int theToIndex, ResponsePage.ResponsePageBuilder theResponsePageBuilder) Load the given collection of resources by index, plus any additional resources per the server's processing rules (e.g.setCurrentPageId
(String theCurrentPageId) setNextPageId
(String theNextPageId) setPreviousPageId
(String thePreviousPageId) Sets the total number of results, if this provider corresponds to a single page within a larger search resultMethods inherited from class ca.uhn.fhir.rest.server.SimpleBundleProvider
getCurrentPageOffset, getCurrentPageSize, getList, getPublished, getUuid, preferredPageSize, setCurrentPageOffset, setCurrentPageSize, setPreferredPageSize, setPublished, setTotalResourcesRequestedReturned, size, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ca.uhn.fhir.rest.api.server.IBundleProvider
getAllResourceIds, getAllResources, getResources, isEmpty, sizeOrThrowNpe
-
Constructor Details
-
BundleProviderWithNamedPages
public BundleProviderWithNamedPages(List<org.hl7.fhir.instance.model.api.IBaseResource> theResultsInThisPage, String theSearchId, String thePageId, Integer theTotalResults) Constructor- Parameters:
theResultsInThisPage
- The complete list of results in the current page. Must not be null.theSearchId
- The ID for the search. Note that you should also populatesetNextPageId(String)
andsetPreviousPageId(String)
if these are known. Must not benull
or blank.thePageId
- The ID for the current page. Note that you should also populatesetNextPageId(String)
andsetPreviousPageId(String)
if these are known. Must not benull
or blank.theTotalResults
- The total number of result (if this is known), ornull
- See Also:
-
-
Method Details
-
getCurrentPageId
Description copied from interface:IBundleProvider
If this method is implemented, provides an ID for the current page of results. This ID should be unique (at least within the current search as identified byIBundleProvider.getUuid()
) so that it can be used to look up a specific page of results.This can be used in order to allow the server paging mechanism to work using completely opaque links (links that do not encode any index/offset information), which can be useful on some servers.
-
setCurrentPageId
-
getNextPageId
Description copied from interface:IBundleProvider
If this method is implemented, provides an ID for the next page of results. This ID should be unique (at least within the current search as identified byIBundleProvider.getUuid()
) so that it can be used to look up a specific page of results.This can be used in order to allow the server paging mechanism to work using completely opaque links (links that do not encode any index/offset information), which can be useful on some servers.
-
setNextPageId
-
getPreviousPageId
Description copied from interface:IBundleProvider
If this method is implemented, provides an ID for the previous page of results. This ID should be unique (at least within the current search as identified byIBundleProvider.getUuid()
) so that it can be used to look up a specific page of results.This can be used in order to allow the server paging mechanism to work using completely opaque links (links that do not encode any index/offset information), which can be useful on some servers.
-
setPreviousPageId
-
getResources
@Nonnull public List<org.hl7.fhir.instance.model.api.IBaseResource> getResources(int theFromIndex, int theToIndex, @Nonnull ResponsePage.ResponsePageBuilder theResponsePageBuilder) Description copied from interface:IBundleProvider
Load the given collection of resources by index, plus any additional resources per the server's processing rules (e.g. _include'd resources, OperationOutcome, etc.). For example, if the method is invoked with index 0,10 the method might return 10 search results, plus an additional 20 resources which matched a client's _include specification.Note that if this bundle provider was loaded using a page ID (i.e. via
IPagingProvider.retrieveResultList(RequestDetails, String, String)
becauseIBundleProvider.getNextPageId()
provided a value on the previous page, then the indexes should be ignored and the whole page returned.- Specified by:
getResources
in interfaceIBundleProvider
- Overrides:
getResources
in classSimpleBundleProvider
- Parameters:
theFromIndex
- The low index (inclusive) to returntheToIndex
- The high index (exclusive) to returntheResponsePageBuilder
- The ResponsePageBuilder. The builder will add values needed for the response page.- Returns:
- A list of resources. The size of this list must be at least
theToIndex - theFromIndex
.
-
setSize
Description copied from class:SimpleBundleProvider
Sets the total number of results, if this provider corresponds to a single page within a larger search result- Overrides:
setSize
in classSimpleBundleProvider
-