Class RepositoryReadOnlyChecker

java.lang.Object
sonia.scm.repository.RepositoryReadOnlyChecker

public final class RepositoryReadOnlyChecker extends Object
Checks, whether a repository has to be considered read only. Currently, this includes RepositoryArchivedCheck and RepositoryExportingCheck.
Since:
2.14.0
  • 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.
      use setReadOnlyChecks(Collection) instead
      Constructs a new read only checker.
  • Method Details

    • isReadOnly

      public boolean isReadOnly(Repository repository)
      Checks if the repository is read only.
      Parameters:
      repository - The repository to check.
      Returns:
      true if any check locks the repository to read only access.
    • isReadOnly

      public boolean isReadOnly(String repositoryId)
      Checks if the repository for the given id is read only.
      Parameters:
      repositoryId - The id of the given repository to check.
      Returns:
      true if any check locks the repository to read only access.
    • checkReadOnly

      public static void checkReadOnly(Repository repository)
      Checks if the repository may be modified.
      Throws:
      ReadOnlyException - if the repository is marked as read only