public class PageNumberPagingProvider extends RestPagingProvider
RestPagingProvider for APIs which do paging based on requesting individual pages by numberencoding, expressionLanguage, mediaType, responseTimeout| Constructor and Description |
|---|
PageNumberPagingProvider(String pageNumberParamName,
int initialPageNumber,
Function<RestConnection,org.mule.runtime.http.api.domain.message.request.HttpRequestBuilder> 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 mediaType,
String encoding,
int responseTimeout)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureRequest(org.mule.runtime.http.api.domain.message.request.HttpRequestBuilder 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,
String rawPage)
Invoked each time a page is obtained.
|
close, doClose, evaluate, getPage, getTotalResults, stopPagingpublic PageNumberPagingProvider(String pageNumberParamName, int initialPageNumber, Function<RestConnection,org.mule.runtime.http.api.domain.message.request.HttpRequestBuilder> 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 mediaType, String encoding, int responseTimeout)
pageNumberParamName - the name of the query param that carries the page number valueinitialPageNumber - the initial page to get in the first requestrequestFactory - 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 responsemediaType - the MediaType for the page itemsencoding - the encoding for the page itemsresponseTimeout - the timeout for each requestprotected void configureRequest(org.mule.runtime.http.api.domain.message.request.HttpRequestBuilder requestBuilder)
RestPagingProviderRestPagingProvider.requestFactory in order to configure the custom parameters that apply/configureRequest in class RestPagingProviderrequestBuilder - a HttpRequestBuilderprotected void onPage(List<org.mule.runtime.api.metadata.TypedValue<String>> page, String rawPage)
RestPagingProvideronPage in class RestPagingProviderpage - the obtained pageCopyright © 2019. All rights reserved.