public class OffsetPagingStrategy extends Object implements PagingStrategy
RestPagingProvider for APIs which do paging based on an offset query param.| Constructor and Description |
|---|
OffsetPagingStrategy(String offsetParamName,
int initialOffset)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
org.mule.runtime.http.api.domain.message.request.HttpRequestBuilder |
configureRequest(String baseUri,
org.mule.runtime.http.api.domain.message.request.HttpRequestBuilder requestBuilder,
RestPagingProvider.PagingContext context)
Depending on the paging strategy, different parameters or headers may need to be passed.
|
void |
onPage(List<org.mule.runtime.api.metadata.TypedValue<String>> page,
org.mule.runtime.api.metadata.TypedValue<String> rawPage,
org.mule.runtime.api.util.MultiMap<String,String> headers,
RestPagingProvider.PagingContext context)
Invoked each time a page is obtained.
|
public OffsetPagingStrategy(String offsetParamName, int initialOffset)
offsetParamName - the name of the query param that carries the offset valueinitialOffset - the initial offset to apply on the first requestpublic final org.mule.runtime.http.api.domain.message.request.HttpRequestBuilder configureRequest(String baseUri, org.mule.runtime.http.api.domain.message.request.HttpRequestBuilder requestBuilder, RestPagingProvider.PagingContext context)
PagingStrategyconfigureRequest in interface PagingStrategybaseUri - the base uri of the REST API being consumed.requestBuilder - a HttpRequestBuilder.context - the pagination context to allow stopping the pagination mechanism.HttpRequestBuilder configured or a new one.public final void onPage(List<org.mule.runtime.api.metadata.TypedValue<String>> page, org.mule.runtime.api.metadata.TypedValue<String> rawPage, org.mule.runtime.api.util.MultiMap<String,String> headers, RestPagingProvider.PagingContext context)
PagingStrategyonPage in interface PagingStrategypage - the obtained pagecontext - the pagination context to allow stopping the pagination mechanism.Copyright © 2022. All rights reserved.