public abstract class

AbstractImmutablePlan

extends Object
implements Plan
java.lang.Object
   ↳ com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
Known Direct Subclasses
Known Indirect Subclasses

Summary

[Expand]
Inherited Constants
From interface com.atlassian.bamboo.plan.cache.ImmutablePlan
Fields
protected LazyReference<Long> averageBuildDuration
protected final ResultsSummaryManager resultsSummaryManager
Public Constructors
AbstractImmutablePlan(ImmutablePlan plan, BuildLoggerManager buildLoggerManager, LabelManager labelManager, VariableDefinitionManager variableDefinitionManager, BuildDefinitionManager buildDefinitionManager, ResultsSummaryManager resultsSummaryManager)
Public Methods
int compareTo(ImmutablePlan plan)
boolean equals(Object o)
long getAverageBuildDuration()
Returns an average duration of the recent builds
@NotNull BuildDefinition getBuildDefinition()
Returns the BuildDefinition that backs this Plan
BuildDefinitionForBuild getBuildDefinitionXml()
@NotNull String getBuildKey()
This objects specific portion of the key.
@NotNull BuildLogger getBuildLogger()
Returns the helper object to deal with logging
@NotNull String getBuildName()
@NotNull String getCurrentStatus()
Retuns a string key as to what the status is.
String getDescription()
@NotNull List<VariableDefinition> getEffectiveVariables()
Return effective list of VariableDefinitions bind to this Plan.
int getFirstBuildNumber()
What the number of the first build we have? It may not be 1 as some may have been removed!
long getId()
@NotNull String getKey()
Obtain the plan's unique key (uppercase alphanumeric).
@NotNull List<String> getLabelNames()
Returns all the names of related labels with a namesapce of :label
@NotNull List<Labelling> getLabellings()
Used only for Hibernate mapping purposes.
int getLastBuildNumber()
What was the number of the latest build (may be being built)
@NotNull 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
@NotNull PlanKey getPlanKey()
Get the PlanKey identifier for this Plan
@NotNull PlanType getPlanType()
@NotNull Project getProject()
Returns the parent Project
@NotNull List<Labelling> getRelatedLabellings()
Returns labellings that's application for the plan level
@NotNull String getType()
Returns the string representation of the type.
@NotNull List<VariableDefinition> getVariables()
Return list of VariableDefinitions bind to this Plan
boolean hasMaster()
boolean hasTests()
Do any of TaskDefinition being used in the plan implement TaskTestResultsSupport
int hashCode()
boolean isMarkedForDeletion()
Is the plan set to be deleted in the future
boolean isSuspendedFromBuilding()
Checks if the build has been enabled / disabled.
void setBuildDefinitionXml(BuildDefinitionForBuild buildDefinitionXml)
void setBuildKey(String buildKey)
Define the build's unique key (uppercase alphanumeric)
void setBuildName(String buildName)
void setDescription(String description)
void setFirstBuildNumber(int firstBuildNumber)
void setId(long id)
void setKey(String fullKey)
void setLabellings(List<Labelling> labellings)
void setLastBuildNumber(int lastBuildNumber)
void setMarkedForDeletion(boolean markedForDeletion)
void setMaster(Plan master)
Set which plan is the master of this plan.
void setName(String name)
void setNextBuildNumber(int nextBuildNumber)
void setPlanKey(PlanKey planKey)
void setProject(Project project)
void setSuspendedFromBuilding(boolean suspendFromBuilding)
Sets the build to suspend temporarily
@Deprecated ErrorCollection validateBuild()
Validates the build's builder and source code locations
Protected Methods
void exceptionOnModification()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.bamboo.Describable
From interface com.atlassian.bamboo.core.BambooIdProvider
From interface com.atlassian.bamboo.core.BambooObject
From interface com.atlassian.bamboo.deletion.Deletable
From interface com.atlassian.bamboo.plan.Plan
From interface com.atlassian.bamboo.plan.PlanIdentifier
From interface com.atlassian.bamboo.plan.cache.ImmutableDeletable
From interface com.atlassian.bamboo.plan.cache.ImmutablePlan
From interface com.atlassian.bamboo.utils.DescriptionProvider
From interface com.atlassian.bamboo.utils.NameProvider

