public class PageNumberPagingStrategy extends Object implements PagingStrategy
PagingStrategy for APIs which do paging based on requesting individual pages by number| Constructor and Description |
|---|
PageNumberPagingStrategy(String pageNumberParamName,
int initialPageNumber)
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.
|
Integer |
extractPageCount(org.mule.runtime.api.metadata.TypedValue<String> rawPage,
org.mule.runtime.api.util.MultiMap<String,String> headers) |
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 PageNumberPagingStrategy(String pageNumberParamName, int initialPageNumber)
pageNumberParamName - the name of the query param that carries the page number valueinitialPageNumber - the initial page to get in the first requestpublic 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 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.