Interface RssDetectionService
- All Known Implementing Classes:
RssDetectionServiceImpl
public interface RssDetectionService
Service for scheduling Repository-stored Specs detection.
-
Method Summary
Modifier and TypeMethodDescription@NotNull ErrorCollection
canEnqueue
(long repositoryId) Checks whether Bamboo can enqueue RSS detection for the given repository.@NotNull ErrorCollection
canEnqueue
(@NotNull VcsRepositoryData vcsRepositoryData) Checks whether Bamboo can enqueue RSS detection for the given repository.void
Init the service and clean up any stale scan states after Bamboo restart.Enqueue RSS detection for repository with the given ID and branch.Enqueue RSS detection for repository with the given ID and branch.enqueue
(long repositoryId, @NotNull VcsBranch vcsBranch, boolean force, @NotNull SpecsConsumer specsConsumer) Enqueue RSS detection for repository with the given ID and given branch.getEnqueuedBranchesForRepository
(long repositoryId) Returns list of branches that are currently enqueued (i.e.boolean
isInProgress
(long repositoryId, @NotNull VcsBranch vcsBranch) shutdown()
Shut down the RSS detection service and the underlying thread pool.
-
Method Details
-
canEnqueue
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.
- Parameters:
repositoryId
- ID of the repository- Returns:
- collection containing reasons why triggering Specs can't be performed, empty if Specs can be enqueued
-
canEnqueue
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.
- Parameters:
vcsRepositoryData
- repository to check- Returns:
- collection containing reasons why triggering Specs can't be performed, empty if Specs can be enqueued
-
enqueue
Enqueue RSS detection for repository with the given ID and branch. Only IDs of linked repositories with Specs scanning enabled may trigger Specs execution. UsesDefaultSpecsConsumer
to import Specs execution results.- Parameters:
repositoryId
- ID of the linked repositoryvcsBranch
- branch of the repository- Returns:
- future result of the RSS detection, yielding true if Bamboo Specs have been run
-
enqueue
@NotNull @NotNull Future<Boolean> enqueue(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch, boolean force) Enqueue RSS detection for repository with the given ID and branch. Only IDs of linked repositories with Specs scanning enabled may trigger Specs execution. UsesDefaultSpecsConsumer
to import Specs execution results.- Parameters:
repositoryId
- ID of the linked repositoryvcsBranch
- branch of the repositoryforce
- 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 @NotNull Future<Boolean> enqueue(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch, boolean force, @NotNull @NotNull SpecsConsumer specsConsumer) 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 providedspecsConsumer
to import Specs execution results.- Parameters:
repositoryId
- ID of the linked repositoryforce
- if true, specs import is executed even if no new commits are found in the repositoryvcsBranch
- optional VCS branch to checkoutspecsConsumer
- 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
-
shutdown
Shut down the RSS detection service and the underlying thread pool.- Returns:
- future result of the shutdown, yielding true after the shutdown is finished
-
isInProgress
- Returns:
- true if specs scanning for given repository and branch is currently queued or in progress.
-
cleanUnfinishedSpecsAndInitService
void cleanUnfinishedSpecsAndInitService()Init the service and clean up any stale scan states after Bamboo restart.- Since:
- 6.10
-
getEnqueuedBranchesForRepository
Returns list of branches that are currently enqueued (i.e. are in queue or already in progress) for RSS execution.- Parameters:
repositoryId
- ID of the linked repository- Returns:
- list of enqueued branches names
-