Package sonia.scm.repository
Class RepositoryReadOnlyChecker
java.lang.Object
sonia.scm.repository.RepositoryReadOnlyChecker
Checks, whether a repository has to be considered read only. Currently, this includes
RepositoryArchivedCheck
and RepositoryExportingCheck.- Since:
- 2.14.0
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new read only checker, which uses only static checks.RepositoryReadOnlyChecker(RepositoryArchivedCheck archivedCheck, RepositoryExportingCheck exportingCheck) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckReadOnly(Repository repository) Checks if the repository may be modified.booleanisReadOnly(String repositoryId) Checks if the repository for the given id is read only.booleanisReadOnly(Repository repository) Checks if the repository is read only.
-
Constructor Details
-
RepositoryReadOnlyChecker
@Inject public RepositoryReadOnlyChecker()Constructs a new read only checker, which uses only static checks. -
RepositoryReadOnlyChecker
@Deprecated public RepositoryReadOnlyChecker(RepositoryArchivedCheck archivedCheck, RepositoryExportingCheck exportingCheck) Deprecated.usesetReadOnlyChecks(Collection)insteadConstructs a new read only checker.
-
-
Method Details
-
isReadOnly
Checks if the repository is read only.- Parameters:
repository- The repository to check.- Returns:
trueif any check locks the repository to read only access.
-
isReadOnly
Checks if the repository for the given id is read only.- Parameters:
repositoryId- The id of the given repository to check.- Returns:
trueif any check locks the repository to read only access.
-
checkReadOnly
Checks if the repository may be modified.- Throws:
ReadOnlyException- if the repository is marked as read only
-
setReadOnlyChecks(Collection)instead