Package com.atlassian.bamboo.plan
Class AbstractChain
java.lang.Object
com.atlassian.core.bean.EntityObject
- All Implemented Interfaces:
Chain,BambooIdProvider,BambooObject,BambooObjectWithOid,EntityWithOid,ImmutableEntityWithOid,Deletable,Describable,ImmutableChain,ImmutableDeletable,ImmutablePlan,Plan,PlanIdentifier,PlanKeyProvider,Triggerable,DescriptionProvider,NameProvider,Versionable,Cloneable,Comparable<Plan>
- Direct Known Subclasses:
ChainBranchImpl,DefaultChain
-
Field Summary
FieldsFields inherited from class com.atlassian.bamboo.plan.AbstractPlan
internalResultsSummaryAccessorFields 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_SUCCESSFields inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
NAME_DELIMITERFields inherited from interface com.atlassian.bamboo.plan.PlanKeyProvider
getPlanKey -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddNewStage(@NotNull String name, @NotNull String description, boolean manual) Adds a new stage and returns the stagevoidaddStage(int index, @NotNull ChainStage chainStage) Add stage at given index.voidaddStage(@NotNull ChainStage chainStage) booleancontainsStage(@Nullable String stageName) Checks whether or not a stage exists in this chain by stage name.Note: Does not include Jobs that are marked for deletion.@NotNull List<ChainStage>Get Stages of the ChainlongReturns an average duration of the recent builds@NotNull StringintNote: Does not include Jobs that are marked for deletion.Get the latest result key including active (not finished) resultsReturn the master plan if one exists.Get notifications defined for this plan.final NotificationSetRaw access to notification set field used in import/export, upgrade tasks and Hibernate.@NotNull List<PlanRepositoryDefinition>Return list of repositories available to the chain.@NotNull List<ChainStage>Get Stages of the chain.@NotNull List<TriggerDefinition>@Nullable VcsBambooSpecsSourcebooleanisActive()Needed for Dependency Blocking for Chains.booleanIs the build currently being executed?booleanvoidremoveStage(long chainStageId) voidremoveStagesIf(@NotNull Predicate<ChainStage> predicate) Remove all stages matching a predicate.voidsetAllStages(@NotNull List<ChainStage> allStages) voidsetBambooSpecsManager(BambooSpecsManager bambooSpecsManager) voidsetChainExecutionManager(ChainExecutionManager chainExecutionManager) voidsetNotificationSet(NotificationSet notificationSet) voidsetRepositoryDefinitionManager(RepositoryDefinitionManager repositoryDefinitionManager) voidsetStorageTag(ChainStorageTag storageTag) voidsetVcsBambooSpecsSource(@NotNull VcsBambooSpecsSource newValue) Internal use only.Methods inherited from class com.atlassian.bamboo.plan.AbstractPlan
compareTo, equals, getBuildDefinition, getBuildDefinitionXml, getBuildKey, getBuildLogger, getBuildName, getDatabaseId, getDescription, getDiscriminator, getEffectiveVariables, getFirstBuildNumber, getKey, getLabellings, getLabelNames, getLastBuildNumber, getLatestResultsSummary, getMasterId, getMasterIdIfExists, getName, getPlanKey, getProject, getRelatedLabellings, getType, getVariables, getVersion, hashCode, hasMaster, isBusy, isMarkedForDeletion, isSuspendedFromBuilding, setBuildDefinitionManager, setBuildDefinitionXml, setBuildKey, setBuildLoggerManager, setBuildName, setDescription, setDiscriminator, setInternalResultsSummaryAccessor, setKey, setLabellings, setLabelManager, setMarkedForDeletion, setName, setPlanExecutionManager, setPlanKey, setProject, setSuspendedFromBuilding, setVariableDefinitionManager, setVersionMethods inherited from class com.atlassian.bamboo.hibernate.HibernateBambooEntityWithOid
getId, getOid, setId, setOidMethods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getLastModificationDate, setClock, setCreationDate, setLastModificationDateMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.core.BambooObject
setIdMethods inherited from interface com.atlassian.bamboo.deletion.Deletable
setMarkedForDeletionMethods inherited from interface com.atlassian.bamboo.Describable
setDescription, setNameMethods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescriptionMethods inherited from interface com.atlassian.bamboo.core.EntityWithOid
setOidMethods inherited from interface com.atlassian.bamboo.plan.cache.ImmutableChain
getCreationDate, getEntityTypeMethods inherited from interface com.atlassian.bamboo.core.ImmutableEntityWithOid
getOidMethods inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
getBuildDefinition, getBuildLogger, getEffectiveVariables, getFirstBuildNumber, getKey, getLabelNames, getLastBuildNumber, getProject, getType, getVariables, hasMaster, isBusy, isMarkedForDeletionMethods inherited from interface com.atlassian.bamboo.plan.Plan
getBuildDefinitionXml, getLabellings, getLatestResultsSummary, getRelatedLabellings, setBuildDefinitionXml, setBuildKey, setBuildName, setKey, setLabellings, setMaster, setPlanKey, setProject, setSuspendedFromBuildingMethods inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
getBuildKey, getBuildName, getDatabaseId, getId, getMasterId, getMasterIdIfExists, getName, getPlanKey, getPlanType, isSuspendedFromBuildingMethods inherited from interface com.atlassian.bamboo.versioning.Versionable
getVersion
-
Field Details
-
NUMBER_OF_RESULTS
public static final int NUMBER_OF_RESULTS- See Also:
-
master
-
-
Constructor Details
-
AbstractChain
public AbstractChain()
-
-
Method Details
-
getStorageTag
- Specified by:
getStorageTagin interfaceImmutableChain
-
setStorageTag
- Specified by:
setStorageTagin interfaceChain
-
getStages
Description copied from interface:ImmutableChainGet Stages of the chain.Note that this excludes
ChainStages that have been marked for deletion- Specified by:
getStagesin interfaceChain- Specified by:
getStagesin interfaceImmutableChain- Returns:
- stages
-
addNewStage
public ChainStage addNewStage(@NotNull @NotNull String name, @NotNull @NotNull String description, boolean manual) Description copied from interface:ChainAdds a new stage and returns the stage- Specified by:
addNewStagein interfaceChain- Returns:
-
addStage
-
addStage
Description copied from interface:ChainAdd stage at given index. -
removeStage
public void removeStage(long chainStageId) - Specified by:
removeStagein interfaceChain
-
removeStagesIf
Description copied from interface:ChainRemove all stages matching a predicate.- Specified by:
removeStagesIfin interfaceChain
-
getJobCount
public int getJobCount()Description copied from interface:ImmutableChainNote: Does not include Jobs that are marked for deletion.- Specified by:
getJobCountin interfaceImmutableChain- Returns:
- how many Jobs are currently contained within this chain
-
getAllJobs
Description copied from interface:ChainNote: Does not include Jobs that are marked for deletion.- Specified by:
getAllJobsin interfaceChain- Specified by:
getAllJobsin interfaceImmutableChain- Returns:
- a list of all Jobs that are currently contained within this chain - no order guaranteed.
-
containsStage
Description copied from interface:ImmutableChainChecks whether or not a stage exists in this chain by stage name.- Specified by:
containsStagein interfaceImmutableChain- Parameters:
stageName- to check for- Returns:
- true if a stage with the given name exists, otherwise false
-
getCurrentStatus
- Specified by:
getCurrentStatusin interfaceImmutablePlan- Returns:
- a string key as to what the status is. Can be "success", "failure", "current", "none" or "notRun". Mainly used for UI purposes.
-
isExecuting
public boolean isExecuting()Description copied from interface:ImmutablePlanIs the build currently being executed?- Specified by:
isExecutingin interfaceImmutablePlan- Returns:
- true if chain is currently being executed
-
isActive
public boolean isActive()Needed for Dependency Blocking for Chains.- Specified by:
isActivein interfaceImmutablePlan- Returns:
- true if chain is currently being queued or executed
-
getLastResultKey
Description copied from interface:ImmutableChainGet the latest result key including active (not finished) results- Specified by:
getLastResultKeyin interfaceImmutableChain- Returns:
- The key of the last build. Returns null if there are no build results for this plan
-
getAverageBuildDuration
public long getAverageBuildDuration()Description copied from interface:ImmutablePlanReturns an average duration of the recent builds- Specified by:
getAverageBuildDurationin interfaceImmutablePlan- Returns:
- The duration in milliseconds
-
getPlanRepositoryDefinitions
Description copied from interface:ImmutableChainReturn 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 overridden by a private copy of default repository.- Specified by:
getPlanRepositoryDefinitionsin interfaceImmutableChain- Returns:
- ordered
Listof repositories available to this plan
-
getNotificationSet
Description copied from interface:ImmutableChainGet notifications defined for this plan.- Specified by:
getNotificationSetin interfaceImmutableChain- Returns:
NotificationSetcontaining notifications for this plan.
-
setNotificationSet
- Specified by:
setNotificationSetin interfaceChain
-
getNotificationSetField
Raw access to notification set field used in import/export, upgrade tasks and Hibernate.- Since:
- 4.2
-
getMaster
Description copied from interface:ImmutablePlanReturn 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:
getMasterin interfaceChain- Specified by:
getMasterin interfaceImmutableChain- Specified by:
getMasterin interfaceImmutablePlan- Returns:
- the master
Planif one exists.
-
isSuspended
public boolean isSuspended()- Specified by:
isSuspendedin interfaceTriggerable- Returns:
- true if automatic triggering is switched off for this object
-
getTriggerDefinitions
- Specified by:
getTriggerDefinitionsin interfaceTriggerable- Returns:
- immutable list of all triggers defined for this object
-
getAllStages
Description copied from interface:ChainGet Stages of the ChainNote that this includes
ChainStages that have been marked for deletion- Specified by:
getAllStagesin interfaceChain- Specified by:
getAllStagesin interfaceImmutableChain- Returns:
- unmodifiable list of all stages
-
setAllStages
-
setChainExecutionManager
-
setRepositoryDefinitionManager
-
setBambooSpecsManager
-
setVcsBambooSpecsSource
Internal use only. This method doesn't modify any DB records, but can be used in order to avoid reloading the value by lazy reference. -
getVcsBambooSpecsSource
- Specified by:
getVcsBambooSpecsSourcein interfaceImmutableChain- Returns:
- specs source used to manage this plan, or null if plan is not managed by RSS
-