Class RssDetectionServiceImpl
java.lang.Object
com.atlassian.bamboo.configuration.external.RssDetectionServiceImpl
- All Implemented Interfaces:
RssDetectionService
-
Constructor Summary
ConstructorsConstructorDescriptionRssDetectionServiceImpl(@NotNull AdministrationConfigurationAccessor administrationConfigurationAccessor, @NotNull AuthorCreatorService authorCreatorService, @NotNull BambooSpecsManager bambooSpecsManager, @NotNull CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, @NotNull CustomVariableContext customVariableContext, @NotNull ExtendedAuthorManager extendedAuthorManager, @NotNull FeatureManager featureManager, @NotNull I18nBeanFactory i18nBeanFactory, @NotNull RepositoryStoredSpecsService repositoryStoredSpecsService, @NotNull SpecsConsumerFactory specsConsumerFactory, @NotNull VcsRepositoryManager vcsRepositoryManager) -
Method Summary
Modifier and TypeMethodDescription@NotNull ErrorCollectioncanEnqueue(long repositoryId) Checks whether Bamboo can enqueue RSS detection for the given repository.@NotNull ErrorCollectioncanEnqueue(@NotNull VcsRepositoryData vcsRepositoryData) Checks whether Bamboo can enqueue RSS detection for the given repository.voidInit 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. are in queue or already in progress) for RSS execution.booleanisInProgress(long repositoryId, @NotNull VcsBranch vcsBranch) voidvoidreportFailedSpecsScan(long repositoryId, @NotNull VcsBranch vcsBranch, @NotNull String errorMessage, boolean specsNotFound) booleanrunRssDetection(long repositoryId, @NotNull VcsBranch vcsBranch, boolean forced, @NotNull SpecsConsumer specsConsumer, @NotNull Runnable onGitCacheAccessComplete) Runs Repository-stored Specs detection for the given repository.shutdown()Shut down the RSS detection service and the underlying thread pool.
-
Constructor Details
-
RssDetectionServiceImpl
@Inject public RssDetectionServiceImpl(@NotNull @NotNull AdministrationConfigurationAccessor administrationConfigurationAccessor, @NotNull @NotNull AuthorCreatorService authorCreatorService, @NotNull @NotNull BambooSpecsManager bambooSpecsManager, @NotNull @NotNull CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, @NotNull @NotNull CustomVariableContext customVariableContext, @NotNull @NotNull ExtendedAuthorManager extendedAuthorManager, @NotNull @NotNull FeatureManager featureManager, @NotNull @NotNull I18nBeanFactory i18nBeanFactory, @NotNull @NotNull RepositoryStoredSpecsService repositoryStoredSpecsService, @NotNull @NotNull SpecsConsumerFactory specsConsumerFactory, @NotNull @NotNull VcsRepositoryManager vcsRepositoryManager)
-
-
Method Details
-
postConstruct
@PostConstruct public void postConstruct() -
enqueue
@NotNull public @NotNull Future<Boolean> enqueue(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch) Description copied from interface:RssDetectionServiceEnqueue RSS detection for repository with the given ID and branch. Only IDs of linked repositories with Specs scanning enabled may trigger Specs execution. UsesDefaultSpecsConsumerto import Specs execution results.- Specified by:
enqueuein interfaceRssDetectionService- 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 public @NotNull Future<Boolean> enqueue(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch, boolean force) Description copied from interface:RssDetectionServiceEnqueue RSS detection for repository with the given ID and branch. Only IDs of linked repositories with Specs scanning enabled may trigger Specs execution. UsesDefaultSpecsConsumerto import Specs execution results.- Specified by:
enqueuein interfaceRssDetectionService- 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 public @NotNull Future<Boolean> enqueue(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch, boolean force, @NotNull @NotNull SpecsConsumer specsConsumer) Description copied from interface:RssDetectionServiceEnqueue 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 providedspecsConsumerto import Specs execution results.- Specified by:
enqueuein interfaceRssDetectionService- Parameters:
repositoryId- ID of the linked repositoryvcsBranch- optional VCS branch to checkoutforce- if true, specs import is executed even if no new commits are found in the repositoryspecsConsumer- 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
- Specified by:
isInProgressin interfaceRssDetectionService- Returns:
- true if specs scanning for given repository and branch is currently queued or in progress.
-
cleanUnfinishedSpecsAndInitService
public void cleanUnfinishedSpecsAndInitService()Description copied from interface:RssDetectionServiceInit the service and clean up any stale scan states after Bamboo restart.- Specified by:
cleanUnfinishedSpecsAndInitServicein interfaceRssDetectionService
-
getEnqueuedBranchesForRepository
Description copied from interface:RssDetectionServiceReturns list of branches that are currently enqueued (i.e. are in queue or already in progress) for RSS execution.- Specified by:
getEnqueuedBranchesForRepositoryin interfaceRssDetectionService- Parameters:
repositoryId- ID of the linked repository- Returns:
- list of enqueued branches names
-
shutdown
Description copied from interface:RssDetectionServiceShut down the RSS detection service and the underlying thread pool.- Specified by:
shutdownin interfaceRssDetectionService- Returns:
- future result of the shutdown, yielding true after the shutdown is finished
-
canEnqueue
Description copied from interface:RssDetectionServiceChecks 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:
canEnqueuein interfaceRssDetectionService- 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:RssDetectionServiceChecks 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:
canEnqueuein interfaceRssDetectionService- 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, @NotNull @NotNull Runnable onGitCacheAccessComplete) throws IOException, RepositoryException Runs Repository-stored Specs detection for the given repository. Returns true if Bamboo Specs have been executed.- Throws:
IOExceptionRepositoryException
-
reportFailedSpecsScan
-