Package com.atlassian.bamboo.plan.cache
Interface ImmutablePlan
-
- All Superinterfaces:
BambooIdProvider
,DescriptionProvider
,ImmutableDeletable
,ImmutableEntityWithOid
,NameProvider
,PlanIdentifier
,PlanKeyProvider
,Versionable
- All Known Subinterfaces:
Buildable
,Chain
,ChainBranch
,ImmutableBuildable
,ImmutableChain
,ImmutableChainBranch
,ImmutableJob
,ImmutableTopLevelPlan
,Job
,Plan
,TopLevelPlan
- All Known Implementing Classes:
AbstractChain
,AbstractImmutableChain
,AbstractImmutablePlan
,AbstractPlan
,ChainBranchImpl
,DefaultChain
,DefaultJob
,ImmutableChainBranchImpl
,ImmutableChainImpl
,ImmutableJobImpl
public interface ImmutablePlan extends PlanIdentifier, ImmutableDeletable, ImmutableEntityWithOid, Versionable
Represents aPlan
that is immutable. Since 3.4, all new uses of Chains should prefer this interface to improve cacheability.- Since:
- v3.4
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_PREVIOUS_BUILD_FOR_AVE
static String
STATUS_CURRENTLY_BUILDING
static String
STATUS_FAIL
static String
STATUS_NO_BUILDS
static String
STATUS_NOT_RUN
static String
STATUS_SUCCESS
-
Fields inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
NAME_DELIMITER
-
Fields inherited from interface com.atlassian.bamboo.plan.PlanKeyProvider
getPlanKey
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description long
getAverageBuildDuration()
Returns an average duration of the recent builds@NotNull BuildDefinition
getBuildDefinition()
Returns theBuildDefinition
that backs thisPlan
@NotNull BuildLogger
getBuildLogger()
Returns the helper object to deal with logging@NotNull String
getCurrentStatus()
@NotNull List<VariableDefinition>
getEffectiveVariables()
Return effective list ofVariableDefinition
s 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!@NotNull String
getKey()
Obtain the plan's unique key (uppercase alphanumeric).@NotNull List<String>
getLabelNames()
int
getLastBuildNumber()
What was the number of the latest build (may be being built)@Nullable ImmutableResultsSummary
getLatestResultsSummary()
Get the latest finished result@Nullable ImmutablePlan
getMaster()
Return the master plan if one exists.@NotNull Project
getProject()
Returns the parentProject
@NotNull String
getType()
Deprecated.UsePlanIdentifier.getPlanType()
instead.@NotNull List<VariableDefinition>
getVariables()
Return list ofVariableDefinition
s bind to this Planboolean
hasMaster()
boolean
isActive()
Deprecated.since 4.0 useChainExecutionAccessor.isActive(PlanKey)
boolean
isBusy()
Deprecated.since 4.0 usePlanExecutionManager.isBusy(PlanKey)
boolean
isExecuting()
Deprecated.since 6.10 useChainExecutionAccessor.isExecuting(PlanKey)
boolean
isMarkedForDeletion()
Is the plan set to be deleted in the future-
Methods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescription
-
Methods inherited from interface com.atlassian.bamboo.core.ImmutableEntityWithOid
getEntityType, getOid
-
Methods inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
getBuildKey, getBuildName, getDatabaseId, getId, getMasterId, getMasterIdIfExists, getName, getPlanKey, getPlanType, isSuspendedFromBuilding
-
Methods inherited from interface com.atlassian.bamboo.versioning.Versionable
getVersion
-
-
-
-
Field Detail
-
MAX_PREVIOUS_BUILD_FOR_AVE
static final int MAX_PREVIOUS_BUILD_FOR_AVE
- See Also:
- Constant Field Values
-
STATUS_FAIL
static final String STATUS_FAIL
- See Also:
- Constant Field Values
-
STATUS_SUCCESS
static final String STATUS_SUCCESS
- See Also:
- Constant Field Values
-
STATUS_CURRENTLY_BUILDING
static final String STATUS_CURRENTLY_BUILDING
- See Also:
- Constant Field Values
-
STATUS_NO_BUILDS
static final String STATUS_NO_BUILDS
- See Also:
- Constant Field Values
-
STATUS_NOT_RUN
static final String STATUS_NOT_RUN
- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
@NotNull @Deprecated @NotNull String getType()
Deprecated.UsePlanIdentifier.getPlanType()
instead. Since v4.0.Returns the string representation of the type. SeePlanType
and used in Freemarker.- Returns:
- the string representation of the type
-
getKey
@NotNull @NotNull String getKey()
Obtain the plan's unique key (uppercase alphanumeric). This includes the project prefix e.g. BAM-MAIN. PreferPlanIdentifier.getPlanKey()
- Returns:
- The full key
-
getCurrentStatus
@NotNull @NotNull String getCurrentStatus()
- Returns:
- a string key as to what the status is. Can be "success", "failure", "current", "none" or "notRun". Mainly used for UI purposes.
-
isExecuting
@Deprecated boolean isExecuting()
Deprecated.since 6.10 useChainExecutionAccessor.isExecuting(PlanKey)
Is the build currently being executed?- Returns:
- true if build is being executed
-
getBuildLogger
@NotNull @NotNull BuildLogger getBuildLogger()
Returns the helper object to deal with logging- Returns:
- A
BuildLogger
.
-
isActive
@Deprecated boolean isActive()
Deprecated.since 4.0 useChainExecutionAccessor.isActive(PlanKey)
Is the plan queued or building?
-
isBusy
@Deprecated boolean isBusy()
Deprecated.since 4.0 usePlanExecutionManager.isBusy(PlanKey)
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- Returns:
- busy
-
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
-
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
-
getAverageBuildDuration
long getAverageBuildDuration()
Returns an average duration of the recent builds- Returns:
- The duration in milliseconds
-
isMarkedForDeletion
boolean isMarkedForDeletion()
Is the plan set to be deleted in the future- Specified by:
isMarkedForDeletion
in interfaceImmutableDeletable
- Returns:
- Whether or not the Object has been marked for deletion
-
getBuildDefinition
@NotNull @NotNull BuildDefinition getBuildDefinition()
Returns theBuildDefinition
that backs thisPlan
- Returns:
BuildDefinition
object.
-
getProject
@NotNull @NotNull Project getProject()
Returns the parentProject
- Specified by:
getProject
in interfacePlanIdentifier
- Returns:
Project
. Never null
-
getLabelNames
@NotNull @NotNull List<String> getLabelNames()
- Returns:
- all the names of related labels with a namespace of :label
-
getLatestResultsSummary
@Nullable @Nullable ImmutableResultsSummary getLatestResultsSummary()
Get the latest finished result- Returns:
- The summary info for the last completed build. Returns null if there are no build results for this plan
-
getVariables
@NotNull @NotNull List<VariableDefinition> getVariables()
Return list ofVariableDefinition
s bind to this Plan- Returns:
- non-null list of
VariableDefinition
-
getEffectiveVariables
@NotNull @NotNull List<VariableDefinition> getEffectiveVariables()
Return effective list ofVariableDefinition
s bind to this Plan. For master Plans this will return the same result asgetVariables()
. Non-master plans will produce the sum of: - all master's variables which keys do not appear in result ofgetVariables()
- result ofgetVariables()
- Returns:
- non-null list of
VariableDefinition
-
getMaster
@Nullable @Nullable ImmutablePlan getMaster()
Return the master plan if one exists. The master is the plan which this one is derived from. Configuration is pulled from the master if one exists.- Returns:
- the master
Plan
if one exists.
-
hasMaster
boolean hasMaster()
- Returns:
- true if plan has a master plan
-
-