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 the
SingleFetcher and
ManyFetcher methods in a
transaction template, so that we ensure all results are returned in (at least) the same read only
transaction.-
Constructor Summary
ConstructorsConstructorDescriptionTransactionWrappingFinder(SingleFetcher<T> singleFetcherDelegate, ManyFetcher<T> manyFetcherDelegate, TransactionalHostContextAccessor hostContextAccessor) -
Method Summary
Modifier and TypeMethodDescriptionprotected <TYPE> TYPEexecuteReadOnly(ThrowingTransactionCallback<TYPE, NotFoundException> callback) fetch()fetchMany(PageRequest request) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.api.service.finder.SingleFetcher
fetchOneOrNull, fetchOrNull
-
Constructor Details
-
TransactionWrappingFinder
public TransactionWrappingFinder(SingleFetcher<T> singleFetcherDelegate, ManyFetcher<T> manyFetcherDelegate, TransactionalHostContextAccessor hostContextAccessor)
-
-
Method Details
-
fetchMany
- Specified by:
fetchManyin 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
- Specified by:
fetchin interfaceSingleFetcher<T>
-