Class ReverseBuildTrigger

All Implemented Interfaces:
ExtensionPoint, Describable<Trigger<?>>, DependencyDeclarer

public final class ReverseBuildTrigger extends Trigger<Job> implements DependencyDeclarer
Like BuildTrigger but defined on the downstream project. Operates via BuildTrigger.execute(hudson.model.AbstractBuild, hudson.model.BuildListener, hudson.tasks.BuildTrigger) and DependencyGraph, so run implicitly at the end of the upstream build, when used on a pair of AbstractProjects. Otherwise directly listens for the upstream build to complete.
  • Constructor Details

    • ReverseBuildTrigger

      @Deprecated public ReverseBuildTrigger(String upstreamProjects, Result threshold)
      Legacy constructor used before threshold was moved to a @DataBoundSetter. Kept around for binary compatibility.
    • ReverseBuildTrigger

      @DataBoundConstructor public ReverseBuildTrigger(String upstreamProjects)
  • Method Details

    • getUpstreamProjects

      public String getUpstreamProjects()
      Gets the upstream projects.
      Upstream projects or empty("") if upstream projects is null.
    • getThreshold

      public Result getThreshold()
    • setThreshold

      @DataBoundSetter public void setThreshold(Result r)
    • buildDependencyGraph

      public void buildDependencyGraph(AbstractProject downstream, DependencyGraph graph)
      Description copied from interface: DependencyDeclarer
      Specified by:
      buildDependencyGraph in interface DependencyDeclarer
      downstream - The project that owns the publishers, builders, etc. This information is conceptually redundant, as those objects are only configured against the single owner, but this information is nevertheless passed in since often owner information is not recorded. Never null.
      graph - The dependency graph being built. Never null.
    • start

      public void start(@NonNull Job project, boolean newInstance)
      Description copied from class: Trigger
      Called when a Trigger is loaded into memory and started.
      start in class Trigger<Job>
      project - given so that the persisted form of this object won't have to have a back pointer.
      newInstance - True if this may be a newly created trigger first attached to the Project (generally if the project is being created or configured). False if this is invoked for a Project loaded from disk.
      See Also:
    • stop

      public void stop()
      Description copied from class: Trigger
      Called before a Trigger is removed. Under some circumstances, this may be invoked more than once for a given Trigger, so be prepared for that.

      When the configuration is changed for a project, all triggers are removed once and then added back.

      stop in class Trigger<Job>