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 TypeMethodDescriptionbooleanisExporting(String repositoryId) Checks whether the repository with the given id is currently (that is, at this moment) being exported or not.static booleanisRepositoryExporting(String repositoryId) <T> TwithExportingLock(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, waitMethods inherited from interface sonia.scm.repository.ReadOnlyCheck
check, isForbidden, isReadOnly, isReadOnlyMethods inherited from interface sonia.scm.repository.RepositoryExportingCheck
check, getReason, isExporting, isReadOnly
-
Constructor Details
-
DefaultRepositoryExportingCheck
public DefaultRepositoryExportingCheck()
-
-
Method Details
-
isRepositoryExporting
-
isExporting
Description copied from interface:RepositoryExportingCheckChecks whether the repository with the given id is currently (that is, at this moment) being exported or not.- Specified by:
isExportingin interfaceRepositoryExportingCheck- Parameters:
repositoryId- The id of the repository to check.- Returns:
truewhen the repository with the given id is currently being exported,falseotherwise.
-
withExportingLock
Description copied from interface:RepositoryExportingCheckAsserts that the given repository is marked as being exported during the execution of the given callback.- Specified by:
withExportingLockin 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.
-