com.atlassian.bamboo.plan
Class AbstractPlan

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.bamboo.core.BambooEntityObject
          extended by com.atlassian.bamboo.plan.AbstractPlan
All Implemented Interfaces:
BambooIdProvider, BambooObject, Deletable, Describable, ImmutableDeletable, ImmutablePlan, Plan, PlanIdentifier, DescriptionProvider, NameProvider, java.lang.Cloneable, java.lang.Comparable<Plan>
Direct Known Subclasses:
AbstractChain, DefaultJob

public abstract class AbstractPlan
extends BambooEntityObject
implements Plan, java.lang.Comparable<Plan>


Field Summary
protected  ResultsSummaryManager resultsSummaryManager
           
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Fields inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
MAX_NUMBER_LOG_ENTRIES, MAX_PREVIOUS_BUILD_FOR_AVE, STATUS_CURRENTLY_BUILDING, STATUS_FAIL, STATUS_NO_BUILDS, STATUS_NOT_RUN, STATUS_SUCCESS
 
Constructor Summary
AbstractPlan()
           
 
Method Summary
 int compareTo(Plan plan)
           
 boolean equals(java.lang.Object o)
           
 BuildDefinition getBuildDefinition()
          Returns the BuildDefinition that backs this Plan
 BuildDefinitionForBuild getBuildDefinitionXml()
           
 java.lang.String getBuildKey()
          This objects specific portion of the key.
 BuildLogger getBuildLogger()
          Returns the helper object to deal with logging
 java.lang.String getBuildName()
           
 java.lang.String getDescription()
           
 java.lang.String getDiscriminator()
           
 java.util.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!
 java.lang.String getKey()
          Obtain the plan's unique key (uppercase alphanumeric).
 java.util.List<Labelling> getLabellings()
          Used only for Hibernate mapping purposes.
 java.util.List<java.lang.String> getLabelNames()
          Returns all the names of related labels with a namesapce of :label
 int getLastBuildNumber()
          What was the number of the latest build (may be being built)
 ResultsSummary getLatestResultsSummary()
          Get the latest finished result
 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()
          Returns labellings that's application for the plan level
 java.util.List<TestClass> getTestClasses()
           
 java.lang.String getType()
          Returns the string representation of the type.
 java.util.List<VariableDefinition> getVariables()
          Return list of VariableDefinitions bind to this Plan
 int hashCode()
           
 boolean hasMaster()
           
 boolean hasTests()
          Deprecated. 
 boolean isBusy()
          Is the Plan "busy".
 boolean isMarkedForDeletion()
          Is the plan set to be deleted in the future
 boolean isSuspendedFromBuilding()
          Checks if the build has been enabled / disabled.
 void setBuildDefinitionManager(BuildDefinitionManager buildDefinitionManager)
           
 void setBuildDefinitionXml(BuildDefinitionForBuild buildDefinitionXml)
           
 void setBuildKey(java.lang.String buildKey)
          Define the build's unique key (uppercase alphanumeric)
 void setBuildLoggerManager(BuildLoggerManager buildLoggerManager)
           
 void setBuildName(java.lang.String buildName)
           
 void setDescription(java.lang.String description)
           
 void setDiscriminator(java.lang.String discriminator)
           
 void setFirstBuildNumber(int firstBuildNumber)
           
 void setKey(java.lang.String fullKey)
           
 void setLabellings(java.util.List<Labelling> labellings)
           
 void setLabelManager(LabelManager labelManager)
           
 void setLastBuildNumber(int lastBuildNumber)
           
 void setMarkedForDeletion(boolean markedForDeletion)
           
 void setName(java.lang.String name)
           
 void setNextBuildNumber(int nextBuildNumber)
           
 void setPlanExecutionManager(PlanExecutionManager planExecutionManager)
           
 void setPlanKey(PlanKey planKey)
           
 void setProject(Project project)
           
 void setResultsSummaryManager(ResultsSummaryManager resultsSummaryManager)
           
 void setSuspendedFromBuilding(boolean suspendedFromBuilding)
          Sets the build to suspend temporarily
 void setTaskManager(TaskManager taskManager)
           
 void setTestClasses(java.util.List<TestClass> testCases)
           
 void setVariableDefinitionManager(VariableDefinitionManager variableDefinitionManager)
           
 
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
setMaster, validateBuild
 
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
 
