public class RssDetectionQueue extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RssDetectionQueue.RssDetectionWorkKey
Key of a single work unit used for avoiding redundant RSS detections per repository and branch
|
Constructor and Description |
---|
RssDetectionQueue() |
Modifier and Type | Method and Description |
---|---|
RssDetectionWork |
enqueue(long repositoryId,
@NotNull VcsBranch vcsBranch,
boolean force,
@NotNull SpecsConsumer specsConsumer)
Enqueue work for a repository with the given Id and optional branch.
|
RssDetectionWork |
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 |
isShuttingDown()
Yields true if the RSS detection service is currently shutting down.
|
void |
markDone(@NotNull RssDetectionWork detectionWork)
Marks given work unit as finished.
|
Set<RssDetectionQueue.RssDetectionWorkKey> |
peekAllQueued()
Returns all work from this queue, i.e.
|
List<RssDetectionWork> |
peekRemaining()
Returns all the remaining work from this queue.
|
List<RssDetectionWork> |
shutdown()
Registers shutdown of the RSS detection service and all the worker threads.
|
public RssDetectionWork enqueue(long repositoryId, @NotNull @NotNull VcsBranch vcsBranch, boolean force, @NotNull @NotNull SpecsConsumer specsConsumer)
RssDetectionWork
for future
result reference.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 resultspublic boolean hasNext()
public RssDetectionWork getNext()
Callee of this method becomes responsible for calling markDone(RssDetectionWork)
once the work unit is
completed or cancelled.
public List<RssDetectionWork> peekRemaining()
public Set<RssDetectionQueue.RssDetectionWorkKey> peekAllQueued()
public void markDone(@NotNull @NotNull RssDetectionWork detectionWork)
public List<RssDetectionWork> shutdown()
The RssDetectionWork
entities are returned without any modifications. It's the callee's responsibility to
update their state.
public boolean isShuttingDown()
public boolean isInProgress(long vcsRepositoryId, @NotNull @NotNull VcsBranch vcsBranch)
Copyright © 2023 Atlassian Software Systems Pty Ltd. All rights reserved.