com.atlassian.bamboo.build
Class DefaultBuild

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.bamboo.core.BambooEntityObject
          extended by com.atlassian.bamboo.plan.AbstractPlan
              extended by com.atlassian.bamboo.build.DefaultBuild
All Implemented Interfaces:
Build, BambooObject, Describable, Plan, DescriptionProvider, NameProvider, java.lang.Cloneable, java.lang.Comparable<Plan>

public class DefaultBuild
extends AbstractPlan
implements Build


Field Summary
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Fields inherited from interface com.atlassian.bamboo.plan.Plan
MAX_NUMBER_LOG_ENTRIES, MAX_PREVIOUS_BUILD_FOR_AVE, STATUS_CURRENTLY_BUILDING, STATUS_FAIL, STATUS_NO_BUILDS, STATUS_NOT_RUN, STATUS_SUCCESS
 
Constructor Summary
DefaultBuild()
           
 
Method Summary
 void accept(PlanVisitor planVisitor)
           
 void addBuildResultSummary(BuildResultsSummary buildResultsSummary)
          Add the given build results summary to the build.
 long getAverageBuildDuration()
          Returns an average duration of the recent builds
 BuildResultsSummaryManager getBuildResultsSummaryManager()
           
 java.util.List getBuildResultSummaries()
          Obtains the builds total collection of BuildResultsSummary objects (oldest first), one for each build.
 java.lang.String getCurrentStatus()
          Retuns a string key as to what the status is.
 BuildResultsSummary getFirstBuildSummary()
          Get the first build result
 ExtendedBuildResultsSummary getLatestBuildSummary()
          Get the summary from the latest build
 BuildResults getNextBuildResults(int buildNumber)
           
 BuildResults getPreviousBuildResults(int buildNumber)
          Gets the first BuildResultsImpl before the passed number
 boolean hasBuildResults()
          Has the build got any build results to display?
 boolean isBusy()
          Does something have a lock on the build
 boolean isExecuting()
          Is the build currenlty being executed?
 boolean isInBuildQueue()
          Is the build currenlty being built?
 void removeBuildResultSummary(int buildNumber)
          Remove buildResultSummary and all persisted files for given build number
 void setBuildExecutionManager(BuildExecutionManager buildExecutionManager)
           
 void setBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)
           
 ErrorCollection validateBuild()
          Validates the build's builder and source code locations
 
Methods inherited from class com.atlassian.bamboo.plan.AbstractPlan
compareTo, equals, getBuildDefinition, getBuildDefinitionXml, getBuildKey, getBuildLogger, getBuildName, getDescription, getFirstBuildNumber, getKey, getLabellings, getLastBuildNumber, getLastVcsRevisionKey, getName, getNextBuildNumber, getNotificationSet, getPlanKey, getProject, getRelatedLabellings, getRequirementSet, getSourceCodeDirectory, hashCode, isMarkedForDeletion, isSuspendedFromBuilding, markForDeletion, setBuildDefinitionManager, setBuildDefinitionXml, setBuildKey, setBuildLoggerManager, setBuildName, setDescription, setFirstBuildNumber, setKey, setLabellings, setLastBuildNumber, setLastVcsRevisionKey, setMarkedForDeletion, setName, setNextBuildNumber, setNotificationSet, setProject, setRequirementSet, setSuspendedFromBuilding, unMarkForDeletion
 
Methods inherited from class com.atlassian.bamboo.core.BambooEntityObject
getId, setId
 
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getLastModificationDate, setClock, setCreationDate, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.plan.Plan
getBuildDefinition, getBuildDefinitionXml, getBuildKey, getBuildLogger, getBuildName, getFirstBuildNumber, getKey, getLabellings, getLastBuildNumber, getLastVcsRevisionKey, getName, getNextBuildNumber, getNotificationSet, getPlanKey, getProject, getRelatedLabellings, getRequirementSet, getSourceCodeDirectory, isMarkedForDeletion, isSuspendedFromBuilding, markForDeletion, setBuildDefinitionXml, setBuildKey, setBuildName, setFirstBuildNumber, setKey, setLabellings, setLastBuildNumber, setLastVcsRevisionKey, setNextBuildNumber, setNotificationSet, setProject, setRequirementSet, setSuspendedFromBuilding, unMarkForDeletion
 
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
getId, setId
 
