|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.v2.build.queue.BuildQueueManagerImpl
public class BuildQueueManagerImpl
Field Summary | |
---|---|
protected java.util.concurrent.locks.ReadWriteLock |
queueLock
|
Fields inherited from interface com.atlassian.bamboo.v2.build.queue.BuildQueueManager |
---|
DISABLE_BUILD_SYSTEM_PROPERTY |
Constructor Summary | |
---|---|
BuildQueueManagerImpl(com.atlassian.event.EventManager eventManager,
BuildExecutionManager buildExecutionManager,
PlanManager planManager,
org.springframework.jms.core.JmsTemplate jmsTemplate,
com.atlassian.plugin.PluginAccessor pluginAccessor,
ErrorUpdateHandler errorUpdateHandler,
BootstrapManager bootstrapManager,
BuildResultsSummaryManager buildResultsSummaryManager,
PlanExecutableAgentsHelper planExecutableAgentsHelper)
|
Method Summary | |
---|---|
void |
addBuildToQueue(BuildContext buildContext)
Attempts to add the build to a queue. |
java.util.List<BuildContext> |
getBuildQueue()
Returns a thread safe list of BuildContext objects representing the builds that is
in the queue |
BuildQueuePosition |
getQueuePosition(PlanResultKey planResultKey)
Returns information on position of plan result in the queue. |
boolean |
queueContains(PlanKey planKey)
Indicates whether a build of a given build plan is in the queue. |
void |
reconstructBuildQueue()
Reconstructs the build queue. |
void |
removeAllBuildsForPlanFromQueue(PlanKey planKey)
Removes all the BuildContext associated with the planKey to be removed from the queue. |
void |
removeBuildFromQueue(PlanResultKey buildResultKey)
Removes the BuildContext associated with the buildResultKey to be removed from the queue. |
void |
reorderBuildInQueue(java.lang.String planKey,
int index)
Reorders the build queue. |
boolean |
reorderBuildInQueue(java.lang.String buildResultKey,
java.lang.String prevBuildResultKey,
java.lang.String nextBuildResultKey)
Moves a given build in a queue in between two given builds. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.concurrent.locks.ReadWriteLock queueLock
Constructor Detail |
---|
public BuildQueueManagerImpl(com.atlassian.event.EventManager eventManager, BuildExecutionManager buildExecutionManager, PlanManager planManager, org.springframework.jms.core.JmsTemplate jmsTemplate, com.atlassian.plugin.PluginAccessor pluginAccessor, ErrorUpdateHandler errorUpdateHandler, BootstrapManager bootstrapManager, BuildResultsSummaryManager buildResultsSummaryManager, PlanExecutableAgentsHelper planExecutableAgentsHelper)
Method Detail |
---|
public void addBuildToQueue(@NotNull BuildContext buildContext)
BuildQueueManager
BuildQueuedEvent
is fired if queuing was successful and a
BuildRejectedFromQueueEvent
iif rejected.
A lock on the build is obtained from the BuildExecutionManager
.
addBuildToQueue
in interface BuildQueueManager
buildContext
- @NotNullpublic void removeBuildFromQueue(@NotNull PlanResultKey buildResultKey)
BuildQueueManager
BuildContext
associated with the buildResultKey to be removed from the queue.
A BuildDeQueuedEvent
is fired.
The lock on the build is not released. The caller should call BuildExecutionManager#finishProcess
to
release this lock when ready.
removeBuildFromQueue
in interface BuildQueueManager
public void removeAllBuildsForPlanFromQueue(@NotNull PlanKey planKey)
BuildQueueManager
BuildContext
associated with the planKey to be removed from the queue.
A BuildDeQueuedEvent
is fired.
The lock on the build is not released. The caller should call BuildExecutionManager#finishProcess
to
release this lock when ready.
removeAllBuildsForPlanFromQueue
in interface BuildQueueManager
public void reorderBuildInQueue(java.lang.String planKey, int index)
BuildQueueManager
BuildContext
associated with the planKey is moved to new position in the queue
indicated by the zero-based index parameter. If index is < 0 or >= size of queue then BuildContext
is positioned at the beginning or at the end of the queue respectively.
reorderBuildInQueue
in interface BuildQueueManager
planKey
- Plan key of the build that shall be repositioned in the queue.index
- New position of a BuildContext
associated with the planKey in the queue.public boolean reorderBuildInQueue(@NotNull java.lang.String buildResultKey, @Nullable java.lang.String prevBuildResultKey, @Nullable java.lang.String nextBuildResultKey)
BuildQueueManager
reorderBuildInQueue
in interface BuildQueueManager
@NotNull public BuildQueuePosition getQueuePosition(@NotNull PlanResultKey planResultKey)
BuildQueueManager
getQueuePosition
in interface BuildQueueManager
planResultKey
- identifies plan result
@NotNull public java.util.List<BuildContext> getBuildQueue()
BuildQueueManager
BuildContext
objects representing the builds that is
in the queue
getBuildQueue
in interface BuildQueueManager
List
of BuildContext
. Changes to this List is not reflected in the queue.public boolean queueContains(PlanKey planKey)
BuildQueueManager
Indicates whether a build of a given build plan is in the queue.
queueContains
in interface BuildQueueManager
planKey
- The build plan key
true
if a build of the given build plan is in the queue, false
otherwise.public void reconstructBuildQueue()
BuildQueueManager
reconstructBuildQueue
in interface BuildQueueManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |