org.jvnet.jenkins.plugins.nodelabelparameter
Class LabelParameterDefinition

java.lang.Object
  extended by hudson.model.ParameterDefinition
      extended by hudson.model.SimpleParameterDefinition
          extended by org.jvnet.jenkins.plugins.nodelabelparameter.LabelParameterDefinition
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.model.ParameterDefinition>, Serializable, MultipleNodeDescribingParameterDefinition

public class LabelParameterDefinition
extends hudson.model.SimpleParameterDefinition
implements MultipleNodeDescribingParameterDefinition

Defines a build parameter used to restrict the node a job will be executed on. Such a label works exactly the same way as if you would define it in the UI "restrict where this job should run".

Author:
Dominik Bartholdi (imod)
See Also:
Serialized Form

Nested Class Summary
static class LabelParameterDefinition.DescriptorImpl
           
 
Nested classes/interfaces inherited from class hudson.model.ParameterDefinition
hudson.model.ParameterDefinition.ParameterDescriptor
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 String defaultValue
           
 
Fields inherited from class hudson.model.ParameterDefinition
LIST
 
Constructor Summary
LabelParameterDefinition(String name, String description, String defaultValue)
          Deprecated. 
LabelParameterDefinition(String name, String description, String defaultValue, boolean allNodesMatchingLabel, boolean ignoreOfflineNodes, String triggerIfResult)
          Deprecated. 
LabelParameterDefinition(String name, String description, String defaultValue, boolean allNodesMatchingLabel, NodeEligibility nodeEligibility, String triggerIfResult)
           
 
Method Summary
 hudson.model.SimpleParameterDefinition copyWithDefaultValue(hudson.model.ParameterValue defaultValueObj)
           
 TriggerNextBuildWrapper createBuildWrapper()
          Returns the wrapper to trigger the next build
 hudson.model.ParameterValue createValue(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject jo)
           
 hudson.model.ParameterValue createValue(String str)
           
 LabelParameterValue getDefaultParameterValue()
           
 NodeEligibility getNodeEligibility()
          gets the strategy which decides whether a node should be ignored or not
 String getTriggerIfResult()
          Get the requested build result definition
 boolean isAllNodesMatchingLabel()
           
 boolean isTriggerConcurrentBuilds()
           
 void validateBuild(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener)
          Callback to allow the parameter definition to do a final validation if everything is OK to proceed.
 
Methods inherited from class hudson.model.SimpleParameterDefinition
createValue, createValue
 
Methods inherited from class hudson.model.ParameterDefinition
all, getDescription, getDescriptor, getFormattedDescription, getName, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jvnet.jenkins.plugins.nodelabelparameter.MultipleNodeDescribingParameterDefinition
getName
 

Field Detail

defaultValue

public final String defaultValue
Constructor Detail

LabelParameterDefinition

@DataBoundConstructor
public LabelParameterDefinition(String name,
                                                     String description,
                                                     String defaultValue,
                                                     boolean allNodesMatchingLabel,
                                                     NodeEligibility nodeEligibility,
                                                     String triggerIfResult)

LabelParameterDefinition

@Deprecated
public LabelParameterDefinition(String name,
                                           String description,
                                           String defaultValue,
                                           boolean allNodesMatchingLabel,
                                           boolean ignoreOfflineNodes,
                                           String triggerIfResult)
Deprecated. 


LabelParameterDefinition

@Deprecated
public LabelParameterDefinition(String name,
                                           String description,
                                           String defaultValue)
Deprecated. 

Method Detail

copyWithDefaultValue

public hudson.model.SimpleParameterDefinition copyWithDefaultValue(hudson.model.ParameterValue defaultValueObj)
Overrides:
copyWithDefaultValue in class hudson.model.ParameterDefinition

getDefaultParameterValue

public LabelParameterValue getDefaultParameterValue()
Overrides:
getDefaultParameterValue in class hudson.model.ParameterDefinition

isAllNodesMatchingLabel

public boolean isAllNodesMatchingLabel()

getNodeEligibility

public NodeEligibility getNodeEligibility()
Description copied from interface: MultipleNodeDescribingParameterDefinition
gets the strategy which decides whether a node should be ignored or not

Specified by:
getNodeEligibility in interface MultipleNodeDescribingParameterDefinition
Returns:
the eligibility definition

createValue

public hudson.model.ParameterValue createValue(org.kohsuke.stapler.StaplerRequest req,
                                               net.sf.json.JSONObject jo)
Specified by:
createValue in class hudson.model.ParameterDefinition

createValue

public hudson.model.ParameterValue createValue(String str)
Specified by:
createValue in class hudson.model.SimpleParameterDefinition

getTriggerIfResult

public String getTriggerIfResult()
Description copied from interface: MultipleNodeDescribingParameterDefinition
Get the requested build result definition

Specified by:
getTriggerIfResult in interface MultipleNodeDescribingParameterDefinition
Returns:

isTriggerConcurrentBuilds

public boolean isTriggerConcurrentBuilds()

validateBuild

public void validateBuild(hudson.model.AbstractBuild<?,?> build,
                          hudson.Launcher launcher,
                          hudson.model.BuildListener listener)
Description copied from interface: MultipleNodeDescribingParameterDefinition
Callback to allow the parameter definition to do a final validation if everything is OK to proceed. Implementations are asked to throw a runtime exception if something is not OK and the build should be stopped.

Specified by:
validateBuild in interface MultipleNodeDescribingParameterDefinition
Parameters:
build - build to be validated
launcher - build launcher
listener - provides access to the log stream

createBuildWrapper

public TriggerNextBuildWrapper createBuildWrapper()
Description copied from interface: MultipleNodeDescribingParameterDefinition
Returns the wrapper to trigger the next build

Specified by:
createBuildWrapper in interface MultipleNodeDescribingParameterDefinition
Returns:
null if there is no new build to be triggered.


Copyright © 2004-2014. All Rights Reserved.