Methods inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
getAverageBuildDuration, getCurrentStatus, getMaster, isActive, isExecuting
 
Methods inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
getId, getPlanType
 

Field Detail

resultsSummaryManager

protected ResultsSummaryManager resultsSummaryManager
Constructor Detail

AbstractPlan

public AbstractPlan()
Method Detail

getPlanKey

@NotNull
public PlanKey getPlanKey()
Description copied from interface: PlanIdentifier
Get the PlanKey identifier for this Plan

Specified by:
getPlanKey in interface PlanIdentifier
Returns:
planKey

getKey

@NotNull
public java.lang.String getKey()
Description copied from interface: ImmutablePlan
Obtain the plan's unique key (uppercase alphanumeric). This includes the project prefix e.g. BAM-MAIN. Prefer PlanIdentifier.getPlanKey()

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

setKey

public void setKey(java.lang.String fullKey)
Specified by:
setKey in interface Plan

setPlanKey

public void setPlanKey(@NotNull
                       PlanKey planKey)
Specified by:
setPlanKey in interface Plan

getBuildKey

@NotNull
public java.lang.String getBuildKey()
Description copied from interface: PlanIdentifier
This objects specific portion of the key. You probably want to use PlanIdentifier.getPlanKey().

Specified by:
getBuildKey in interface PlanIdentifier
Returns:
This objects specific portion of the key

setBuildKey

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

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

getName

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

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

setName

public void setName(java.lang.String name)
Specified by:
setName in interface Describable

getBuildName

