Class AbstractChain

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

@MappedSuperclass public abstract class AbstractChain extends AbstractPlan implements Plan, Chain
  • Field Details

  • Constructor Details

    • AbstractChain

      public AbstractChain()
  • Method Details

    • getStorageTag

      public ChainStorageTag getStorageTag()
      Specified by:
      getStorageTag in interface ImmutableChain
    • setStorageTag

      public void setStorageTag(ChainStorageTag storageTag)
      Specified by:
      setStorageTag in interface Chain
    • getStages

      @NotNull public @NotNull 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
    • addNewStage

      public ChainStage addNewStage(@NotNull @NotNull String name, @NotNull @NotNull 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 @NotNull ChainStage chainStage)
      Specified by:
      addStage in interface Chain
    • addStage

      public void addStage(int index, @NotNull @NotNull ChainStage chainStage)
      Description copied from interface: Chain
      Add stage at given index.
      Specified by:
      addStage in interface Chain
    • removeStage

      public void removeStage(long chainStageId)
      Specified by:
      removeStage in interface Chain
    • removeStagesIf

      public void removeStagesIf(@NotNull @NotNull Predicate<ChainStage> predicate)
      Description copied from interface: Chain
      Remove all stages matching a predicate.
      Specified by:
      removeStagesIf in interface Chain
    • 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 @NotNull 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 @Nullable 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
    • getCurrentStatus

      @NotNull public @NotNull String getCurrentStatus()
      Specified by:
      getCurrentStatus in interface ImmutablePlan
      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: ImmutablePlan
      Is the build currently being executed?
      Specified by:
      isExecuting in interface ImmutablePlan
      Returns:
      true if chain is currently being executed
    • isActive

      public boolean isActive()
      Needed for Dependency Blocking for Chains.
      Specified by:
      isActive in interface ImmutablePlan
      Returns:
      true if chain is currently being queued or 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
    • getAverageBuildDuration

      public long getAverageBuildDuration()
      Description copied from interface: ImmutablePlan
      Returns an average duration of the recent builds
      Specified by:
      getAverageBuildDuration in interface ImmutablePlan
      Returns:
      The duration in milliseconds
    • getPlanRepositoryDefinitions

      @NotNull public @NotNull List<PlanRepositoryDefinition> getPlanRepositoryDefinitions()
      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 overridden by a private copy of default repository.
      Specified by:
      getPlanRepositoryDefinitions 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.
    • setNotificationSet

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

      public final NotificationSet getNotificationSetField()
      Raw access to notification set field used in import/export, upgrade tasks and Hibernate.
      Since:
      4.2
    • 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 ImmutableChain
      Specified by:
      getMaster in interface ImmutablePlan
      Returns:
      the master Plan if one exists.
    • isSuspended

      public boolean isSuspended()
      Specified by:
      isSuspended in interface Triggerable
      Returns:
      true if automatic triggering is switched off for this object
    • getTriggerDefinitions

      @NotNull public @NotNull List<TriggerDefinition> getTriggerDefinitions()
      Specified by:
      getTriggerDefinitions in interface Triggerable
      Returns:
      immutable list of all triggers defined for this object
    • getAllStages

      @NotNull public @NotNull 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:
      unmodifiable list of all stages
    • setAllStages

      public void setAllStages(@NotNull @NotNull List<ChainStage> allStages)
    • setChainExecutionManager

      public void setChainExecutionManager(ChainExecutionManager chainExecutionManager)
    • setRepositoryDefinitionManager

      public void setRepositoryDefinitionManager(RepositoryDefinitionManager repositoryDefinitionManager)
    • setBambooSpecsManager

      public void setBambooSpecsManager(BambooSpecsManager bambooSpecsManager)
    • setVcsBambooSpecsSource

      @Internal public void setVcsBambooSpecsSource(@NotNull @NotNull VcsBambooSpecsSource newValue)
      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

      @Nullable public @Nullable VcsBambooSpecsSource getVcsBambooSpecsSource()
      Specified by:
      getVcsBambooSpecsSource in interface ImmutableChain
      Returns:
      specs source used to manage this plan, or null if plan is not managed by RSS