com.atlassian.bamboo.v2.build.queue
Interface BuildQueueManager

All Known Implementing Classes:
BuildQueueManagerImpl

@ThreadSafe
public interface BuildQueueManager

Thie interface defines the work that the queue manager can do. Implementors must be threadsafe.


Field Summary
static java.lang.String DISABLE_BUILD_SYSTEM_PROPERTY
           
 
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
 boolean queueContains(java.lang.String planKey)
          Indicates whether a build of a given build plan is in the queue.
 void reconstructBuildQueue()
          Reconstructs the build queue.
 void removeBuildFromQueue(java.lang.String planKey)
          Removes the BuildContext associated with the buildResultKey to be removed form the queue.
 void reorderBuildInQueue(java.lang.String planKey, int index)
          Reorders the build queue.
 

Field Detail

DISABLE_BUILD_SYSTEM_PROPERTY

static final java.lang.String DISABLE_BUILD_SYSTEM_PROPERTY
See Also:
Constant Field Values
Method Detail

addBuildToQueue

void addBuildToQueue(@NotNull
                     BuildContext buildContext)
Attempts to add the build to a queue. A BuildQueuedEvent is fired if queuing was successful and a BuildRejectedFromQueueEvent iif rejected. A lock on the build is obtained from the BuildExecutionManager.

Parameters:
buildContext - @NotNull

removeBuildFromQueue

void removeBuildFromQueue(java.lang.String planKey)
Removes the BuildContext associated with the buildResultKey to be removed form 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.

Parameters:
planKey -

reorderBuildInQueue

void reorderBuildInQueue(java.lang.String planKey,
                         int index)
Reorders the build queue. 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.

Parameters:
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.

getBuildQueue

@NotNull
java.util.List<BuildContext> getBuildQueue()
Returns a thread safe list of BuildContext objects representing the builds that is in the queue

Returns:
List of BuildContext. Changes to this List is not reflected in the queue.

queueContains

boolean queueContains(java.lang.String planKey)

Indicates whether a build of a given build plan is in the queue.

Parameters:
planKey - The build plan key
Returns:
true if a build of the given build plan is in the queue, false otherwise.

reconstructBuildQueue

void reconstructBuildQueue()
Reconstructs the build queue. This needs to happen in the following scenarios: - Agent capability gets updated - Agent enabled/disabled - Plan configuration (requirements) updated.



Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.