@NotNull
public java.lang.String getBuildName()
Specified by:
getBuildName in interface PlanIdentifier
Returns:
The plan specific portion of the name (without the project and/or parent's names). You probably want to use PlanIdentifier.getName()

setBuildName

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

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface DescriptionProvider

setDescription

public void setDescription(@Nullable
                           java.lang.String description)
Specified by:
setDescription in interface Describable

getType

@NotNull
public java.lang.String getType()
Description copied from interface: ImmutablePlan
Returns the string representation of the type. See PlanType and used in Freemarker.

Specified by:
getType in interface ImmutablePlan
Returns:
the string representation of the type

hasMaster

public boolean hasMaster()
Specified by:
hasMaster in interface ImmutablePlan
Returns:
true if plan has a master plan

isMarkedForDeletion

public boolean isMarkedForDeletion()
Description copied from interface: ImmutablePlan
Is the plan set to be deleted in the future

Specified by:
isMarkedForDeletion in interface ImmutableDeletable
Specified by:
isMarkedForDeletion in interface ImmutablePlan
Returns:
Whether or not the Object has been marked for deletion

setMarkedForDeletion

public void setMarkedForDeletion(boolean markedForDeletion)
Specified by:
setMarkedForDeletion in interface Deletable

setSuspendedFromBuilding

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

Specified by:
setSuspendedFromBuilding in interface Plan

isSuspendedFromBuilding

public boolean isSuspendedFromBuilding()
Description copied from interface: PlanIdentifier
Checks if the build has been enabled / disabled.

Specified by:
isSuspendedFromBuilding in interface PlanIdentifier
Returns:
true if plan is disabled

isBusy

public boolean isBusy()
Description copied from interface: ImmutablePlan
Is the Plan "busy". Busy is defined by the plan having a lock held on it. This is done during change detection, dependency listner and the like

Specified by:
isBusy in interface ImmutablePlan
Returns:
busy

getBuildLogger

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

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

getLastBuildNumber

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

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

getFirstBuildNumber

public int getFirstBuildNumber()
Description copied from interface: ImmutablePlan
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 ImmutablePlan
Returns:
The number of the first build

setLastBuildNumber

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

setFirstBuildNumber

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

getTestClasses

@NotNull
public java.util.List<TestClass> getTestClasses()

setTestClasses

public void setTestClasses(java.util.List<TestClass> testCases)

getLatestResultsSummary

@Nullable
public ResultsSummary getLatestResultsSummary()
Description copied from interface: ImmutablePlan
Get the latest finished result

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

hasTests

@Deprecated
public boolean hasTests()
Deprecated. 

Description copied from interface: ImmutablePlan
Do any of TaskDefinition being used in the plan implement TaskTestResultsSupport

Specified by:
hasTests in interface ImmutablePlan

getVariables

@NotNull
public java.util.List<VariableDefinition> getVariables()
Description copied from interface: ImmutablePlan
Return list of VariableDefinitions bind to this Plan

Specified by:
getVariables in interface ImmutablePlan
Returns:
non-null list of VariableDefinition

getEffectiveVariables

@NotNull
public java.util.List<VariableDefinition> getEffectiveVariables()
Description copied from interface: ImmutablePlan
Return effective list of VariableDefinitions bind to this Plan. For master Plans this will return the same result as ImmutablePlan.getVariables(). Non-master plans will produce the sum of: - all master's variables which keys do not appear in result of ImmutablePlan.getVariables() - result of ImmutablePlan.getVariables()

Specified by:
getEffectiveVariables in interface ImmutablePlan
Returns:
non-null list of VariableDefinition

setProject

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

getNextBuildNumber

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

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

setNextBuildNumber

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

getBuildDefinition

@NotNull
public BuildDefinition getBuildDefinition()
Description copied from interface: ImmutablePlan
Returns the BuildDefinition that backs this Plan

Specified by:
getBuildDefinition in interface ImmutablePlan
Returns:
BuildDefinition object.

getProject

@NotNull
public Project getProject()
Description copied from interface: ImmutablePlan
Returns the parent Project

Specified by:
getProject in interface ImmutablePlan
Specified by:
getProject in interface PlanIdentifier
Returns:
Project. Never null

getBuildDefinitionXml

@Nullable
public BuildDefinitionForBuild getBuildDefinitionXml()
Specified by:
getBuildDefinitionXml in interface ImmutablePlan

setBuildDefinitionXml

public void setBuildDefinitionXml(@Nullable
                                  BuildDefinitionForBuild buildDefinitionXml)
Specified by:
setBuildDefinitionXml in interface Plan

getLabellings

@NotNull
public java.util.List<Labelling> getLabellings()
Description copied from interface: Plan
Used only for Hibernate mapping purposes. Deprecated for removal from the interface

Specified by:
getLabellings in interface Plan
Returns:

getRelatedLabellings

@NotNull
public java.util.List<Labelling> getRelatedLabellings()
Description copied from interface: Plan
Returns labellings that's application for the plan level

Specified by:
getRelatedLabellings in interface Plan
Returns:
Empty list if no labels

getLabelNames

@NotNull
public java.util.List<java.lang.String> getLabelNames()
Description copied from interface: ImmutablePlan
Returns all the names of related labels with a namesapce of :label

Specified by:
getLabelNames in interface ImmutablePlan
Returns:

setLabellings

public void setLabellings(java.util.List<Labelling> labellings)
Specified by:
setLabellings in interface Plan

setPlanExecutionManager

public void setPlanExecutionManager(PlanExecutionManager planExecutionManager)

setBuildDefinitionManager

public void setBuildDefinitionManager(BuildDefinitionManager buildDefinitionManager)

setBuildLoggerManager

public void setBuildLoggerManager(BuildLoggerManager buildLoggerManager)

setTaskManager

public void setTaskManager(TaskManager taskManager)

setResultsSummaryManager

public void setResultsSummaryManager(ResultsSummaryManager resultsSummaryManager)

setVariableDefinitionManager

public void setVariableDefinitionManager(VariableDefinitionManager variableDefinitionManager)

setLabelManager

public void setLabelManager(LabelManager labelManager)

getDiscriminator

public java.lang.String getDiscriminator()

setDiscriminator

public void setDiscriminator(java.lang.String discriminator)

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(Plan plan)
Specified by:
compareTo in interface java.lang.Comparable<Plan>


Copyright © 2012 Atlassian. All Rights Reserved.