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 ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
Fields inherited from class com.atlassian.bamboo.plan.cache.AbstractImmutablePlan
averageBuildDuration, buildDefinition, immutableResultsSummaryAccessorFields 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
ConstructorsModifierConstructorDescriptionprotectedAbstractImmutableChain(EnrichedPlanDto dto, ImmutableChain masterChain, List<FlatChainStageDto> chainStages, Map<Long, List<EnrichedPlanDto>> jobsGroupedByStageId, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsSourceDao bambooSpecsSourceDao, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager) protectedAbstractImmutableChain(EnrichedPlanDto dto, Pair<ImmutableChain, EnrichedPlanDto> masterWithMasterDto, List<FlatChainStageDto> chainStages, Map<Long, List<EnrichedPlanDto>> jobsGroupedByStageId, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsSourceDao bambooSpecsSourceDao, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsStage(@Nullable String stageName) Checks whether or not a stage exists in this chain by stage name.@NotNull com.google.common.collect.ImmutableList<ImmutableJob>Get list of jobs sorted by - stage order - job name (case insensitive)@NotNull com.google.common.collect.ImmutableList<ImmutableChainStage>Get Stages of the Chain@NotNull DateintNote: Does not include Jobs that are marked for deletion.@Nullable PlanResultKeyGet the latest result key including active (not finished) resultsGet the latest finished resultReturn the master plan if one exists.Get notifications defined for this plan.@NotNull List<PlanRepositoryDefinition>Return list of repositories available to the chain.@NotNull com.google.common.collect.ImmutableList<ImmutableChainStage>Get Stages of the chain.@NotNull List<TriggerDefinition>@Nullable ImmutableVcsBambooSpecsSourcebooleanisActive()Is the plan queued or building?booleanisBusy()Is thePlan"busy".booleanIs the build currently being executed?booleanvoidresetLatestResultsSummary(int latestKnownBuildNumber, boolean resetAverageBuildDuration) Invalidates the latest result summary for planvoidInvalidate repository list.voidvoidresetVcsBambooSpecsSource(@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, resetLatestResultsSummaryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescriptionMethods inherited from interface com.atlassian.bamboo.plan.cache.ImmutableChain
getEntityTypeMethods inherited from interface com.atlassian.bamboo.core.ImmutableEntityWithOid
getOidMethods inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
getAverageBuildDuration, getBuildDefinition, getBuildLogger, getCurrentStatus, getEffectiveVariables, getFirstBuildNumber, getKey, getLabelNames, getLastBuildNumber, getProject, getType, getVariables, hasMaster, isMarkedForDeletionMethods 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
-
Constructor Details
-
AbstractImmutableChain
protected AbstractImmutableChain(EnrichedPlanDto dto, ImmutableChain masterChain, List<FlatChainStageDto> chainStages, Map<Long, List<EnrichedPlanDto>> jobsGroupedByStageId, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsSourceDao bambooSpecsSourceDao, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager) -
AbstractImmutableChain
protected AbstractImmutableChain(EnrichedPlanDto dto, Pair<ImmutableChain, EnrichedPlanDto> masterWithMasterDto, List<FlatChainStageDto> chainStages, Map<Long, List<EnrichedPlanDto>> jobsGroupedByStageId, BuildLoggerManager buildLoggerManager, ImmutablePlanCacheService immutablePlanCacheService, ImmutablePlanManager immutablePlanManager, InternalResultsSummaryAccessor immutableResultsSummaryAccessor, RepositoryDefinitionManager repositoryDefinitionManager, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsSourceDao bambooSpecsSourceDao, NotificationManager notificationManager, BuildDefinitionManager buildDefinitionManager)
-
-
Method Details
-
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
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
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
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
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
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
-
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.
-
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
- Specified by:
getTriggerDefinitionsin interfaceTriggerable- Returns:
- immutable list of all triggers defined for this object
-
getStorageTag
- Specified by:
getStorageTagin interfaceImmutableChain
-
getVcsBambooSpecsSource
- Specified by:
getVcsBambooSpecsSourcein interfaceImmutableChain- Returns:
- specs source used to manage this plan, or null if plan is not managed by RSS
-
getCreationDate
- Specified by:
getCreationDatein interfaceImmutableChain- Returns:
- chain creation date
-