public class RestPagingDataWeaveProvider<C extends RestConnection> extends RestPagingProvider<C>
RestPagingProvider which uses DataWeave to extract the payload and create the list of pages.
Type parameters: RestConnection
RestPagingProvider.PagingContext| Constructor and Description |
|---|
RestPagingDataWeaveProvider(Function<C,org.mule.runtime.http.api.domain.message.request.HttpRequestBuilder> requestFactory,
org.mule.runtime.api.metadata.MediaType defaultResponseMediaType,
PagingStrategy pagingStrategy,
org.mule.runtime.api.el.ExpressionLanguage expressionLanguage,
String pageItemsExtractorExpression)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
protected List<org.mule.runtime.api.metadata.TypedValue<String>> |
extractPageItems(org.mule.runtime.api.metadata.TypedValue<String> content)
Given the raw content response body this method will extract the payload data as a list of items which represent a page.
|
protected org.mule.runtime.api.metadata.TypedValue<String> |
toRawPage(InputStream content,
org.mule.runtime.api.metadata.MediaType mediaType)
Given the server response this method will consume the response from the content
InputStream with the given
MediaType, which may or may not contain a charset (cases like application/json should use the default encodings),
returns a TypedValue with the content as String. |
close, getPage, getTotalResults, postProcess, sendpublic RestPagingDataWeaveProvider(Function<C,org.mule.runtime.http.api.domain.message.request.HttpRequestBuilder> requestFactory, org.mule.runtime.api.metadata.MediaType defaultResponseMediaType, PagingStrategy pagingStrategy, org.mule.runtime.api.el.ExpressionLanguage expressionLanguage, String pageItemsExtractorExpression)
requestFactory - a Function to generate the request to be used on each page request. Each invocation should
yield a different instance.defaultResponseMediaType - the MediaType for the page items if the server doesn't specify one.pagingStrategy - the pagination strategy.expressionLanguage - ExpressionLanguage to evaluate the pageItemsExtractorExpression to extract the
pages content from the server's response.pageItemsExtractorExpression - a DataWeave expression to extract the response with the page data.protected org.mule.runtime.api.metadata.TypedValue<String> toRawPage(InputStream content, org.mule.runtime.api.metadata.MediaType mediaType)
RestPagingProviderInputStream with the given
MediaType, which may or may not contain a charset (cases like application/json should use the default encodings),
returns a TypedValue with the content as String.toRawPage in class RestPagingProvider<C extends RestConnection>content - the stream response from the server.mediaType - the MediaType for this content.TypedValue with the content as String.protected List<org.mule.runtime.api.metadata.TypedValue<String>> extractPageItems(org.mule.runtime.api.metadata.TypedValue<String> content)
RestPagingProviderextractPageItems in class RestPagingProvider<C extends RestConnection>content - raw content page as TypedValueList> which represents a page with items.Copyright © 2023. All rights reserved.