com.sonyericsson.hudson.plugins.multislaveconfigplugin
Class EnvironmentVariables

java.lang.Object
  extended by com.sonyericsson.hudson.plugins.multislaveconfigplugin.EnvironmentVariables

public class EnvironmentVariables
extends Object

This class is used for interpreting environment variables.

Author:
Fredrik Persson <fredrik4.persson@sonyericsson.com>

Constructor Summary
protected EnvironmentVariables()
          Not allowing to create instances of this class.
 
Method Summary
static boolean containsEnvironmentVariables(String interpretString)
          Checks if the argument string contains environment variables, for example $NAME.
static hudson.slaves.DumbSlave fromVariables(hudson.slaves.DumbSlave slave)
          Switches from environment variables in most configuration fields for the slave and returns a new slave.
static String fromVariables(hudson.slaves.DumbSlave slave, String interpretString)
          Switches from environment variables in the argument string.
static String fromVariables(String slaveName, String interpretString)
          Switches from environment variables in the argument string.
static hudson.slaves.DumbSlave toVariables(hudson.slaves.DumbSlave slave)
          Switches to environment variables in most configuration fields for the slave and returns a new slave.
static String toVariables(hudson.slaves.DumbSlave slave, String interpretString)
          Switches to environment variables in the argument string.
static String toVariables(String slaveName, String interpretString)
          Switches to environment variables in the argument string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnvironmentVariables

protected EnvironmentVariables()
Not allowing to create instances of this class.

Method Detail

toVariables

public static String toVariables(hudson.slaves.DumbSlave slave,
                                 String interpretString)
Switches to environment variables in the argument string. For example the actual node name becomes $NAME if the argument string contains such

Parameters:
slave - the slave to base the environment variables on
interpretString - the string to interpret
Returns:
interpreted string

fromVariables

public static String fromVariables(hudson.slaves.DumbSlave slave,
                                   String interpretString)
Switches from environment variables in the argument string. For example $NAME becomes the actual node name if the argument string contains such

Parameters:
slave - the DumbSlave to base the environment variables on
interpretString - the string to interpret
Returns:
interpreted string

toVariables

public static String toVariables(String slaveName,
                                 String interpretString)
Switches to environment variables in the argument string. The actual node name becomes $NAME if the argument string contains such. This method is used when no slave has been created with the particular name yet, but environment variable interpreting is needed anyway.

Parameters:
slaveName - the name of the slave to base the environment variables on
interpretString - the string to interpret
Returns:
interpreted string

fromVariables

public static String fromVariables(String slaveName,
                                   String interpretString)
Switches from environment variables in the argument string. For example $NAME becomes the actual node name if the argument string contains such. This method is used when no slave has been created with the particular name yet, but environment variable interpreting is needed anyway.

Parameters:
slaveName - the name of the slave to base the environment variables on
interpretString - the string to interpret
Returns:
interpreted string

containsEnvironmentVariables

public static boolean containsEnvironmentVariables(String interpretString)
Checks if the argument string contains environment variables, for example $NAME.

Parameters:
interpretString - the string to check for environment variables
Returns:
true or false if the string contained environment variables

fromVariables

public static hudson.slaves.DumbSlave fromVariables(hudson.slaves.DumbSlave slave)
Switches from environment variables in most configuration fields for the slave and returns a new slave. For example, if the description contains $NAME, a new slave with the actual node name as description will be returned.

Parameters:
slave - the slave to interpret environment variables on
Returns:
a new slave with environment variables interpreted, otherwise same settings

toVariables

public static hudson.slaves.DumbSlave toVariables(hudson.slaves.DumbSlave slave)
Switches to environment variables in most configuration fields for the slave and returns a new slave. For example, if the description contains the actual node name, a new slave with $NAME as description will be returned.

Parameters:
slave - the slave to interpret environment variables on
Returns:
a new slave with environment variables interpreted, otherwise same settings


Copyright © 2004-2014. All Rights Reserved.