Methods inherited from interface com.atlassian.bamboo.Describable
setDescription, setName
 
Methods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescription
 

Constructor Detail

DefaultBuild

public DefaultBuild()
Method Detail

getAverageBuildDuration

public long getAverageBuildDuration()
Description copied from interface: Build
Returns an average duration of the recent builds

Specified by:
getAverageBuildDuration in interface Build
Returns:
The duration in milliseconds

getBuildResultSummaries

public java.util.List getBuildResultSummaries()
Description copied from interface: Build
Obtains the builds total collection of BuildResultsSummary objects (oldest first), one for each build.

Specified by:
getBuildResultSummaries in interface Build
Returns:
The collection of build summary objects

getLatestBuildSummary

public ExtendedBuildResultsSummary getLatestBuildSummary()
Description copied from interface: Build
Get the summary from the latest build

Specified by:
getLatestBuildSummary in interface Build
Returns:
The summary info for the last completed build. Returns null if there are no build results for this build

getFirstBuildSummary

public BuildResultsSummary getFirstBuildSummary()
Description copied from interface: Build
Get the first build result

Specified by:
getFirstBuildSummary in interface Build
Returns:
result

addBuildResultSummary

public void addBuildResultSummary(BuildResultsSummary buildResultsSummary)
Description copied from interface: Build
Add the given build results summary to the build.

Specified by:
addBuildResultSummary in interface Build
Parameters:
buildResultsSummary - The build summary

removeBuildResultSummary

public void removeBuildResultSummary(int buildNumber)
Description copied from interface: Build
Remove buildResultSummary and all persisted files for given build number

Specified by:
removeBuildResultSummary in interface Build

getPreviousBuildResults

public BuildResults getPreviousBuildResults(int buildNumber)
Description copied from interface: Build
Gets the first BuildResultsImpl before the passed number

Specified by:
getPreviousBuildResults in interface Build
Returns:
BuildResultsImpl. null if no build results can be found before that number

getNextBuildResults

public BuildResults getNextBuildResults(int buildNumber)
Specified by:
getNextBuildResults in interface Build

hasBuildResults

public boolean hasBuildResults()
Description copied from interface: Build
Has the build got any build results to display?

Specified by:
hasBuildResults in interface Build
Returns:
true if the build has been built, false otherwise

validateBuild

public ErrorCollection validateBuild()
Description copied from interface: Plan
Validates the build's builder and source code locations

Specified by:
validateBuild in interface Plan
Returns:
and ErrorCollection with relevent error messages

getCurrentStatus

public java.lang.String getCurrentStatus()
Description copied from interface: Plan
Retuns a string key as to what the status is. Can be "success", "failure", "current", "none" or "notRun". Mainly used for UI purposes.

Specified by:
getCurrentStatus in interface Plan
Returns:

isBusy

public boolean isBusy()
Does something have a lock on the build

Specified by:
isBusy in interface Build
Returns:

isInBuildQueue

public boolean isInBuildQueue()
Is the build currenlty being built?

Specified by:
isInBuildQueue in interface Plan
Returns:
true iff is currently in the build pipleline

isExecuting

public boolean isExecuting()
Description copied from interface: Plan
Is the build currenlty being executed?

Specified by:
isExecuting in interface Plan
Returns:
true if build is being executed

accept

public void accept(PlanVisitor planVisitor)
Specified by:
accept in interface Plan

setBuildResultsSummaryManager

public void setBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)

getBuildResultsSummaryManager

public BuildResultsSummaryManager getBuildResultsSummaryManager()

setBuildExecutionManager

public void setBuildExecutionManager(BuildExecutionManager buildExecutionManager)


Copyright © 2010 Atlassian. All Rights Reserved.