Class TransactionWrappingFinder<T>
- java.lang.Object
-
- com.atlassian.confluence.plugins.contentproperty.TransactionWrappingFinder<T>
-
- All Implemented Interfaces:
ManyFetcher<T>
,SingleFetcher<T>
public abstract class TransactionWrappingFinder<T> extends Object implements SingleFetcher<T>, ManyFetcher<T>
Wraps all theSingleFetcher
andManyFetcher
methods in a transaction template, so that we ensure all results are returned in (at least) the same read only transaction.
-
-
Constructor Summary
Constructors Constructor Description TransactionWrappingFinder(SingleFetcher<T> singleFetcherDelegate, ManyFetcher<T> manyFetcherDelegate, TransactionalHostContextAccessor hostContextAccessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <TYPE> TYPE
executeReadOnly(ThrowingTransactionCallback<TYPE,NotFoundException> callback)
Optional<T>
fetch()
PageResponse<T>
fetchMany(PageRequest request)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.api.service.finder.SingleFetcher
fetchOne, fetchOneOrNull, fetchOrNull
-
-
-
-
Constructor Detail
-
TransactionWrappingFinder
public TransactionWrappingFinder(SingleFetcher<T> singleFetcherDelegate, ManyFetcher<T> manyFetcherDelegate, TransactionalHostContextAccessor hostContextAccessor)
-
-
Method Detail
-
fetchMany
public PageResponse<T> fetchMany(PageRequest request) throws NotFoundException
- Specified by:
fetchMany
in interfaceManyFetcher<T>
- Parameters:
request
- - a pageRequest to use to paginate the response, this will be limited if it exceeds system limits- Returns:
- a pageResponse of given type that matches the given restrictions
- Throws:
NotFoundException
-
executeReadOnly
protected <TYPE> TYPE executeReadOnly(ThrowingTransactionCallback<TYPE,NotFoundException> callback) throws NotFoundException
- Throws:
NotFoundException
-
fetch
public Optional<T> fetch()
- Specified by:
fetch
in interfaceSingleFetcher<T>
-
-