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.build.DefaultBuild
All Implemented Interfaces:
Build, BambooObject, java.lang.Cloneable, java.lang.Comparable

public class DefaultBuild
extends BambooEntityObject
implements Build, java.lang.Comparable


Field Summary
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Fields inherited from interface com.atlassian.bamboo.build.Build
MAX_NUMBER_LOG_ENTRIES, MAX_PREVIOUS_BUILD_FOR_AVE, STATUS_CURRENTLY_BUILDING, STATUS_FAIL, STATUS_NO_BUILDS, STATUS_SUCCESS
 
Constructor Summary
DefaultBuild()
           
 
Method Summary
 void addBuildResultSummary(BuildResultsSummary buildResultsSummary)
          Add the given build results summary to the build.
 int compareTo(java.lang.Object obj)
           
 boolean equals(java.lang.Object o)
           
 long getAverageBuildDuration()
          Returns an average duration of the recent builds
 BuildDefinition getBuildDefinition()
          Returns the BuildDefinition that backs this buildd
 BuildDefinitionForBuild getBuildDefinitionXml()
           
 java.lang.String getBuildKey()
          Thie returns the build portion of the build key
 BuildLogger getBuildLogger()
          Returns the helper object to deal with logging
 java.lang.String getBuildName()
           
 BuildResultsSummaryManager getBuildResultsSummaryManager()
           
 java.util.List getBuildResultSummaries()
          Obtains the builds total collection of BuildResultsSummary objects (oldest first), one for each build.
 java.util.Set getChildBuilds()
          Get the dependant child builds for the current build
 java.lang.String getCurrentStatus()
          Retuns a string key as to what the status is.
 int getFirstBuildNumber()
          What the number of the first build we have? It may not be 1 as some may have been removed!
 BuildResultsSummary getFirstBuildSummary()
           
 java.lang.String getKey()
          Obtain the build's unique key (uppercase alphanumeric).
 java.util.List getLabellings()
           
 int getLastBuildNumber()
          What was the number of the lastest build (may be being built)
 java.lang.String getLastVcsRevisionKey()
          The string value representing the last build triggered.
 ExtendedBuildResultsSummary getLatestBuildSummary()
          Get the summary from the latest build
 java.lang.String getName()
          Returns the full name for the build in the form of "projet name - build name" e.g.
 int getNextBuildNumber()
          The next build number represents the number of the next build result that's to be executed
 BuildResults getNextBuildResults(int buildNumber)
           
 NotificationSet getNotificationSet()
           
 java.util.Set getParentBuilds()
          Get the parent builds for the current build
 BuildResults getPreviousBuildResults(int buildNumber)
          Gets the first BuildResultsImpl before the passed number
 Project getProject()
          Returns the parent Project
 RequirementSet getRequirementSet()
           
 java.io.File getSourceCodeDirectory()
          Returns a file representing the source directory from the Repository
 boolean hasBuildResults()
          Has the build got any build results to display?
 int hashCode()
           
 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?
 boolean isMarkedForDeletion()
          Whether or not the build has been marked for deletion
 boolean isSuspendedFromBuilding()
          Checks if the build has been
 void markForDeletion()
          Marks the build to be deleted.
 void setBuildDefinitionManager(BuildDefinitionManager buildDefinitionManager)
           
 void setBuildDefinitionXml(BuildDefinitionForBuild buildDefinitionXml)
           
 void setBuildExecutionManager(BuildExecutionManager buildExecutionManager)
           
 void setBuildKey(java.lang.String buildKey)
          Define the build's unique key (uppercase alphanumeric)
 void setBuildName(java.lang.String buildName)
           
 void setBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)
           
 void setChildBuilds(java.util.Set childBuilds)
          Set the dependant child builds for the current builds
 void setFirstBuildNumber(int firstBuildNumber)
           
 void setKey(java.lang.String key)
           
 void setLabellings(java.util.List labellings)
           
 void setLastBuildNumber(int lastBuildNumber)
           
 void setLastVcsRevisionKey(java.lang.String lastVcsRevisionKey)
           
 void setMarkedForDeletion(boolean markedForDeletion)
           
 void setNextBuildNumber(int nextBuildNumber)
           
 void setNotificationSet(NotificationSet notificationSet)
           
 void setParentBuilds(java.util.Set parentBuilds)
          Set the parent builds for the current build
 void setProject(Project project)
           
 void setRequirementSet(RequirementSet requirementSet)
           
 void setSuspendedFromBuilding(boolean suspendedFromBuilding)
          Sets the build to suspend temporarily
 void unMarkForDeletion()
          Build will no longer be marked for deletion
 ErrorCollection validateBuild()
          Validates the build's builder and source code locations
 
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.core.BambooObject
getId, setId
 

