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 Details

    • DefaultRepositoryExportingCheck

      public DefaultRepositoryExportingCheck()
  • Method Details

    • isRepositoryExporting

      public static boolean isRepositoryExporting(String repositoryId)
    • isExporting

      public boolean isExporting(String repositoryId)
      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 interface RepositoryExportingCheck
      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

      public <T> T withExportingLock(Repository repository, Supplier<T> callback)
      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 interface RepositoryExportingCheck
      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.