com.atlassian.bamboo.plan
Interface Plan

All Superinterfaces:
BambooObject, Deletable, Describable, DescriptionProvider, NameProvider
All Known Subinterfaces:
Build, Buildable, Chain, Job, TopLevelPlan
All Known Implementing Classes:
AbstractBuildable, AbstractPlan, BuildObjectForTests, DefaultBuild, DefaultChain, DefaultJob, PlanPermissionSkeleton, TestBuildObjectForTests

public interface Plan
extends BambooObject, Describable, Deletable


Field Summary
static int MAX_NUMBER_LOG_ENTRIES
           
static int MAX_PREVIOUS_BUILD_FOR_AVE
           
static java.lang.String STATUS_CURRENTLY_BUILDING
           
static java.lang.String STATUS_FAIL
           
static java.lang.String STATUS_NO_BUILDS
           
static java.lang.String STATUS_NOT_RUN
           
static java.lang.String STATUS_SUCCESS
           
 
Method Summary
 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()
          Returns the name for the build in the form of "build name" e.g.
 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!
 java.lang.String getKey()
          Obtain the build's unique key (uppercase alphanumeric).
 java.util.List<Labelling> getLabellings()
           
 int getLastBuildNumber()
          What was the number of the latest build (may be being built)
 java.lang.String getLastVcsRevisionKey()
          The string value representing the last build triggered.
 ResultsSummary getLatestResultsSummary()
          Get the summary from the latest completed plan
 java.lang.String getName()
          Returns the full name for the build in the form of "project name - build name" e.g.
 int getNextBuildNumber()
          The next build number represents the number of the next build result that's to be executed
 PlanKey getPlanKey()
          Get the PlanKey identifier for this Plan
 Project getProject()
          Returns the parent Project
 java.util.List<Labelling> getRelatedLabellings()
           
 java.io.File getSourceCodeDirectory()
          Returns a file representing the source directory from the Repository
 java.lang.String getType()
           
 boolean hasTests()
          Helper method checking if plan has tests defined
 boolean isActive()
          Checks if the plan has an active build(s).
 boolean isBusy()
          Is the Plan busy
 boolean isExecuting()
          Is the build currenlty being executed?
 boolean isSuspendedFromBuilding()
          Checks if the build has been
 void setBuildDefinitionXml(BuildDefinitionForBuild buildDefinitionXml)
           
 void setBuildKey(java.lang.String buildKey)
          Define the build's unique key (uppercase alphanumeric)
 void setBuildName(java.lang.String buildName)
           
 void setFirstBuildNumber(int firstBuildNumber)
           
 void setKey(java.lang.String fullKey)
           
 void setLabellings(java.util.List<Labelling> labellings)
           
 void setLastBuildNumber(int lastBuildNumber)
           
 void setLastVcsRevisionKey(java.lang.String lastVcsRevisionKey)
           
 void setNextBuildNumber(int nextBuildNumber)
           
 void setProject(Project project)
           
 void setSuspendedFromBuilding(boolean suspendFromBuilding)
          Sets the build to suspend temporarily
 ErrorCollection validateBuild()
          Validates the build's builder and source code locations
 
Methods inherited from interface com.atlassian.bamboo.Describable
setDescription, setName
 
Methods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescription
 
Methods inherited from interface com.atlassian.bamboo.deletion.Deletable
isMarkedForDeletion, setMarkedForDeletion
 
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
getId, setId
 

Field Detail

MAX_NUMBER_LOG_ENTRIES

static final int MAX_NUMBER_LOG_ENTRIES
See Also:
Constant Field Values

MAX_PREVIOUS_BUILD_FOR_AVE

static final int MAX_PREVIOUS_BUILD_FOR_AVE
See Also:
Constant Field Values

STATUS_FAIL

static final java.lang.String STATUS_FAIL
See Also:
Constant Field Values

STATUS_SUCCESS

static final java.lang.String STATUS_SUCCESS
See Also:
Constant Field Values

STATUS_CURRENTLY_BUILDING

static final java.lang.String STATUS_CURRENTLY_BUILDING
See Also:
Constant Field Values

STATUS_NO_BUILDS

static final java.lang.String STATUS_NO_BUILDS
See Also:
Constant Field Values

STATUS_NOT_RUN

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

getPlanKey

@NotNull
PlanKey getPlanKey()
Get the PlanKey identifier for this Plan

Returns:
planKey

getKey