Constructor Detail

DefaultBuild

public DefaultBuild()
Method Detail

getKey

public java.lang.String getKey()
Description copied from interface: Build
Obtain the build's unique key (uppercase alphanumeric). This includes the project prefix e.g. BAM-MAIN

Specified by:
getKey in interface Build
Returns:
The full key

setKey

public void setKey(java.lang.String key)
Specified by:
setKey in interface Build

getBuildKey

public java.lang.String getBuildKey()
Description copied from interface: Build
Thie returns the build portion of the build key

Specified by:
getBuildKey in interface Build
Returns:
String

setBuildKey

public void setBuildKey(java.lang.String buildKey)
Description copied from interface: Build
Define the build's unique key (uppercase alphanumeric)

Specified by:
setBuildKey in interface Build
Parameters:
buildKey - The value of the key

getName

public java.lang.String getName()
Description copied from interface: Build
Returns the full name for the build in the form of "projet name - build name" e.g. "Confluence - HEAD"

Specified by:
getName in interface Build
Returns:
String @NotNull

getBuildName

public java.lang.String getBuildName()
Specified by:
getBuildName in interface Build

setBuildName

public void setBuildName(java.lang.String buildName)
Specified by:
setBuildName in interface Build

validateBuild

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

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

getCurrentStatus

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

Specified by:
getCurrentStatus in interface Build
Returns:

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

getSourceCodeDirectory

public java.io.File getSourceCodeDirectory()
                                    throws RepositoryException
Description copied from interface: Build
Returns a file representing the source directory from the Repository

