Class RssDetectionQueue
java.lang.Object
com.atlassian.bamboo.configuration.external.detection.RssDetectionQueue
A representation of the work queue on which RSS detection threads and RSS detection service are operating.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Key of a single work unit used for avoiding redundant RSS detections per repository and branch -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionenqueue
(long repositoryId, @NotNull VcsBranch vcsBranch, boolean force, @NotNull SpecsConsumer specsConsumer) Enqueue work for a repository with the given Id and optional branch.getNext()
Retrieves the next unit of work for the RSS detection worker thread.boolean
hasNext()
Checks if there is any unit of work available for the RSS detection worker thread.boolean
isInProgress
(long vcsRepositoryId, @NotNull VcsBranch vcsBranch) boolean
Yields true if the RSS detection service is currently shutting down.void
markDone
(@NotNull RssDetectionWork detectionWork) Marks given work unit as finished.Returns all work from this queue, i.e.Returns all the remaining work from this queue.shutdown()
Registers shutdown of the RSS detection service and all the worker threads.
-
Constructor Details
-
RssDetectionQueue
public RssDetectionQueue()
-
-
Method Details
-
enqueue
public RssDetectionWork enqueue(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch, boolean force, @NotNull @NotNull SpecsConsumer specsConsumer) Enqueue work for a repository with the given Id and optional branch. Returns an instance ofRssDetectionWork
for future result reference.- Parameters:
repositoryId
- id of the repositoryvcsBranch
- optional branch to checkout and use to run Specsforce
- should the scan be executed even if there are no new commitsspecsConsumer
- consumer used for importing Specs execution results
-
hasNext
public boolean hasNext()Checks if there is any unit of work available for the RSS detection worker thread. Filters out work units for repositories which are currently being processed. -
getNext
Retrieves the next unit of work for the RSS detection worker thread. Filters out work units for repositories which are currently being processed. Mutative operation. Throws if there's nothing available.Callee of this method becomes responsible for calling
markDone(RssDetectionWork)
once the work unit is completed or cancelled. -
peekRemaining
-
peekAllQueued
Returns all work from this queue, i.e. all remaining work as well as work in progress. Non-mutative operation. -
markDone
Marks given work unit as finished. -
shutdown
Registers shutdown of the RSS detection service and all the worker threads. Returns a list of all cancelled RSS detection work units.The
RssDetectionWork
entities are returned without any modifications. It's the callee's responsibility to update their state. -
isShuttingDown
public boolean isShuttingDown()Yields true if the RSS detection service is currently shutting down. -
isInProgress
-