com.atlassian.bamboo.plan.cache
Interface ImmutablePlan

All Superinterfaces:
BambooIdProvider, DescriptionProvider, NameProvider, PlanIdentifier
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, PlanPermissionSkeleton

public interface ImmutablePlan
extends PlanIdentifier

Represents a Plan that is immutable. Since 3.4, all new uses of Chains should prefer this interface to improve cacheability.

Since:
v3.4

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
           
 
Fields inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
getPlanKeyFunction
 
Method Summary
 long getAverageBuildDuration()
          Returns an average duration of the recent builds
 BuildDefinition getBuildDefinition()
          Returns the BuildDefinition that backs this Plan
 BuildLogger getBuildLogger()
          Returns the helper object to deal with logging
 java.lang.String getCurrentStatus()
          Retuns a string key as to what the status is.
 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<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)
 ImmutableResultsSummary getLatestResultsSummary()
          Get the latest finished result
 ImmutablePlan getMaster()
          Return the master plan if one exists.
 int getNextBuildNumber()
          The next build number represents the number of the next build result that's to be executed
 Project getProject()
          Returns the parent Project
 java.lang.String getType()
          Deprecated. Use PlanIdentifier.getPlanType() instead. Since v4.0.
 java.util.List<VariableDefinition> getVariables()
          Return list of VariableDefinitions bind to this Plan
 boolean hasMaster()
           
 boolean isActive()
          Deprecated. since 4.0 use ChainExecutionManager.isActive(PlanKey) or PlanExecutionManager#isActive(PlanKey)
 boolean isBusy()
          Deprecated. since 4.0 use PlanExecutionManager.isBusy(PlanKey) or ChainExecutionManager#isBusy(PlanKey)
 boolean isExecuting()
          Is the build currently being executed?
 boolean isMarkedForDeletion()
          Is the plan set to be deleted in the future
 
Methods inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
getBuildKey, getBuildName, getId, getMasterId, getName, getPlanKey, getPlanType, isSuspendedFromBuilding
 
Methods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescription
 

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

getType

@NotNull
@Deprecated
java.lang.String getType()
Deprecated. Use PlanIdentifier.getPlanType() instead. Since v4.0.

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

Returns:
the string representation of the type

getKey

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

Returns:
The full key

getCurrentStatus

@NotNull
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:

isExecuting

boolean isExecuting()
Is the build currently being executed?

Returns:
true if build is being executed

getBuildLogger

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

Returns:
A BuildLogger. @NotNull

isActive

@Deprecated
boolean isActive()
Deprecated. since 4.0 use ChainExecutionManager.isActive(PlanKey) or PlanExecutionManager#isActive(PlanKey)

Is the plan queued or building?

Returns:

isBusy

@Deprecated
boolean isBusy()
Deprecated. since 4.0 use PlanExecutionManager.isBusy(PlanKey) or ChainExecutionManager#isBusy(PlanKey)

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

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

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

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

Returns:

getBuildDefinition

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

Returns:
BuildDefinition object.

getProject

@NotNull
Project getProject()
Returns the parent Project

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

getLabelNames

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

Returns:

getLatestResultsSummary

@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
java.util.List<VariableDefinition> getVariables()
Return list of VariableDefinitions bind to this Plan

Returns:
non-null list of VariableDefinition

getEffectiveVariables

@NotNull
java.util.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:
non-null list of VariableDefinition

getMaster

@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


Copyright © 2014 Atlassian Software Systems Pty Ltd. All Rights Reserved.