Fields

protected LazyReference<Long> averageBuildDuration

protected final ResultsSummaryManager resultsSummaryManager

Public Constructors

public AbstractImmutablePlan (ImmutablePlan plan, BuildLoggerManager buildLoggerManager, LabelManager labelManager, VariableDefinitionManager variableDefinitionManager, BuildDefinitionManager buildDefinitionManager, ResultsSummaryManager resultsSummaryManager)

Public Methods

public int compareTo (ImmutablePlan plan)

public boolean equals (Object o)

public long getAverageBuildDuration ()

Returns an average duration of the recent builds

Returns
  • The duration in milliseconds

@NotNull public BuildDefinition getBuildDefinition ()

Returns the BuildDefinition that backs this Plan

Returns

public BuildDefinitionForBuild getBuildDefinitionXml ()

@NotNull public String getBuildKey ()

This objects specific portion of the key. You probably want to use getPlanKey().

Returns
  • This objects specific portion of the key

@NotNull public BuildLogger getBuildLogger ()

Returns the helper object to deal with logging

Returns

@NotNull public String getBuildName ()

@NotNull public 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.

public String getDescription ()

@NotNull public List<VariableDefinition> getEffectiveVariables ()

Return effective list of VariableDefinitions bind to this Plan. For master Plans this will return the same result as getVariables(). Non-master plans will produce the sum of: - all master's variables which keys do not appear in result of getVariables() - result of getVariables()

Returns

public 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

public long getId ()

@NotNull public String getKey ()

Obtain the plan's unique key (uppercase alphanumeric). This includes the project prefix e.g. BAM-MAIN. Prefer getPlanKey()

Returns
  • The full key

@NotNull public List<String> getLabelNames ()

Returns all the names of related labels with a namesapce of :label

@NotNull public List<Labelling> getLabellings ()

Used only for Hibernate mapping purposes. Deprecated for removal from the interface@return

public 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

@NotNull public String getName ()

Returns the full name for the build in the form of "project name - build name" e.g. "Confluence - HEAD"

Returns
  • String

public 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

@NotNull public PlanKey getPlanKey ()

Get the PlanKey identifier for this Plan

Returns
  • planKey

@NotNull public PlanType getPlanType ()

@NotNull public Project getProject ()

Returns the parent Project

Returns

@NotNull public List<Labelling> getRelatedLabellings ()

Returns labellings that's application for the plan level

Returns
  • Empty list if no labels

@NotNull public String getType ()

Returns the string representation of the type. See PlanType and used in Freemarker.

Returns
  • the string representation of the type

@NotNull public List<VariableDefinition> getVariables ()

Return list of VariableDefinitions bind to this Plan

Returns

public boolean hasMaster ()

public boolean hasTests ()

Do any of TaskDefinition being used in the plan implement TaskTestResultsSupport

public int hashCode ()

public boolean isMarkedForDeletion ()

Is the plan set to be deleted in the future

public boolean isSuspendedFromBuilding ()

Checks if the build has been enabled / disabled.

Returns
  • true if plan is disabled

public void setBuildDefinitionXml (BuildDefinitionForBuild buildDefinitionXml)

public void setBuildKey (String buildKey)

Define the build's unique key (uppercase alphanumeric)

Parameters
buildKey The value of the key

public void setBuildName (String buildName)

public void setDescription (String description)

public void setFirstBuildNumber (int firstBuildNumber)

public void setId (long id)

public void setKey (String fullKey)

public void setLabellings (List<Labelling> labellings)

public void setLastBuildNumber (int lastBuildNumber)

public void setMarkedForDeletion (boolean markedForDeletion)

public void setMaster (Plan master)

Set which plan is the master of this plan. The master is the plan which this one is derived from. Configuration is pulled from the master if one exists.

public void setName (String name)

public void setNextBuildNumber (int nextBuildNumber)

public void setPlanKey (PlanKey planKey)

public void setProject (Project project)

public void setSuspendedFromBuilding (boolean suspendFromBuilding)

Sets the build to suspend temporarily

@Deprecated public ErrorCollection validateBuild ()

Validates the build's builder and source code locations

Returns

Protected Methods

protected void exceptionOnModification ()