Package jenkins.triggers
Class ReverseBuildTrigger
- java.lang.Object
-
- hudson.triggers.Trigger<Job>
-
- jenkins.triggers.ReverseBuildTrigger
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Trigger<?>>
,DependencyDeclarer
public final class ReverseBuildTrigger extends Trigger<Job> implements DependencyDeclarer
LikeBuildTrigger
but defined on the downstream project. Operates viaBuildTrigger.execute(hudson.model.AbstractBuild, hudson.model.BuildListener, hudson.tasks.BuildTrigger)
andDependencyGraph
, so run implicitly at the end of the upstream build, when used on a pair ofAbstractProject
s. Otherwise directly listens for the upstream build to complete.- Since:
- 1.560
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReverseBuildTrigger.DescriptorImpl
static class
ReverseBuildTrigger.ItemListenerImpl
static class
ReverseBuildTrigger.RunListenerImpl
-
Nested classes/interfaces inherited from class hudson.triggers.Trigger
Trigger.Cron
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description ReverseBuildTrigger(String upstreamProjects)
ReverseBuildTrigger(String upstreamProjects, Result threshold)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buildDependencyGraph(AbstractProject downstream, DependencyGraph graph)
Invoked fromAbstractProject.buildDependencyGraph(DependencyGraph)
.Result
getThreshold()
String
getUpstreamProjects()
Gets the upstream projects.void
setThreshold(Result r)
void
start(Job project, boolean newInstance)
Called when aTrigger
is loaded into memory and started.void
stop()
Called before aTrigger
is removed.-
Methods inherited from class hudson.triggers.Trigger
all, checkTriggers, for_, getDescriptor, getProjectAction, getProjectActions, getSpec, readResolve, run
-
-
-
-
Constructor Detail
-
ReverseBuildTrigger
@Deprecated public ReverseBuildTrigger(String upstreamProjects, Result threshold)
Deprecated.Legacy constructor used beforethreshold
was moved to a@DataBoundSetter
. Kept around for binary compatibility.
-
ReverseBuildTrigger
@DataBoundConstructor public ReverseBuildTrigger(String upstreamProjects)
-
-
Method Detail
-
getUpstreamProjects
public String getUpstreamProjects()
Gets the upstream projects.- Returns:
- 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
Invoked fromAbstractProject.buildDependencyGraph(DependencyGraph)
.- Specified by:
buildDependencyGraph
in interfaceDependencyDeclarer
- Parameters:
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 aTrigger
is loaded into memory and started.- Overrides:
start
in classTrigger<Job>
- Parameters:
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 theProject
(generally if the project is being created or configured). False if this is invoked for aProject
loaded from disk.- See Also:
Items.currentlyUpdatingByXml()
-
stop
public void stop()
Description copied from class:Trigger
-
-