org.jenkins_ci.plugins.build_cause_run_condition
Class ExtendedCauseCondition

java.lang.Object
  extended by org.jenkins_ci.plugins.run_condition.RunCondition
      extended by org.jenkins_ci.plugins.run_condition.common.AlwaysPrebuildRunCondition
          extended by org.jenkins_ci.plugins.build_cause_run_condition.ExtendedCauseCondition
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<org.jenkins_ci.plugins.run_condition.RunCondition>

@Extension
public class ExtendedCauseCondition
extends org.jenkins_ci.plugins.run_condition.common.AlwaysPrebuildRunCondition

Run condition to use the reason that the build was started, the actual conditions are subclasses that can be extended using the BuildCauseCondition

Author:
Chris Johnson

Nested Class Summary
static class ExtendedCauseCondition.ExtendedCauseConditionDescriptor
           
static class ExtendedCauseCondition.UpstreamCauseCondition
          Looks to see if any of the causes of the build match the passed in project list When the project list is empty it assumes that any project build matches.
static class ExtendedCauseCondition.UserBuildCauseCondition
          Looks to see if any of the causes of the build match the passed in user list When the user list is empty it assumes that any user build matches.
 
Nested classes/interfaces inherited from class org.jenkins_ci.plugins.run_condition.RunCondition
org.jenkins_ci.plugins.run_condition.RunCondition.RunConditionDescriptor
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
ExtendedCauseCondition()
           
ExtendedCauseCondition(BuildCauseCondition condition, boolean exclusiveCause)
          Data bound constructor taking a condition and exclusive cause
 
Method Summary
 BuildCauseCondition getCondition()
          Returns the condition for the UI to display
 boolean isExclusiveCause()
          Returns the exclusiveCause for the UI to display
 boolean runPerform(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener)
          Performs the check of the condition and exclusiveCause.
 
Methods inherited from class org.jenkins_ci.plugins.run_condition.common.AlwaysPrebuildRunCondition
runPrebuild
 
Methods inherited from class org.jenkins_ci.plugins.run_condition.RunCondition
all, getDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedCauseCondition

@DataBoundConstructor
public ExtendedCauseCondition(BuildCauseCondition condition,
                                                   boolean exclusiveCause)
Data bound constructor taking a condition and exclusive cause

Parameters:
condition - Build condition to use
exclusiveCause - flag to indicate whether builds started by multiple causes are allowed.

ExtendedCauseCondition

public ExtendedCauseCondition()
Method Detail

getCondition

public BuildCauseCondition getCondition()
Returns the condition for the UI to display

Returns:
Condition that is current.

isExclusiveCause

public boolean isExclusiveCause()
Returns the exclusiveCause for the UI to display

Returns:
true if only a single cause can trigger this condition.

runPerform

public boolean runPerform(hudson.model.AbstractBuild<?,?> build,
                          hudson.model.BuildListener listener)
                   throws InterruptedException
Performs the check of the condition and exclusiveCause.

Specified by:
runPerform in class org.jenkins_ci.plugins.run_condition.RunCondition
Returns:
false if more than single cause for the build Otherwise the result of the condition runPerform @see BuildCauseCondition
Throws:
InterruptedException


Copyright © 2004-2012. All Rights Reserved.