Package com.atlassian.bamboo.plan.cache
Class AbstractImmutableChain
- java.lang.Object
-
- com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
-
- com.atlassian.bamboo.plan.cache.AbstractImmutableChain
-
- All Implemented Interfaces:
BambooIdProvider,ImmutableEntityWithOid,ImmutableChain,ImmutableDeletable,ImmutablePlan,PlanIdentifier,PlanKeyProvider,Triggerable,DescriptionProvider,NameProvider,Versionable,Comparable<ImmutablePlan>
- Direct Known Subclasses:
ImmutableChainBranchImpl,ImmutableChainImpl
public abstract class AbstractImmutableChain extends AbstractImmutablePlan implements ImmutableChain
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractImmutableChain.VcsBambooSpecsSourceResettableLazyReference
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
averageBuildDuration, buildDefinition, resultsSummaryManager
-
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
Constructors Constructor Description AbstractImmutableChain(@NotNull Chain chain, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, LabelManager labelManager, ResultsSummaryManager resultsSummaryManager, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsManager bambooSpecsManager, @NotNull BuildDefinition buildDefinition)AbstractImmutableChain(EnrichedPlanDto dto, Pair<ImmutableChain,EnrichedPlanDto> masterWithMasterDto, List<FlatChainStageDto> chainStages, Map<Long,List<EnrichedPlanDto>> jobsGroupedByStageId, Map<Long,EnrichedPlanDto> jobsGroupedById, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, ResultsSummaryManager resultsSummaryManager, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsManager bambooSpecsManager, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsStage(@Nullable String stageName)Checks whether or not a stage exists in this chain by stage name.@NotNull com.google.common.collect.ImmutableList<ImmutableJob>getAllJobs()Get list of jobs sorted by - stage order - job name (case insensitive)@NotNull com.google.common.collect.ImmutableList<ImmutableChainStage>getAllStages()Get Stages of the Chain@NotNull DategetCreationDate()@NotNull com.google.common.collect.ImmutableList<RepositoryDefinition>getEffectiveRepositoryDefinitions()Return list of repositories available to the chain.intgetJobCount()Note: Does not include Jobs that are marked for deletion.@Nullable PlanResultKeygetLastResultKey()Get the latest result key including active (not finished) resultsImmutableResultsSummarygetLatestResultsSummary()Get the latest finished resultImmutableChaingetMaster()Return the master plan if one exists.NotificationSetgetNotificationSet()Get notifications defined for this plan.@NotNull List<PlanRepositoryDefinition>getPlanRepositoryDefinitions()Return list of repositories available to the chain.@NotNull com.google.common.collect.ImmutableList<ImmutableChainStage>getStages()Get Stages of the chain.ChainStorageTaggetStorageTag()@NotNull List<TriggerDefinition>getTriggerDefinitions()@Nullable ImmutableVcsBambooSpecsSourcegetVcsBambooSpecsSource()booleanisActive()Is the plan queued or building?booleanisBusy()Is thePlan"busy".booleanisExecuting()Is the build currently being executed?booleanisSuspended()voidresetLatestResultsSummary(int latestKnownBuildNumber, boolean resetAverageBuildDuration)Invalidates the latest result summary for planvoidresetPlanRepositoryDefinitions()Invalidate repository list.voidresetVcsBambooSpecsSource()voidresetVcsBambooSpecsSource(@Nullable ImmutableVcsBambooSpecsSource immutableVcsBambooSpecsSource)Invalidates specs source.-
Methods inherited from class com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
compareTo, equals, exceptionOnModification, getAverageBuildDuration, getBuildDefinition, getBuildKey, getBuildLogger, getBuildName, getCurrentStatus, getDatabaseId, getDescription, getEffectiveVariables, getFirstBuildNumber, getId, getKey, getLabellings, getLabelNames, getLastBuildNumber, getMasterId, getMasterIdIfExists, getName, getOid, getPlanKey, getPlanType, getProject, getRelatedLabellings, getType, getVariables, getVersion, hashCode, hasMaster, isMarkedForDeletion, isSuspendedFromBuilding, resetLatestResultsSummary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescription
-
Methods inherited from interface com.atlassian.bamboo.plan.cache.ImmutableChain
getEntityType
-
Methods inherited from interface com.atlassian.bamboo.core.ImmutableEntityWithOid
getOid
-
Methods inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
getAverageBuildDuration, getBuildDefinition, getBuildLogger, getCurrentStatus, getEffectiveVariables, getFirstBuildNumber, getKey, getLabelNames, getLastBuildNumber, getProject, getType, getVariables, hasMaster, isMarkedForDeletion
-
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
-
-
-
-
Constructor Detail
-
AbstractImmutableChain
public AbstractImmutableChain(@NotNull @NotNull Chain chain, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, LabelManager labelManager, ResultsSummaryManager resultsSummaryManager, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsManager bambooSpecsManager, @NotNull @NotNull BuildDefinition buildDefinition)
-
AbstractImmutableChain
public AbstractImmutableChain(EnrichedPlanDto dto, Pair<ImmutableChain,EnrichedPlanDto> masterWithMasterDto, List<FlatChainStageDto> chainStages, Map<Long,List<EnrichedPlanDto>> jobsGroupedByStageId, Map<Long,EnrichedPlanDto> jobsGroupedById, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, ResultsSummaryManager resultsSummaryManager, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsManager bambooSpecsManager, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager)
-
-
Method Detail
-
isActive
public boolean isActive()
Description copied from interface:ImmutablePlanIs the plan queued or building?- Specified by:
isActivein interfaceImmutablePlan
-
isExecuting
public boolean isExecuting()
Description copied from interface:ImmutablePlanIs the build currently being executed?- Specified by:
isExecutingin interfaceImmutablePlan- Returns:
- true if build is being executed
-
getLastResultKey
@Nullable public @Nullable PlanResultKey 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
-
getLatestResultsSummary
public ImmutableResultsSummary getLatestResultsSummary()
Description copied from interface:ImmutablePlanGet the latest finished result- Specified by:
getLatestResultsSummaryin interfaceImmutablePlan- Returns:
- The summary info for the last completed build. Returns null if there are no build results for this plan
-
resetLatestResultsSummary
@Internal public void resetLatestResultsSummary(int latestKnownBuildNumber, boolean resetAverageBuildDuration)Invalidates the latest result summary for plan- Specified by:
resetLatestResultsSummaryin classAbstractImmutablePlan
-
resetVcsBambooSpecsSource
@Internal public void resetVcsBambooSpecsSource(@Nullable @Nullable ImmutableVcsBambooSpecsSource immutableVcsBambooSpecsSource)Invalidates specs source.
-
resetVcsBambooSpecsSource
@Internal public void resetVcsBambooSpecsSource()
-
resetPlanRepositoryDefinitions
@Internal public void resetPlanRepositoryDefinitions()
Invalidate repository list.
-
isBusy
public boolean isBusy()
Description copied from interface:ImmutablePlanIs 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:
isBusyin interfaceImmutablePlan- Returns:
- busy
-
getStages
@NotNull public @NotNull com.google.common.collect.ImmutableList<ImmutableChainStage> getStages()
Description copied from interface:ImmutableChainGet Stages of the chain.Note that this excludes
ChainStages that have been marked for deletion- Specified by:
getStagesin interfaceImmutableChain- Returns:
- stages
-
getAllStages
@NotNull public @NotNull com.google.common.collect.ImmutableList<ImmutableChainStage> getAllStages()
Description copied from interface:ImmutableChainGet Stages of the ChainNote that this includes
ChainStages that have been marked for deletion- Specified by:
getAllStagesin interfaceImmutableChain- Returns:
- stages
-
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
@NotNull public @NotNull com.google.common.collect.ImmutableList<ImmutableJob> getAllJobs()
Get list of jobs sorted by - stage order - job name (case insensitive)- Specified by:
getAllJobsin interfaceImmutableChain- Returns:
- sorted list of Jobs in the Plan
-
containsStage
public boolean containsStage(@Nullable @Nullable String stageName)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
-
getEffectiveRepositoryDefinitions
@NotNull public @NotNull com.google.common.collect.ImmutableList<RepositoryDefinition> getEffectiveRepositoryDefinitions()
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:
getEffectiveRepositoryDefinitionsin interfaceImmutableChain- Returns:
- ordered
Listof repositories available to this plan
-
getPlanRepositoryDefinitions
@NotNull public @NotNull List<PlanRepositoryDefinition> 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
public NotificationSet getNotificationSet()
Description copied from interface:ImmutableChainGet notifications defined for this plan.- Specified by:
getNotificationSetin interfaceImmutableChain- Returns:
NotificationSetcontaining notifications for this plan.
-
getMaster
public ImmutableChain 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 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
@NotNull public @NotNull List<TriggerDefinition> getTriggerDefinitions()
- Specified by:
getTriggerDefinitionsin interfaceTriggerable- Returns:
- immutable list of all triggers defined for this object
-
getStorageTag
public ChainStorageTag getStorageTag()
- Specified by:
getStorageTagin interfaceImmutableChain
-
getVcsBambooSpecsSource
@Nullable public @Nullable ImmutableVcsBambooSpecsSource getVcsBambooSpecsSource()
- Specified by:
getVcsBambooSpecsSourcein interfaceImmutableChain- Returns:
- specs source used to manage this plan, or null if plan is not managed by RSS
-
getCreationDate
@NotNull public @NotNull Date getCreationDate()
- Specified by:
getCreationDatein interfaceImmutableChain- Returns:
- chain creation date
-
-