Package sonia.scm.repository
Class DefaultRepositoryExportingCheck
java.lang.Object
sonia.scm.repository.DefaultRepositoryExportingCheck
- All Implemented Interfaces:
ReadOnlyCheck
,RepositoryExportingCheck
@Extension
public final class DefaultRepositoryExportingCheck
extends Object
implements RepositoryExportingCheck
Default implementation of
RepositoryExportingCheck
. This tracks the exporting status of repositories.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isExporting
(String repositoryId) Checks whether the repository with the given id is currently (that is, at this moment) being exported or not.static boolean
isRepositoryExporting
(String repositoryId) <T> T
withExportingLock
(Repository repository, Supplier<T> callback) Asserts that the given repository is marked as being exported during the execution of the given callback.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface sonia.scm.repository.ReadOnlyCheck
check, isForbidden, isReadOnly, isReadOnly
Methods inherited from interface sonia.scm.repository.RepositoryExportingCheck
check, getReason, isExporting, isReadOnly
-
Constructor Details
-
DefaultRepositoryExportingCheck
public DefaultRepositoryExportingCheck()
-
-
Method Details
-
isRepositoryExporting
-
isExporting
Description copied from interface:RepositoryExportingCheck
Checks whether the repository with the given id is currently (that is, at this moment) being exported or not.- Specified by:
isExporting
in interfaceRepositoryExportingCheck
- Parameters:
repositoryId
- The id of the repository to check.- Returns:
true
when the repository with the given id is currently being exported,false
otherwise.
-
withExportingLock
Description copied from interface:RepositoryExportingCheck
Asserts that the given repository is marked as being exported during the execution of the given callback.- Specified by:
withExportingLock
in interfaceRepositoryExportingCheck
- Type Parameters:
T
- The return type of the callback.- Parameters:
repository
- The repository that will be marked as being exported.callback
- This callback will be executed.- Returns:
- The result of the callback.
-