Package com.atlassian.bamboo.plan
Class AbstractPlan
java.lang.Object
com.atlassian.core.bean.EntityObject
com.atlassian.bamboo.core.BambooEntityObject
com.atlassian.bamboo.core.BambooEntityWithOid
com.atlassian.bamboo.hibernate.HibernateBambooEntityWithOid
com.atlassian.bamboo.plan.AbstractPlan
- All Implemented Interfaces:
BambooIdProvider
,BambooObject
,BambooObjectWithOid
,EntityWithOid
,ImmutableEntityWithOid
,Deletable
,Describable
,ImmutableDeletable
,ImmutablePlan
,Plan
,PlanIdentifier
,PlanKeyProvider
,DescriptionProvider
,NameProvider
,Versionable
,Cloneable
,Comparable<Plan>
- Direct Known Subclasses:
AbstractChain
,DefaultJob
@MappedSuperclass
public abstract class AbstractPlan
extends HibernateBambooEntityWithOid
implements ImmutablePlan, Plan, Comparable<Plan>
This plan is only partially migrated to annotation-based Hibernate model, to allow creating queries using the new
query mechanism. "Plan.hbm.xml" is still the source of truth for this entity.
-
Field Summary
Fields inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
MAX_PREVIOUS_BUILD_FOR_AVE, STATUS_CURRENTLY_BUILDING, STATUS_FAIL, STATUS_NO_BUILDS, STATUS_NOT_RUN, STATUS_SUCCESS
Fields inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
NAME_DELIMITER
Fields inherited from interface com.atlassian.bamboo.plan.PlanKeyProvider
getPlanKey
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
@NotNull BuildDefinition
Returns theBuildDefinition
that backs thisPlan
@Nullable BuildDefinitionForBuild
@NotNull String
This objects specific portion of the key.@NotNull BuildLogger
Returns the helper object to deal with logging@NotNull String
@NotNull List<VariableDefinition>
Return effective list ofVariableDefinition
s bind to this Plan.int
What the number of the first build we have? It may not be 1 as some may have been removed!@NotNull String
getKey()
Obtain the plan's unique key (uppercase alphanumeric).Used only for Hibernate mapping purposes.int
What was the number of the latest build (may be being built)@Nullable ResultsSummary
Get the latest finished resultlong
@NotNull String
getName()
Returns the full name for the build in the form of "project name - build name" e.g.@NotNull PlanKey
@NotNull Project
Returns the parentProject
Returns labellings that are applicable for the plan level@NotNull String
getType()
Returns the string representation of the type.@NotNull List<VariableDefinition>
Return list ofVariableDefinition
s bind to this Plan@NotNull Long
Returns the version number of this object.int
hashCode()
boolean
boolean
isBusy()
Is thePlan
"busy".boolean
Is the plan set to be deleted in the futureboolean
Checks if the build has been enabled / disabled.void
setBuildDefinitionManager
(BuildDefinitionManager buildDefinitionManager) void
setBuildDefinitionXml
(@Nullable BuildDefinitionForBuild buildDefinitionXml) void
setBuildKey
(String buildKey) Define the build's unique key (uppercase alphanumeric)void
setBuildLoggerManager
(BuildLoggerManager buildLoggerManager) void
setBuildName
(String buildName) void
setDescription
(@Nullable String description) void
setDiscriminator
(String discriminator) void
setInternalResultsSummaryAccessor
(InternalResultsSummaryAccessor internalResultsSummaryAccessor) void
void
setLabellings
(List<Labelling> labellings) void
setLabelManager
(LabelManager labelManager) void
setMarkedForDeletion
(boolean markedForDeletion) void
void
setPlanExecutionManager
(PlanExecutionManager planExecutionManager) void
setPlanKey
(@NotNull PlanKey planKey) void
setProject
(Project project) void
setSuspendedFromBuilding
(boolean suspendedFromBuilding) Sets the build to suspend temporarilyvoid
setVariableDefinitionManager
(VariableDefinitionManager variableDefinitionManager) void
setVersion
(@NotNull Long version) Methods inherited from class com.atlassian.bamboo.hibernate.HibernateBambooEntityWithOid
getId, getOid, setId, setOid
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
setId
Methods inherited from interface com.atlassian.bamboo.core.EntityWithOid
setOid
Methods inherited from interface com.atlassian.bamboo.core.ImmutableEntityWithOid
getEntityType, getOid
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 Details
-
internalResultsSummaryAccessor
-
-
Constructor Details
-
AbstractPlan
public AbstractPlan()
-
-
Method Details
-
getDatabaseId
- Specified by:
getDatabaseId
in interfacePlanIdentifier
- Returns:
- database id of the plan or empty if this plan is not a DB object.
-
getPlanKey
Description copied from interface:PlanIdentifier
- Specified by:
getPlanKey
in interfacePlanIdentifier
- Specified by:
getPlanKey
in interfacePlanKeyProvider
- Returns:
- planKey
-
getKey
Description copied from interface:ImmutablePlan
Obtain the plan's unique key (uppercase alphanumeric). This includes the project prefix e.g. BAM-MAIN. PreferPlanIdentifier.getPlanKey()
- Specified by:
getKey
in interfaceImmutablePlan
- Returns:
- The full key
-
setKey
-
setPlanKey
- Specified by:
setPlanKey
in interfacePlan
-
getBuildKey
Description copied from interface:PlanIdentifier
This objects specific portion of the key. You probably want to usePlanIdentifier.getPlanKey()
.- Specified by:
getBuildKey
in interfacePlanIdentifier
- Returns:
- This objects specific portion of the key
-
setBuildKey
Description copied from interface:Plan
Define the build's unique key (uppercase alphanumeric)- Specified by:
setBuildKey
in interfacePlan
- Parameters:
buildKey
- The value of the key
-
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 interfaceDescriptionProvider
- Specified by:
getName
in interfaceNameProvider
- Specified by:
getName
in interfacePlanIdentifier
- Returns:
- String
-
setName
- Specified by:
setName
in interfaceDescribable
-
getBuildName
- Specified by:
getBuildName
in interfacePlanIdentifier
- Returns:
- The plan specific portion of the name (without the project and/or parent's names). You probably want to use
PlanIdentifier.getName()
-
setBuildName
- Specified by:
setBuildName
in interfacePlan
-
getDescription
- Specified by:
getDescription
in interfaceDescriptionProvider
-
setDescription
- Specified by:
setDescription
in interfaceDescribable
-
getType
Description copied from interface:ImmutablePlan
Returns the string representation of the type. SeePlanType
and used in Freemarker.- Specified by:
getType
in interfaceImmutablePlan
- Returns:
- the string representation of the type
-
hasMaster
public boolean hasMaster()- Specified by:
hasMaster
in interfaceImmutablePlan
- 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 interfaceImmutableDeletable
- Specified by:
isMarkedForDeletion
in interfaceImmutablePlan
- Returns:
- Whether or not the Object has been marked for deletion
-
setMarkedForDeletion
public void setMarkedForDeletion(boolean markedForDeletion) - Specified by:
setMarkedForDeletion
in interfaceDeletable
-
setSuspendedFromBuilding
public void setSuspendedFromBuilding(boolean suspendedFromBuilding) Description copied from interface:Plan
Sets the build to suspend temporarily- Specified by:
setSuspendedFromBuilding
in interfacePlan
-
isSuspendedFromBuilding
public boolean isSuspendedFromBuilding()Description copied from interface:PlanIdentifier
Checks if the build has been enabled / disabled.- Specified by:
isSuspendedFromBuilding
in interfacePlanIdentifier
- Returns:
- true if plan is disabled
-
isBusy
public boolean isBusy()Description copied from interface:ImmutablePlan
Is thePlan
"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 interfaceImmutablePlan
- Returns:
- busy
-
getBuildLogger
Description copied from interface:ImmutablePlan
Returns the helper object to deal with logging- Specified by:
getBuildLogger
in interfaceImmutablePlan
- Returns:
- A
BuildLogger
.
-
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 interfaceImmutablePlan
- 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 interfaceImmutablePlan
- Returns:
- The number of the first build
-
getLatestResultsSummary
Description copied from interface:ImmutablePlan
Get the latest finished result- Specified by:
getLatestResultsSummary
in interfaceImmutablePlan
- Specified by:
getLatestResultsSummary
in interfacePlan
- Returns:
- The summary info for the last completed build. Returns null if there are no build results for this plan
-
getVariables
Description copied from interface:ImmutablePlan
Return list ofVariableDefinition
s bind to this Plan- Specified by:
getVariables
in interfaceImmutablePlan
- Returns:
- non-null list of
VariableDefinition
-
getEffectiveVariables
Description copied from interface:ImmutablePlan
Return effective list ofVariableDefinition
s bind to this Plan. For master Plans this will return the same result asImmutablePlan.getVariables()
. Non-master plans will produce the sum of: - all master's variables which keys do not appear in result ofImmutablePlan.getVariables()
- result ofImmutablePlan.getVariables()
- Specified by:
getEffectiveVariables
in interfaceImmutablePlan
- Returns:
- non-null list of
VariableDefinition
-
setProject
- Specified by:
setProject
in interfacePlan
-
getBuildDefinition
Description copied from interface:ImmutablePlan
Returns theBuildDefinition
that backs thisPlan
- Specified by:
getBuildDefinition
in interfaceImmutablePlan
- Returns:
BuildDefinition
object.
-
getProject
Description copied from interface:ImmutablePlan
Returns the parentProject
- Specified by:
getProject
in interfaceImmutablePlan
- Specified by:
getProject
in interfacePlanIdentifier
- Returns:
Project
. Never null
-
getMasterId
public long getMasterId()- Specified by:
getMasterId
in interfacePlanIdentifier
- Returns:
- database id of master of this Plan or -1 if none.
-
getMasterIdIfExists
- Specified by:
getMasterIdIfExists
in interfacePlanIdentifier
- Returns:
- database id of master of this Plan or empty if none.
-
getBuildDefinitionXml
- Specified by:
getBuildDefinitionXml
in interfacePlan
-
setBuildDefinitionXml
- Specified by:
setBuildDefinitionXml
in interfacePlan
-
getLabellings
Description copied from interface:Plan
Used only for Hibernate mapping purposes. Deprecated for removal from the interface- Specified by:
getLabellings
in interfacePlan
- Returns:
-
getRelatedLabellings
Description copied from interface:Plan
Returns labellings that are applicable for the plan level- Specified by:
getRelatedLabellings
in interfacePlan
- Returns:
- Empty list if no labels
-
getLabelNames
- Specified by:
getLabelNames
in interfaceImmutablePlan
- Returns:
- all the names of related labels with a namespace of :label
-
setLabellings
- Specified by:
setLabellings
in interfacePlan
-
setPlanExecutionManager
-
setBuildDefinitionManager
-
setBuildLoggerManager
-
setInternalResultsSummaryAccessor
public void setInternalResultsSummaryAccessor(InternalResultsSummaryAccessor internalResultsSummaryAccessor) -
setVariableDefinitionManager
-
setLabelManager
-
getDiscriminator
-
setDiscriminator
-
getVersion
Description copied from interface:Versionable
Returns the version number of this object.- Specified by:
getVersion
in interfaceVersionable
- Returns:
- the version number
-
setVersion
-
hashCode
public int hashCode()- Overrides:
hashCode
in classcom.atlassian.core.bean.EntityObject
-
equals
- Overrides:
equals
in classcom.atlassian.core.bean.EntityObject
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Plan>
-