org.mule.streaming
Class ProviderAwarePagingDelegate<T,P>
java.lang.Object
org.mule.streaming.ProviderAwarePagingDelegate<T,P>
- Type Parameters:
T - the type of the data to be returnedP - the type of the provider generating the data
- All Implemented Interfaces:
- Closeable
public abstract class ProviderAwarePagingDelegate<T,P>
- extends Object
- implements Closeable
Similar to PagingDelegate but aware of the actual
component that provides the data being paged
|
Method Summary |
abstract List<T> |
getPage(P provider)
Returns the next page of items. |
abstract int |
getTotalResults(P provider)
returns the total amount of items in the non-paged result set. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProviderAwarePagingDelegate
public ProviderAwarePagingDelegate()
getPage
public abstract List<T> getPage(P provider)
throws Exception
- Returns the next page of items. If the return value is
null or an
empty list, then it means no more items are available
- Parameters:
provider - The provider to be used to do the query. You can assume this provider is already properly initialised
- Returns:
- a populated list of elements.
null or an empty list, then
it means no more items are available
- Throws:
Exception
getTotalResults
public abstract int getTotalResults(P provider)
throws Exception
- returns the total amount of items in the non-paged result set. In some scenarios,
it might not be possible/convenient to actually retrieve this value. -1 is
returned in such a case.
- Parameters:
provider - The provider to be used to do the query. You can assume this provider is already properly initialised
- Throws:
Exception
Copyright © 2003–2014 MuleSoft, Inc.. All rights reserved.