public class OffsetPagingProvider extends RestPagingProvider
RestPagingProvider for APIs which do paging based on an offset query param.defaultMediaType, expressionLanguage, responseTimeout| Constructor and Description |
|---|
OffsetPagingProvider(String offsetParamName,
int initialOffset,
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,
HttpResponseAttributes httpResponseAttributes)
Invoked each time a page is obtained.
|
close, doClose, evaluate, getPage, getTotalResults, stopPagingpublic OffsetPagingProvider(String offsetParamName, int initialOffset, 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)
offsetParamName - the name of the query param that carries the offset valueinitialOffset - the initial offset to apply on 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 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, HttpResponseAttributes httpResponseAttributes)
RestPagingProvideronPage in class RestPagingProviderpage - the obtained pageCopyright © 2021. All rights reserved.