com.atlassian.bamboo.plan.cache
Class AbstractImmutableChain

java.lang.Object
  extended by com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
      extended by com.atlassian.bamboo.plan.cache.AbstractImmutableChain
All Implemented Interfaces:
Chain, BambooIdProvider, BambooObject, Deletable, Describable, ImmutableChain, ImmutableDeletable, ImmutablePlan, Plan, PlanIdentifier, DescriptionProvider, NameProvider
Direct Known Subclasses:
ImmutableChainBranchImpl, ImmutableChainImpl

public class AbstractImmutableChain
extends AbstractImmutablePlan
implements Chain


Field Summary
 
Fields inherited from class com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
averageBuildDuration, resultsSummaryManager
 
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
AbstractImmutableChain(Chain chain, BuildLoggerManager buildLoggerManager, ImmutablePlanManager immutablePlanManager, LabelManager labelManager, ResultsSummaryManager resultsSummaryManager, RepositoryDefinitionManager repositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BuildDefinitionManager buildDefinitionManager)
           
 
Method Summary
 ChainStage addNewStage(java.lang.String name, java.lang.String description, boolean manual)
          Adds a new stage and returns the stage
 void addStage(ChainStage chainStage)
           
 boolean containsStage(java.lang.String stageName)
          Checks whether or not a stage exists in this chain by stage name.
 java.util.List<Job> getAllJobs()
          Note: Does not include Jobs that are marked for deletion.
 java.util.List<ChainStage> getAllStages()
          Get Stages of the Chain

Note that this includes ChainStages that have been marked for deletion

 com.google.common.collect.ImmutableList<RepositoryDefinition> getEffectiveRepositoryDefinitions()
          Return list of repositories available to the chain.
 int getJobCount()
          Note: Does not include Jobs that are marked for deletion.
 PlanResultKey getLastResultKey()
          Get the latest result key including active (not finished) results
 ResultsSummary getLatestResultsSummary()
          Get the latest finished result
 Chain getMaster()
          Return the master plan if one exists.
 NotificationSet getNotificationSet()
          Get notifications defined for this plan.
 java.util.List<ChainStage> getStages()
          Get Stages of the chain.
 boolean isActive()
          Is the plan queued or building?
 boolean isBusy()
          Is the Plan "busy".
 boolean isExecuting()
          Is the build currently being executed?
 void removeStage(ChainStage chainStage)
           
 void setNotificationSet(NotificationSet notificationSet)
           
 
Methods inherited from class com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
compareTo, equals, exceptionOnModification, getAverageBuildDuration, getBuildDefinition, getBuildDefinitionXml, getBuildKey, getBuildLogger, getBuildName, getCurrentStatus, getDescription, getEffectiveVariables, getFirstBuildNumber, getId, getKey, getLabellings, getLabelNames, getLastBuildNumber, getName, getNextBuildNumber, getPlanKey, getPlanType, getProject, getRelatedLabellings, getType, getVariables, hashCode, hasMaster, hasTests, isMarkedForDeletion, isSuspendedFromBuilding, setBuildDefinitionXml, setBuildKey, setBuildName, setDescription, setFirstBuildNumber, setId, setKey, setLabellings, setLastBuildNumber, setMarkedForDeletion, setMaster, setName, setNextBuildNumber, setPlanKey, setProject, setSuspendedFromBuilding, validateBuild
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.plan.Plan
getLabellings, getRelatedLabellings, setBuildDefinitionXml, setBuildKey, setBuildName, setFirstBuildNumber, setKey, setLabellings, setLastBuildNumber, setMaster, setNextBuildNumber, setPlanKey, setProject, setSuspendedFromBuilding, validateBuild
 
Methods inherited from interface com.atlassian.bamboo.Describable
setDescription, setName
 
Methods inherited from interface com.atlassian.bamboo.deletion.Deletable
setMarkedForDeletion
 
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
 
Methods inherited from interface com.atlassian.bamboo.plan.cache.ImmutableDeletable
isMarkedForDeletion
 
Methods inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
getAverageBuildDuration, getBuildDefinition, getBuildDefinitionXml, getBuildLogger, getCurrentStatus, getEffectiveVariables, getFirstBuildNumber, getKey, getLabelNames, getLastBuildNumber, getNextBuildNumber, getProject, getType, getVariables, hasMaster, hasTests, isMarkedForDeletion
 
Methods inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
getBuildKey, getBuildName, getId, getName, getPlanKey, getPlanType, isSuspendedFromBuilding
 

