public class MarkerPagingProvider extends RestPagingProvider
RestPagingProvider for APIs which do paging based on a marker provided in the response of each
request, acting as a marker or position inside the stream of results.
Request number 1 will obtain the first page plus a marker embedded in the response. Said marker will be added as a query param in request number 2, which will reply with the next page and a new marker which overwrites the prior one. The process continues until no new marker is provided or the next page comes back empty.
defaultMediaType, expressionLanguage, responseTimeout| Constructor and Description |
|---|
MarkerPagingProvider(String markerParamName,
String nextMarkerExpression,
Function<RestConnection,RestRequestBuilder> requestFactory,
org.mule.runtime.api.el.ExpressionLanguage expressionLanguage,
org.mule.runtime.extension.api.runtime.streaming.StreamingHelper streamingHelper,
String payloadExpression,
org.mule.runtime.api.metadata.MediaType defaultMediaType,
int responseTimeout)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureRequest(RestRequestBuilder requestBuilder)
Depending on the paging strategy, different parameters or headers may need to be passed.
|
protected void |
onPage(List<org.mule.runtime.api.metadata.TypedValue<String>> page,
org.mule.runtime.api.metadata.TypedValue<String> rawPage)
Invoked each time a page is obtained.
|
close, doClose, evaluate, getPage, getTotalResults, stopPagingpublic MarkerPagingProvider(String markerParamName, String nextMarkerExpression, Function<RestConnection,RestRequestBuilder> requestFactory, org.mule.runtime.api.el.ExpressionLanguage expressionLanguage, org.mule.runtime.extension.api.runtime.streaming.StreamingHelper streamingHelper, String payloadExpression, org.mule.runtime.api.metadata.MediaType defaultMediaType, int responseTimeout)
markerParamName - the name of the query parameter in which the marker is placed in the requestnextMarkerExpression - the DW expression used to extract the next marker from the responserequestFactory - a Function to generate the request to be used on each page request. Each invocation should yield a different instanceexpressionLanguage - the app's ExpressionLanguagestreamingHelper - the StreamingHelper associated to the executing operationpayloadExpression - a DW expression to extract the data from the responsedefaultMediaType - the MediaType for the page items if the server doesn't specify oneresponseTimeout - the timeout for each requestprotected void configureRequest(RestRequestBuilder requestBuilder)
RestPagingProviderRestPagingProvider.requestFactory in order to configure the custom parameters that apply/configureRequest in class RestPagingProviderrequestBuilder - a RestRequestBuilderprotected void onPage(List<org.mule.runtime.api.metadata.TypedValue<String>> page, org.mule.runtime.api.metadata.TypedValue<String> rawPage)
RestPagingProvideronPage in class RestPagingProviderpage - the obtained pageCopyright © 2019. All rights reserved.