java.lang.String getKey()
Obtain the build's unique key (uppercase alphanumeric). This includes the project prefix e.g. BAM-MAIN

Returns:
The full key

setKey

void setKey(java.lang.String fullKey)

getBuildKey

java.lang.String getBuildKey()
Thie returns the build portion of the build key

Returns:
String

setBuildKey

void setBuildKey(java.lang.String buildKey)
Define the build's unique key (uppercase alphanumeric)

Parameters:
buildKey - The value of the key

getName

@NotNull
java.lang.String getName()
Returns the full name for the build in the form of "project name - build name" e.g. "Confluence - HEAD"

Specified by:
getName in interface DescriptionProvider
Specified by:
getName in interface NameProvider
Returns:
String

getBuildName

java.lang.String getBuildName()
Returns the name for the build in the form of "build name" e.g. if the full name was "Confluence - HEAD" the build name would be HEAD

Returns:
String

setBuildName

void setBuildName(java.lang.String buildName)

validateBuild

ErrorCollection validateBuild()
Validates the build's builder and source code locations

Returns:
and ErrorCollection with relevent error messages

getCurrentStatus

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

Returns:

getSourceCodeDirectory

java.io.File getSourceCodeDirectory()
                                    throws RepositoryException
Returns a file representing the source directory from the Repository

Returns:
file`representing the source directory. null iff an exception has been thrown
Throws:
RepositoryException

isExecuting

boolean isExecuting()
Is the build currenlty being executed?

Returns:
true if build is being executed

setSuspendedFromBuilding

void setSuspendedFromBuilding(boolean suspendFromBuilding)
Sets the build to suspend temporarily

Parameters:
suspendFromBuilding -

isSuspendedFromBuilding

boolean isSuspendedFromBuilding()
Checks if the build has been

Returns:

getLastBuildNumber

int getLastBuildNumber()
What was the number of the latest build (may be being built)

Returns:
the build number, zero if the build has not been built

getFirstBuildNumber

int getFirstBuildNumber()
What the number of the first build we have? It may not be 1 as some may have been removed!

Returns:
The number of the first build

hasTests

boolean hasTests()
Helper method checking if plan has tests defined

Returns:
true iff plan produces test results

getBuildDefinition

@NotNull
BuildDefinition getBuildDefinition()
Returns the BuildDefinition that backs this buildd

Returns:
BuildDefinition object.

getProject

Project getProject()
Returns the parent Project

Returns:
Project. Never null

setProject

void setProject(Project project)

getNextBuildNumber

int getNextBuildNumber()
The next build number represents the number of the next build result that's to be executed

Returns:
a build number, starting with 1

setNextBuildNumber

void setNextBuildNumber(int nextBuildNumber)

setLastBuildNumber

void setLastBuildNumber(int lastBuildNumber)

setFirstBuildNumber

void setFirstBuildNumber(int firstBuildNumber)

getBuildDefinitionXml

BuildDefinitionForBuild getBuildDefinitionXml()

setBuildDefinitionXml

void setBuildDefinitionXml(BuildDefinitionForBuild buildDefinitionXml)

getLabellings

java.util.List<Labelling> getLabellings()

setLabellings

void setLabellings(java.util.List<Labelling> labellings)

getRelatedLabellings

java.util.List<Labelling> getRelatedLabellings()

getBuildLogger

BuildLogger getBuildLogger()
Returns the helper object to deal with logging

Returns:
A BuildLogger. @NotNull

getLastVcsRevisionKey

@Nullable
java.lang.String getLastVcsRevisionKey()
The string value representing the last build triggered. Will be null if nothing has been built. The value is parseable by the individual repositories

Returns:

setLastVcsRevisionKey

void setLastVcsRevisionKey(java.lang.String lastVcsRevisionKey)

isActive

boolean isActive()
Checks if the plan has an active build(s).

Returns:
true if at least one build request is currently in the queue or being processed

getAverageBuildDuration

long getAverageBuildDuration()
Returns an average duration of the recent builds

Returns:
The duration in milliseconds

getType

@NotNull
java.lang.String getType()
Returns:
a string representation of the implementation type. Used for freemarker.

getLatestResultsSummary

@Nullable
ResultsSummary getLatestResultsSummary()
Get the summary from the latest completed plan

Returns:
The summary info for the last completed plan. Returns null if there are no build results for this plan

isBusy

boolean isBusy()
Is the Plan busy

Returns:
busy


Copyright © 2011 Atlassian. All Rights Reserved.