Specified by:
getSourceCodeDirectory in interface Build
Returns:
file`representing the source directory. null iff an exception has been thrown
Throws:
RepositoryException

isInBuildQueue

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

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

isExecuting

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

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

isBusy

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

Specified by:
isBusy in interface Build
Returns:

markForDeletion

public void markForDeletion()
Description copied from interface: Build
Marks the build to be deleted.

Specified by:
markForDeletion in interface Build

unMarkForDeletion

public void unMarkForDeletion()
Description copied from interface: Build
Build will no longer be marked for deletion

Specified by:
unMarkForDeletion in interface Build

isMarkedForDeletion

public boolean isMarkedForDeletion()
Description copied from interface: Build
Whether or not the build has been marked for deletion

Specified by:
isMarkedForDeletion in interface Build
Returns:

setMarkedForDeletion

public void setMarkedForDeletion(boolean markedForDeletion)

setSuspendedFromBuilding

public void setSuspendedFromBuilding(boolean suspendedFromBuilding)
Description copied from interface: Build
Sets the build to suspend temporarily

Specified by:
setSuspendedFromBuilding in interface Build

isSuspendedFromBuilding

public boolean isSuspendedFromBuilding()
Description copied from interface: Build
Checks if the build has been

Specified by:
isSuspendedFromBuilding in interface Build
Returns:

getBuildLogger

public BuildLogger getBuildLogger()
Description copied from interface: Build
Returns the helper object to deal with logging

Specified by:
getBuildLogger in interface Build
Returns:
A BuildLogger. @NotNull

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

getLastBuildNumber

public int getLastBuildNumber()
Description copied from interface: Build
What was the number of the lastest build (may be being built)

Specified by:
getLastBuildNumber in interface Build
Returns:
the build number, zero if the build has not been built

getFirstBuildNumber

public int getFirstBuildNumber()
Description copied from interface: Build
What the number of the first build we have? It may not be 1 as some may have been removed!

Specified by:
getFirstBuildNumber in interface Build
Returns:
The number of the first build

setLastBuildNumber

public void setLastBuildNumber(int lastBuildNumber)
Specified by:
setLastBuildNumber in interface Build

setFirstBuildNumber

public void setFirstBuildNumber(int firstBuildNumber)
Specified by:
setFirstBuildNumber in interface Build

getLastVcsRevisionKey

public java.lang.String getLastVcsRevisionKey()
Description copied from interface: Build
The string value representing the last build triggered. Will be null if nothing has been built. The value is parseable by the individual repositories

Specified by:
getLastVcsRevisionKey in interface Build
Returns:

setLastVcsRevisionKey

public void setLastVcsRevisionKey(java.lang.String lastVcsRevisionKey)
Specified by:
setLastVcsRevisionKey in interface Build

getFirstBuildSummary

public BuildResultsSummary getFirstBuildSummary()
Specified by:
getFirstBuildSummary 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

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

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

getParentBuilds

public java.util.Set getParentBuilds()
Description copied from interface: Build
Get the parent builds for the current build

Specified by:
getParentBuilds in interface Build
Returns:
parent builds

setParentBuilds

public void setParentBuilds(java.util.Set parentBuilds)
Description copied from interface: Build
Set the parent builds for the current build

Specified by:
setParentBuilds in interface Build

getChildBuilds

public java.util.Set getChildBuilds()
Description copied from interface: Build
Get the dependant child builds for the current build

Specified by:
getChildBuilds in interface Build
Returns:
child builds

setChildBuilds

public void setChildBuilds(java.util.Set childBuilds)
Description copied from interface: Build
Set the dependant child builds for the current builds

Specified by:
setChildBuilds in interface Build

setProject

public void setProject(Project project)
Specified by:
setProject in interface Build

getNextBuildNumber

public int getNextBuildNumber()
Description copied from interface: Build
The next build number represents the number of the next build result that's to be executed

Specified by:
getNextBuildNumber in interface Build
Returns:
a build number, starting with 1

setNextBuildNumber

public void setNextBuildNumber(int nextBuildNumber)
Specified by:
setNextBuildNumber in interface Build

getBuildDefinition

public BuildDefinition getBuildDefinition()
Description copied from interface: Build
Returns the BuildDefinition that backs this buildd

Specified by:
getBuildDefinition in interface Build
Returns:
BuildDefinition object. Never null.

getProject

public Project getProject()
Description copied from interface: Build
Returns the parent Project

Specified by:
getProject in interface Build
Returns:
Project. Never null

getBuildResultsSummaryManager

public BuildResultsSummaryManager getBuildResultsSummaryManager()

setBuildResultsSummaryManager

public void setBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)

setBuildExecutionManager

public void setBuildExecutionManager(BuildExecutionManager buildExecutionManager)

getBuildDefinitionXml

public BuildDefinitionForBuild getBuildDefinitionXml()
Specified by:
getBuildDefinitionXml in interface Build

setBuildDefinitionXml

public void setBuildDefinitionXml(BuildDefinitionForBuild buildDefinitionXml)
Specified by:
setBuildDefinitionXml in interface Build

getLabellings

public java.util.List getLabellings()
Specified by:
getLabellings in interface Build

setLabellings

public void setLabellings(java.util.List labellings)
Specified by:
setLabellings in interface Build

getNotificationSet

public NotificationSet getNotificationSet()
Specified by:
getNotificationSet in interface Build

setNotificationSet

public void setNotificationSet(NotificationSet notificationSet)
Specified by:
setNotificationSet in interface Build

getRequirementSet

@NotNull
public RequirementSet getRequirementSet()
Specified by:
getRequirementSet in interface Build

setRequirementSet

public void setRequirementSet(RequirementSet requirementSet)
Specified by:
setRequirementSet in interface Build

setBuildDefinitionManager

public void setBuildDefinitionManager(BuildDefinitionManager buildDefinitionManager)

hashCode

public int hashCode()
Overrides:
hashCode in class com.atlassian.core.bean.EntityObject

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class com.atlassian.core.bean.EntityObject

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.