Class RssDetectionServiceImpl

java.lang.Object
com.atlassian.bamboo.configuration.external.RssDetectionServiceImpl
All Implemented Interfaces:
RssDetectionService

public class RssDetectionServiceImpl extends Object implements RssDetectionService
  • Constructor Details

  • Method Details

    • postConstruct

      @PostConstruct public void postConstruct()
    • enqueue

      @NotNull public @NotNull Future<Boolean> enqueue(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch)
      Description copied from interface: RssDetectionService
      Enqueue RSS detection for repository with the given ID and branch. Only IDs of linked repositories with Specs scanning enabled may trigger Specs execution. Uses DefaultSpecsConsumer to import Specs execution results.
      Specified by:
      enqueue in interface RssDetectionService
      Parameters:
      repositoryId - ID of the linked repository
      vcsBranch - branch of the repository
      Returns:
      future result of the RSS detection, yielding true if Bamboo Specs have been run
    • enqueue

      @NotNull public @NotNull Future<Boolean> enqueue(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch, boolean force)
      Description copied from interface: RssDetectionService
      Enqueue RSS detection for repository with the given ID and branch. Only IDs of linked repositories with Specs scanning enabled may trigger Specs execution. Uses DefaultSpecsConsumer to import Specs execution results.
      Specified by:
      enqueue in interface RssDetectionService
      Parameters:
      repositoryId - ID of the linked repository
      vcsBranch - branch of the repository
      force - if true, specs import is executed even if no new commits are found in the repository
      Returns:
      future result of the RSS detection, yielding true if Bamboo Specs have been run
    • enqueue

      @NotNull public @NotNull Future<Boolean> enqueue(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch, boolean force, @NotNull @NotNull SpecsConsumer specsConsumer)
      Description copied from interface: RssDetectionService
      Enqueue RSS detection for repository with the given ID and given branch. Only IDs of linked repositories with Specs scanning enabled may trigger Specs execution. Uses provided specsConsumer to import Specs execution results.
      Specified by:
      enqueue in interface RssDetectionService
      Parameters:
      repositoryId - ID of the linked repository
      vcsBranch - optional VCS branch to checkout
      force - if true, specs import is executed even if no new commits are found in the repository
      specsConsumer - strategy used to import Specs execution results (plans, deployments, etc)
      Returns:
      future result of the RSS detection, yielding true if Bamboo Specs have been run
    • isInProgress

      public boolean isInProgress(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch)
      Specified by:
      isInProgress in interface RssDetectionService
      Returns:
      true if specs scanning for given repository and branch is currently queued or in progress.
    • cleanUnfinishedSpecsAndInitService

      public void cleanUnfinishedSpecsAndInitService()
      Description copied from interface: RssDetectionService
      Init the service and clean up any stale scan states after Bamboo restart.
      Specified by:
      cleanUnfinishedSpecsAndInitService in interface RssDetectionService
    • getEnqueuedBranchesForRepository

      @NotNull public @NotNull List<String> getEnqueuedBranchesForRepository(long repositoryId)
      Description copied from interface: RssDetectionService
      Returns list of branches that are currently enqueued (i.e. are in queue or already in progress) for RSS execution.
      Specified by:
      getEnqueuedBranchesForRepository in interface RssDetectionService
      Parameters:
      repositoryId - ID of the linked repository
      Returns:
      list of enqueued branches names
    • shutdown

      @NotNull public @NotNull Future<Boolean> shutdown()
      Description copied from interface: RssDetectionService
      Shut down the RSS detection service and the underlying thread pool.
      Specified by:
      shutdown in interface RssDetectionService
      Returns:
      future result of the shutdown, yielding true after the shutdown is finished
    • canEnqueue

      @NotNull public @NotNull ErrorCollection canEnqueue(long repositoryId)
      Description copied from interface: RssDetectionService
      Checks whether Bamboo can enqueue RSS detection for the given repository. If Specs can't be executed, returns an error collection containing all the reasons why. If they can, returns an empty error collection.

      This method will not attempt to connect to the repository. It will only validate repository's configuration and global Bamboo settings.

      Specified by:
      canEnqueue in interface RssDetectionService
      Parameters:
      repositoryId - ID of the repository
      Returns:
      collection containing reasons why triggering Specs can't be performed, empty if Specs can be enqueued
    • canEnqueue

      @NotNull public @NotNull ErrorCollection canEnqueue(@NotNull @NotNull VcsRepositoryData vcsRepositoryData)
      Description copied from interface: RssDetectionService
      Checks whether Bamboo can enqueue RSS detection for the given repository. If Specs can't be executed, returns an error collection containing all the reasons why. If they can, returns an empty error collection.

      This method will not attempt to connect to the repository. It will only validate repository's configuration and global Bamboo settings.

      Specified by:
      canEnqueue in interface RssDetectionService
      Parameters:
      vcsRepositoryData - repository to check
      Returns:
      collection containing reasons why triggering Specs can't be performed, empty if Specs can be enqueued
    • runRssDetection

      public boolean runRssDetection(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch, boolean forced, @NotNull @NotNull SpecsConsumer specsConsumer) throws IOException, RepositoryException
      Runs Repository-stored Specs detection for the given repository. Returns true if Bamboo Specs have been executed.
      Throws:
      IOException
      RepositoryException
    • reportFailedSpecsScan

      public void reportFailedSpecsScan(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch, @NotNull @NotNull String errorMessage, boolean specsNotFound)