public class PaginationServiceImpl extends Object implements PaginationServiceInternal
Constructor and Description |
---|
PaginationServiceImpl(org.springframework.transaction.PlatformTransactionManager transactionManager,
org.hibernate.SessionFactory sessionFactory) |
Modifier and Type | Method and Description |
---|---|
<F,T> Paginated<T> |
createPaginated(PaginationBatch<F> fetchBatch,
com.google.common.base.Function<Iterable<F>,Iterable<T>> modelConverter,
int maxLimit)
Deprecated.
|
<F,T> PagingIterator<T> |
createPagingIterator(PaginationBatch<F> fetchBatch,
int resultsPerPage,
com.google.common.base.Function<Iterable<F>,Iterable<T>> modelConverter)
Deprecated.
|
<H,M> PageResponse<M> |
doPaginationListRequest(LimitedRequest initialRequest,
PaginationBatch<H> fetchPage,
com.google.common.base.Function<Iterable<H>,Iterable<M>> modelConverter)
Deprecated.
|
<H,M> PageResponse<M> |
doPaginationRequest(LimitedRequest initialRequest,
PaginationBatch<H> fetchPage,
com.google.common.base.Function<? super H,M> modelConverter)
Deprecated.
|
<H,M> PageResponse<M> |
performPaginationListRequestWithCursor(LimitedRequest initialRequest,
Function<LimitedRequest,PageResponse<H>> fetchBatch,
Function<Iterable<H>,Iterable<M>> modelConverter,
BiFunction<H,Boolean,Cursor> cursorCalculator)
Perform a pagination request, this will execute the fetchBatch function as many times as
to retrieve the page of results.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newPaginated, newPagingIterator
performPaginationListRequest, performPaginationRequest
public PaginationServiceImpl(org.springframework.transaction.PlatformTransactionManager transactionManager, org.hibernate.SessionFactory sessionFactory)
@Deprecated public <H,M> PageResponse<M> doPaginationRequest(LimitedRequest initialRequest, PaginationBatch<H> fetchPage, com.google.common.base.Function<? super H,M> modelConverter)
PaginationService.performPaginationRequest(LimitedRequest, PaginationBatch, java.util.function.Function)
PaginationService
LimitedRequest.getMaxLimit()
results
from the datasource. FetchBatch will be executed in a new transaction for each batch to prevent excessive memory usage.
It is expected that any permission checking is performed in the PaginationBatch.
The PaginationService is responsible for ensuring that enough results are returned from the PaginationBatch to fulfill the request. The PaginationBatch should not treat the pageRequest getStart and getLimit values as user specific indexes, only results the user can see should be returned. If a user does not have permission to see any results in the requested range an empty list should be returned in the response and the hasMore flag set if there are more results still to check. The pagination service will call again if more results are required.
doPaginationRequest
in interface PaginationService
initialRequest
- - a request for a range of datafetchPage
- - the function to supply the resultsmodelConverter
- - a function to convert from the supplied object to a model object, this will be executed within a transaction.@Deprecated public <H,M> PageResponse<M> doPaginationListRequest(LimitedRequest initialRequest, PaginationBatch<H> fetchPage, com.google.common.base.Function<Iterable<H>,Iterable<M>> modelConverter)
PaginationService.performPaginationListRequest(LimitedRequest, PaginationBatch, java.util.function.Function)
PaginationService
LimitedRequest.getMaxLimit()
results
from the datasource. FetchBatch will be executed in a new transaction for each batch to prevent excessive memory usage.
It is expected that any permission checking is performed in the PaginationBatch.
The PaginationService is responsible for ensuring that enough results are returned from the PaginationBatch to fulfill the request. The PaginationBatch should not treat the pageRequest getStart and getLimit values as user specific indexes, only results the user can see should be returned. If a user does not have permission to see any results in the requested range an empty list should be returned in the response and the hasMore flag set if there are more results still to check. The pagination service will call again if more results are required.
doPaginationListRequest
in interface PaginationService
initialRequest
- - a request for a range of datafetchPage
- - the function to supply the resultsmodelConverter
- - a function to convert from the supplied object to a model object, this will be executed within a transaction.public <H,M> PageResponse<M> performPaginationListRequestWithCursor(LimitedRequest initialRequest, Function<LimitedRequest,PageResponse<H>> fetchBatch, Function<Iterable<H>,Iterable<M>> modelConverter, BiFunction<H,Boolean,Cursor> cursorCalculator)
PaginationService
LimitedRequest.getMaxLimit()
results
from the datasource. FetchBatch will be executed in a new transaction for each batch to prevent excessive memory usage.
It is expected that any permission checking is performed in the PaginationBatch.
The PaginationService is responsible for ensuring that enough results are returned from the fetchBatch to fulfill the request. Only results the user can see should be returned.
performPaginationListRequestWithCursor
in interface PaginationService
initialRequest
- - a request for a range of datafetchBatch
- - the function to supply the results. Results should be sorted in order which match cursor fields ordering.modelConverter
- - a function to convert from the supplied object to a model object, this will be executed within a transaction.cursorCalculator
- - a function to calculate next cursor.@Deprecated public <F,T> PagingIterator<T> createPagingIterator(PaginationBatch<F> fetchBatch, int resultsPerPage, com.google.common.base.Function<Iterable<F>,Iterable<T>> modelConverter)
PaginationServiceInternal.newPagingIterator(PaginationBatch, int, java.util.function.Function)
PaginationServiceInternal
createPagingIterator
in interface PaginationServiceInternal
fetchBatch
- - a request for a range of dataresultsPerPage
- - number of results to request from PaginationBatch each invocation.modelConverter
- - a function to convert from the supplied object to a model object, this will be executed within a transaction.PagingIterator
@Deprecated public <F,T> Paginated<T> createPaginated(PaginationBatch<F> fetchBatch, com.google.common.base.Function<Iterable<F>,Iterable<T>> modelConverter, int maxLimit)
PaginationServiceInternal.newPaginated(PaginationBatch, java.util.function.Function, int)
PaginationServiceInternal
createPaginated
in interface PaginationServiceInternal
fetchBatch
- - a request for a range of datamodelConverter
- - a function to convert from the supplied object to a model object, this will be executed within a transaction.maxLimit
- - the max limit to apply when creating LimitedRequests for paged requests from the Paginated.Paginated
Copyright © 2003–2023 Atlassian. All rights reserved.
View cookie preferences