Class AbstractChain

    • Constructor Detail

      • AbstractChain

        public AbstractChain()
    • Method Detail

      • 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
      • getEffectiveRepositoryDefinitions

        @NotNull
        public @NotNull List<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 overridden by a private copy of default repository.
        Specified by:
        getEffectiveRepositoryDefinitions in interface ImmutableChain
        Returns:
        ordered List of repositories available to this plan
      • 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
      • 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
      • 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.