C
- connection type expected to handle the operations.T
- the type of the returned pages.public interface PagingProvider<C,T>
Instances should not be reused. Each execution of a paging operation should return different instances.
Implementing this interface does not guarantee thread safeness.
Modifier and Type | Method and Description |
---|---|
void |
close(C connection)
Closes
this provider and all resources allocated by it, both local and remote. |
List<T> |
getPage(C connection)
Returns the next page of items.
|
Optional<Integer> |
getTotalResults(C connection)
returns the total amount of items in the non-paged result set.
|
default boolean |
useStickyConnections()
Some systems require the same connection that obtained the first page to be used to fetch
the subsequent ones.
|
List<T> getPage(C connection)
List
then it means no more items are availableOptional<Integer> getTotalResults(C connection)
Optional.empty()
value is returned.connection
- The connection to be used to do the query.default boolean useStickyConnections()
getPage(Object)
method.
Keep in mind that if the operation is participating in a transaction, then the connection will become sticky no matter what this method says.
This method is optional and defaults to false
void close(C connection) throws MuleException
this
provider and all resources allocated by it, both local and remote.
This method should not try to also close the connection
, the runtime will do that when
appropriate.connection
- The connection to be used in order to correctly close the PagingProvider
.MuleException
- if there was an error closing the resourcesCopyright © 2018. All rights reserved.