Constructor Detail

AbstractImmutableChain

public AbstractImmutableChain(@NotNull
                              Chain chain,
                              BuildLoggerManager buildLoggerManager,
                              ImmutablePlanManager immutablePlanManager,
                              LabelManager labelManager,
                              ResultsSummaryManager resultsSummaryManager,
                              RepositoryDefinitionManager repositoryDefinitionManager,
                              VariableDefinitionManager variableDefinitionManager,
                              BuildDefinitionManager buildDefinitionManager)
Method Detail

isActive

public boolean isActive()
Description copied from interface: ImmutablePlan
Is the plan queued or building?

Specified by:
isActive in interface ImmutablePlan
Returns:

isExecuting

public boolean isExecuting()
Description copied from interface: ImmutablePlan
Is the build currently being executed?

Specified by:
isExecuting in interface ImmutablePlan
Returns:
true if build is being executed

getLastResultKey

public PlanResultKey getLastResultKey()
Description copied from interface: ImmutableChain
Get the latest result key including active (not finished) results

Specified by:
getLastResultKey in interface ImmutableChain
Returns:
The key of the last build. Returns null if there are no build results for this plan

getLatestResultsSummary

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

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

getStages

@NotNull
public java.util.List<ChainStage> getStages()
Description copied from interface: ImmutableChain
Get Stages of the chain.

Note that this excludes ChainStages that have been marked for deletion

Specified by:
getStages in interface Chain
Specified by:
getStages in interface ImmutableChain
Returns:
stages

getAllStages

@NotNull
public java.util.List<ChainStage> getAllStages()
Description copied from interface: Chain
Get Stages of the Chain

Note that this includes ChainStages that have been marked for deletion

Specified by:
getAllStages in interface Chain
Specified by:
getAllStages in interface ImmutableChain
Returns:
stages

getJobCount

public int getJobCount()
Description copied from interface: ImmutableChain
Note: Does not include Jobs that are marked for deletion.

Specified by:
getJobCount in interface ImmutableChain
Returns:
how many Jobs are currently contained within this chain

getAllJobs

@NotNull
public java.util.List<Job> getAllJobs()
Description copied from interface: Chain
Note: Does not include Jobs that are marked for deletion.

Specified by:
getAllJobs in interface Chain
Specified by:
getAllJobs in interface ImmutableChain
Returns:
a list of all Jobs that are currently contained within this chain - no order guaranteed.

containsStage

public boolean containsStage(@Nullable
                             java.lang.String stageName)
Description copied from interface: ImmutableChain
Checks whether or not a stage exists in this chain by stage name.

Specified by:
containsStage in interface ImmutableChain
Parameters:
stageName - to check for
Returns:
true if a stage with the given name exists, otherwise false

getEffectiveRepositoryDefinitions

@NotNull
public com.google.common.collect.ImmutableList<RepositoryDefinition> getEffectiveRepositoryDefinitions()
Description copied from interface: ImmutableChain
Return list of repositories available to the chain. In case of non-master object it will return list of master's repository definitions with default repository overriden by a private copy of default repository.

Specified by:
getEffectiveRepositoryDefinitions in interface ImmutableChain
Returns:
ordered List of repositories available to this plan

getNotificationSet

public NotificationSet getNotificationSet()
Description copied from interface: ImmutableChain
Get notifications defined for this plan.

Specified by:
getNotificationSet in interface ImmutableChain
Returns:
NotificationSet containing notifications for this plan.

getMaster

public Chain getMaster()
Description copied from interface: ImmutablePlan
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.

Specified by:
getMaster in interface Chain
Specified by:
getMaster in interface ImmutablePlan
Returns:
the master Plan if one exists.

addNewStage

@NotNull
public ChainStage addNewStage(@NotNull
                                      java.lang.String name,
                                      @NotNull
                                      java.lang.String description,
                                      boolean manual)
Description copied from interface: Chain
Adds a new stage and returns the stage

Specified by:
addNewStage in interface Chain
Returns:

addStage

public void addStage(@NotNull
                     ChainStage chainStage)
Specified by:
addStage in interface Chain

removeStage

public void removeStage(@NotNull
                        ChainStage chainStage)
Specified by:
removeStage in interface Chain

setNotificationSet

public void setNotificationSet(NotificationSet notificationSet)
Specified by:
setNotificationSet in interface Chain


Copyright © 2012 Atlassian. All Rights Reserved.