com.atlassian.bamboo.v2.build
Class CurrentlyBuildingImpl

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.CurrentlyBuildingImpl
All Implemented Interfaces:
CurrentlyBuilding

@ThreadSafe
public class CurrentlyBuildingImpl
extends java.lang.Object
implements CurrentlyBuilding


Constructor Summary
CurrentlyBuildingImpl(BuildIdentifier buildIdentifier, BuildChanges buildChanges, TriggerReason triggerReason, java.lang.Long buildAverageDuration)
           
 
Method Summary
 java.lang.Long getBuildAgentId()
          The current build agent id iff the build is current building on an agent
 java.lang.Long getBuildAverageDuration()
          How long on average has the build taken in the past.
 BuildCancelledDetails getBuildCancelledDetails()
           
 BuildChanges getBuildChanges()
          Changes associated with current build
 BuildHungDetails getBuildHangDetails()
          Details about the build if it hung.
 BuildIdentifier getBuildIdentifier()
          The ID of the build
 BuildQueueTimeoutDetails getBuildQueueTimeoutDetails()
          Details about the build if queue timeout was detected.
 java.lang.Long getBuildTime()
          How long has the build taken so far since checkout has finished? Method name should be getBuildDuration...
 java.util.Collection<BuildAgent> getExecutableBuildAgents()
          Get the list of executable agents for this build.
 java.util.Collection<ElasticImageConfiguration> getExecutableElasticImages()
          Get the list of elastic images that can execute this plan.
 BuildProgressBar getProgressBar()
          Track our progress of the current build
 java.util.Date getQueueTime()
          The Date when the build was originally queued
 java.util.Date getStartTime()
          When was the build was started.
 TriggerReason getTriggerReason()
          The trigger reason of the current build
 java.util.Date getVcsUpdateTime()
          The time Date when updating / checking out source repository began
 boolean hasExecutableAgents()
          Determine whether this plan currently has any agent that can run it.
 boolean isCurrentlyQueuedOnly()
          Is the build queued? Effectively checks if the CurrentlyBuilding.getBuildAgentId() returns null
 boolean isExecutableAgentInfoInitialized()
           
 boolean isUpdatingVcs()
           
 void setBuildAgentId(java.lang.Long buildAgentId)
          Sets the fact that the build will now be building on an agent
 void setBuildCancelledDetails(BuildCancelledDetails buildCancelledDetails)
           
 void setBuildHangDetails(BuildHungDetails buildHungDetails)
          Set the details if the build was detected to be hung.
 void setBuildQueueTimeoutDetails(BuildQueueTimeoutDetails buildQueueTimeoutDetails)
          Sets build queue timeout details
 void setExecutableAgentInfoInitialized(boolean executableAgentInfoInitialized)
           
 void setExecutableBuildAgents(java.util.Collection<BuildAgent> executableBuildAgents)
          Resets the executable build agents
 void setExecutableElasticImages(java.util.Collection<ElasticImageConfiguration> executableElasticImages)
          Resets the executable build agents
 void setVcsUpdateTime(java.util.Date vcsUpdateTime)
           
 void startTimer()
          Starts an internal timer to the currently running build
 void stopTimer()
          Stops the internal timer for the current running build
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrentlyBuildingImpl

public CurrentlyBuildingImpl(BuildIdentifier buildIdentifier,
                             BuildChanges buildChanges,
                             TriggerReason triggerReason,
                             java.lang.Long buildAverageDuration)
Method Detail

getBuildIdentifier

@NotNull
public BuildIdentifier getBuildIdentifier()
Description copied from interface: CurrentlyBuilding
The ID of the build

Specified by:
getBuildIdentifier in interface CurrentlyBuilding
Returns:

getBuildChanges

@NotNull
public BuildChanges getBuildChanges()
Description copied from interface: CurrentlyBuilding
Changes associated with current build

Specified by:
getBuildChanges in interface CurrentlyBuilding
Returns:

getTriggerReason

@NotNull
public TriggerReason getTriggerReason()
Description copied from interface: CurrentlyBuilding
The trigger reason of the current build

Specified by:
getTriggerReason in interface CurrentlyBuilding
Returns:

getProgressBar

@NotNull
public BuildProgressBar getProgressBar()
Description copied from interface: CurrentlyBuilding
Track our progress of the current build

Specified by:
getProgressBar in interface CurrentlyBuilding
Returns:

getBuildAverageDuration

@NotNull
public java.lang.Long getBuildAverageDuration()
Description copied from interface: CurrentlyBuilding
How long on average has the build taken in the past. Used by the build progress bar.

Specified by:
getBuildAverageDuration in interface CurrentlyBuilding
Returns:
Long representing build average duration - in millis

getExecutableBuildAgents

@NotNull
public java.util.Collection<BuildAgent> getExecutableBuildAgents()
Description copied from interface: CurrentlyBuilding
Get the list of executable agents for this build. This mirrors the agent id's in the JMS message on the queue.

Specified by:
getExecutableBuildAgents in interface CurrentlyBuilding
Returns:
- a list of BuildAgent which can execute this build.

setExecutableBuildAgents

public void setExecutableBuildAgents(@NotNull
                                     java.util.Collection<BuildAgent> executableBuildAgents)
Description copied from interface: CurrentlyBuilding
Resets the executable build agents

Specified by:
setExecutableBuildAgents in interface CurrentlyBuilding
Parameters:
executableBuildAgents - - a list of BuildAgent which can execute this build.

hasExecutableAgents

public boolean hasExecutableAgents()
Description copied from interface: CurrentlyBuilding
Determine whether this plan currently has any agent that can run it.

