com.seitenbau.jenkins.plugins.dynamicparameter.util
Class JenkinsUtils

java.lang.Object
  extended by com.seitenbau.jenkins.plugins.dynamicparameter.util.JenkinsUtils

public final class JenkinsUtils
extends Object

Jenkins utility methods.


Method Summary
static Object execute(String script)
          Execute the script locally.
static Object execute(String script, hudson.FilePath[] classPaths)
          Execute the script locally using the given class path.
static Object execute(String script, Map<String,String> parameters)
          Execute the script locally using the given parameters.
static hudson.remoting.VirtualChannel findActiveChannel(hudson.model.Label label)
          Find an active node channel for the label of the current project.
static hudson.model.Label findProjectLabel(UUID parameterUUID)
          Find the label assigned to the current project.
static Set<org.jenkinsci.plugins.scriptler.config.Script> getAllScriptlerScripts()
          Get all Scriptler scripts.
static boolean isPluginAvailable(String shortName)
          Check if a plugin is available.
static boolean isScriptlerAvailable()
          Check if the Scriptler plugin is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

execute

public static Object execute(String script)
Execute the script locally.

Parameters:
script - script to execute
Returns:
result from the script

execute

public static Object execute(String script,
                             Map<String,String> parameters)
Execute the script locally using the given parameters.

Parameters:
script - script to execute
parameters - parameters
Returns:
result from the script

execute

public static Object execute(String script,
                             hudson.FilePath[] classPaths)
Execute the script locally using the given class path.

Parameters:
script - script to execute
classPaths - class paths
Returns:
result from the script

isPluginAvailable

public static boolean isPluginAvailable(String shortName)
Check if a plugin is available.

Parameters:
shortName - plugin short name
Returns:
true if plugin is installed

isScriptlerAvailable

public static boolean isScriptlerAvailable()
Check if the Scriptler plugin is available.

Returns:
true if Scriptler is installed

getAllScriptlerScripts

public static Set<org.jenkinsci.plugins.scriptler.config.Script> getAllScriptlerScripts()
Get all Scriptler scripts.

Returns:
a set of Scriptler scripts

findActiveChannel

public static hudson.remoting.VirtualChannel findActiveChannel(hudson.model.Label label)
Find an active node channel for the label of the current project.

Parameters:
label - label whose nodes to check
Returns:
active node channel or null if none found

findProjectLabel

public static hudson.model.Label findProjectLabel(UUID parameterUUID)
Find the label assigned to the current project.

Parameters:
parameterUUID - UUID of the project parameter
Returns:
null if the label of the current project cannot be found


Copyright © 2004-2012. All Rights Reserved.