Specified by:
hasExecutableAgents in interface CurrentlyBuilding
Returns:
True if at least one agent: meets all of the plans requirements is enabled is active (i.e. online), otherwise False.

getExecutableElasticImages

@NotNull
public java.util.Collection<ElasticImageConfiguration> getExecutableElasticImages()
Description copied from interface: CurrentlyBuilding
Get the list of elastic images that can execute this plan.

Specified by:
getExecutableElasticImages in interface CurrentlyBuilding
Returns:
collection of ElasticImageConfiguration which can execute this plan

setExecutableElasticImages

public void setExecutableElasticImages(@NotNull
                                       java.util.Collection<ElasticImageConfiguration> executableElasticImages)
Description copied from interface: CurrentlyBuilding
Resets the executable build agents

Specified by:
setExecutableElasticImages in interface CurrentlyBuilding
Parameters:
executableElasticImages - - a list of images that can run this build.

getBuildAgentId

@Nullable
public java.lang.Long getBuildAgentId()
Description copied from interface: CurrentlyBuilding
The current build agent id iff the build is current building on an agent

Specified by:
getBuildAgentId in interface CurrentlyBuilding
Returns:

setBuildAgentId

public void setBuildAgentId(@NotNull
                            java.lang.Long buildAgentId)
Description copied from interface: CurrentlyBuilding
Sets the fact that the build will now be building on an agent

Specified by:
setBuildAgentId in interface CurrentlyBuilding

isCurrentlyQueuedOnly

public boolean isCurrentlyQueuedOnly()
Description copied from interface: CurrentlyBuilding
Is the build queued? Effectively checks if the CurrentlyBuilding.getBuildAgentId() returns null

Specified by:
isCurrentlyQueuedOnly in interface CurrentlyBuilding
Returns:

getStartTime

@Nullable
public java.util.Date getStartTime()
Description copied from interface: CurrentlyBuilding
When was the build was started. This is the time take from

Specified by:
getStartTime in interface CurrentlyBuilding
Returns:
Date - when this CurrentBuildResult was generated

getQueueTime

@Nullable
public java.util.Date getQueueTime()
Description copied from interface: CurrentlyBuilding
The Date when the build was originally queued

Specified by:
getQueueTime in interface CurrentlyBuilding
Returns:

getVcsUpdateTime

@Nullable
public java.util.Date getVcsUpdateTime()
Description copied from interface: CurrentlyBuilding
The time Date when updating / checking out source repository began

Specified by:
getVcsUpdateTime in interface CurrentlyBuilding
Returns:

setVcsUpdateTime

public void setVcsUpdateTime(@NotNull
                             java.util.Date vcsUpdateTime)
Specified by:
setVcsUpdateTime in interface CurrentlyBuilding

getBuildTime

@NotNull
public java.lang.Long getBuildTime()
Description copied from interface: CurrentlyBuilding
How long has the build taken so far since checkout has finished? Method name should be getBuildDuration...

Specified by:
getBuildTime in interface CurrentlyBuilding
Returns:
Long representing build time - in millis. 0 if not started

isUpdatingVcs

public boolean isUpdatingVcs()
Specified by:
isUpdatingVcs in interface CurrentlyBuilding

startTimer

public void startTimer()
Description copied from interface: CurrentlyBuilding
Starts an internal timer to the currently running build

Specified by:
startTimer in interface CurrentlyBuilding

stopTimer

public void stopTimer()
Description copied from interface: CurrentlyBuilding
Stops the internal timer for the current running build

Specified by:
stopTimer in interface CurrentlyBuilding

getBuildHangDetails

@Nullable
public BuildHungDetails getBuildHangDetails()
Description copied from interface: CurrentlyBuilding
Details about the build if it hung. Will be null if build was fine.

Specified by:
getBuildHangDetails in interface CurrentlyBuilding
Returns:

setBuildHangDetails

public void setBuildHangDetails(@Nullable
                                BuildHungDetails buildHungDetails)
Description copied from interface: CurrentlyBuilding
Set the details if the build was detected to be hung.

Specified by:
setBuildHangDetails in interface CurrentlyBuilding

getBuildCancelledDetails

@Nullable
public BuildCancelledDetails getBuildCancelledDetails()
Specified by:
getBuildCancelledDetails in interface CurrentlyBuilding

setBuildCancelledDetails

public void setBuildCancelledDetails(@Nullable
                                     BuildCancelledDetails buildCancelledDetails)
Specified by:
setBuildCancelledDetails in interface CurrentlyBuilding

getBuildQueueTimeoutDetails

public BuildQueueTimeoutDetails getBuildQueueTimeoutDetails()
Description copied from interface: CurrentlyBuilding
Details about the build if queue timeout was detected.

Specified by:
getBuildQueueTimeoutDetails in interface CurrentlyBuilding
Returns:

setBuildQueueTimeoutDetails

public void setBuildQueueTimeoutDetails(BuildQueueTimeoutDetails buildQueueTimeoutDetails)
Description copied from interface: CurrentlyBuilding
Sets build queue timeout details

Specified by:
setBuildQueueTimeoutDetails in interface CurrentlyBuilding

isExecutableAgentInfoInitialized

public boolean isExecutableAgentInfoInitialized()
Specified by:
isExecutableAgentInfoInitialized in interface CurrentlyBuilding
Returns:
true if executable agent lists have been updated at least once since triggering of the build

setExecutableAgentInfoInitialized

public void setExecutableAgentInfoInitialized(boolean executableAgentInfoInitialized)
Specified by:
setExecutableAgentInfoInitialized in interface CurrentlyBuilding


Copyright © 2010 Atlassian. All Rights Reserved.