com.ibm.jsdt.facade
Class VariableConfiguration

java.lang.Object
  extended by com.ibm.jsdt.facade.DynamicSolutionConfiguration
      extended by com.ibm.jsdt.facade.VariableConfiguration

public class VariableConfiguration
extends com.ibm.jsdt.facade.DynamicSolutionConfiguration

This class provides a facade of apis to modify variable values. It can be used to perform the functions listed below. See method descriptions for more information.

NOTE: For any method that fails, an exception will be thrown. The exception object will contain the error message pertaining to the failure as well as additional information that may be pertinent. See the Java doc for each exception object for more information.


Constructor Summary
VariableConfiguration()
          Instantiates a VariableConfiguration option that is used to set and retrieve variable values.
 
Method Summary
 java.lang.String getCurrentSharedVariableValue(java.lang.String variableName)
          Returns the current value for the specified shared variable.
 java.lang.String getCurrentVariableValue(java.lang.String taskID, java.lang.String applicationID, java.lang.String variableName)
          Return the current value for the specified variable.
 java.lang.String getCurrentVariableValueByKey(java.lang.String key)
          Return the current value for the specified variable.
 void setSharedVariableValue(java.lang.String variableName, java.lang.String value)
          Overrides the current value of the specified shared variable.
 void setSharedVariableValue(java.lang.String variableName, java.lang.String value, boolean overrideValue)
          Sets the default value or the current value of the specified shared variable depending on the value of the overrideValue boolean that is passed in.
 void setVariableValue(java.lang.String taskID, java.lang.String applicationID, java.lang.String variableName, java.lang.String value)
          Overrides the current value of the specified variable.
 void setVariableValue(java.lang.String taskID, java.lang.String applicationID, java.lang.String variableName, java.lang.String value, boolean overrideValue)
          Sets the default value or the current value of the specified variable depending on the value of the overrideValue boolean that is passed in.
 void setVariableValueByKey(java.lang.String key, java.lang.String value)
          Overrides the current value of the specified variable.
 void setVariableValueByKey(java.lang.String key, java.lang.String value, boolean overrideValue)
          Sets the default value or the current value of the specified variable depending on the value of the overrideValue boolean that is passed in.
 void skipAllConfigurationPanels(boolean skip)
          Sets a boolean indicating whether or not the deployment wizard should skip all configuration panels.
 
Methods inherited from class com.ibm.jsdt.facade.DynamicSolutionConfiguration
getApplicationIDList, getDeployables, getMainManager, getSharedVariableIDList, getSharedVariables, getSuite, getTaskGroupIDList, getTaskGroups, getTaskIDList, getTaskIDList, getTopLevelDeployables, getVariableIDList, isDeploymentWizardRunning, setDeployables, setMainManager, setSuite, setTopLevelDeployables, validateSolution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableConfiguration

public VariableConfiguration()
                      throws DeployerNotRunningException
Instantiates a VariableConfiguration option that is used to set and retrieve variable values.

Throws:
DeployerNotRunningException - if this object is instantiated and the Deployment Wizard is not running interactively or via a task file deployment. An example of improper usage would be attempting to instantiating this class within a user program(i.e PreDeployment Checker, Main , Entry or Exit)
Method Detail

setVariableValueByKey

public void setVariableValueByKey(java.lang.String key,
                                  java.lang.String value)
                           throws VariableNotFoundException,
                                  InvalidVariableValueException,
                                  InvalidVariableFormatException
Overrides the current value of the specified variable. The value specified must pass all validation associated with the specified variable. If validation fails no changes will be made and an InvalidVariableValueException will be thrown. See the deployment wizard log file and exception object for specific errors. NOTE: If valid this method will override customer specified values. This may not be expected by the customer. Consider setting these variables to readOnly or hidden or skipping the display of the configuration panels if you never want the customer modified values to be honored.

Parameters:
key - is the fully qualified variable for which you want to set the value
value - is the new value for the specified variable
Throws:
VariableNotFoundException - if the variable could not be found within the specified task and application
InvalidVariableValueException - if the value specified is invalid based on the validation rules for the specified variable
InvalidVariableFormatException - if the key format is not <taskID>.<applicationID>.<variableName>

setVariableValue

public void setVariableValue(java.lang.String taskID,
                             java.lang.String applicationID,
                             java.lang.String variableName,
                             java.lang.String value)
                      throws VariableNotFoundException,
                             InvalidVariableValueException
Overrides the current value of the specified variable. The value specified must pass all validation associated with the specified variable. If validation fails no changes will be made and an InvalidVariableValueException will be thrown. See the deployment wizard log file and exception object for specific errors. NOTE: If valid this method will override customer specified values. This may not be expected by the customer. Consider setting these variables to readOnly or hidden or skipping the display of the configuration panels if you never want the customer modified values to be honored.

Parameters:
taskID - is the id of the task that contains the application that contains the variable that you want to override the value for.
applicationID - is the id of the application that contains the variable that you want to override the value for.
variableName - is the name of the variable that you want to override the value for
value - is the new value for the specified variable
Throws:
VariableNotFoundException - if the variable could not be found within the specified task and application
InvalidVariableValueException - if the value specified is invalid based on the validation rules for the specified variable

setVariableValueByKey

public void setVariableValueByKey(java.lang.String key,
                                  java.lang.String value,
                                  boolean overrideValue)
                           throws VariableNotFoundException,
                                  InvalidVariableValueException,
                                  InvalidVariableFormatException
Sets the default value or the current value of the specified variable depending on the value of the overrideValue boolean that is passed in. If this boolean is false then the default value for this variable will be set. This will preserve customer specified values, because a default value is only used when the solution is intially loaded. Once the customer saves the solution the default will never be reloaded. If this boolean is true the the current variable value will be set to the value specified regardless of whether or not the customer has saved the solution with a different variable value. Therefore customer specified values are not preserved when the overrideValue boolean is true. This is equivalent to calling the setVariableValue method which always overrides any customer specified values.

The value specified must pass all validation associated with the specified variable. If validation fails no changes will be made an an InvalidVariableValueException will be thrown. See the deployment wizard log file and exception object for specific errors. NOTE: If valid this method will override customer specified values. This may not be expected by the customer. Consider setting these variables to readOnly or hidden or skipping the display of the configuration panels if you never want the customer modified values to be honored.

Parameters:
key - is the fully qualified variable for which you want to set the value
value - is the new value for the specified variable
overrideValue - indicates whether or not you want to always override the current value
Throws:
VariableNotFoundException - if the variable could not be found within the specified task and application
InvalidVariableValueException - if the value specified is invalid based on the validation rules for the specified variable
InvalidVariableFormatException - if the key format is not <taskID>.<applicationID>.<variableName>

setVariableValue

public void setVariableValue(java.lang.String taskID,
                             java.lang.String applicationID,
                             java.lang.String variableName,
                             java.lang.String value,
                             boolean overrideValue)
                      throws VariableNotFoundException,
                             InvalidVariableValueException
Sets the default value or the current value of the specified variable depending on the value of the overrideValue boolean that is passed in. If this boolean is false then the default value for this variable will be set. This will preserve customer specified values, because a default value is only used when the solution is intially loaded. Once the customer saves the solution the default will never be reloaded. If this boolean is true the the current variable value will be set to the value specified regardless of whether or not the customer has saved the solution with a different variable value. Therefore customer specified values are not preserved when the overrideValue boolean is true. This is equivalent to calling the setVariableValue method which always overrides any customer specified values.

The value specified must pass all validation associated with the specified variable. If validation fails no changes will be made an an InvalidVariableValueException will be thrown. See the deployment wizard log file and exception object for specific errors. NOTE: If valid this method will override customer specified values. This may not be expected by the customer. Consider setting these variables to readOnly or hidden or skipping the display of the configuration panels if you never want the customer modified values to be honored.

Parameters:
taskID - is the id of the task that contains the application that contains the variable that you want to override the value for.
applicationID - is the id of the application that contains the variable that you want to override the value for.
variableName - is the name of the variable that you want to override the value for
value - is the new value for the specified variable
overrideValue - indicates whether or not you want to always override the current value
Throws:
VariableNotFoundException - if the variable could not be found within the specified task and application
InvalidVariableValueException - if the value specified is invalid based on the validation rules for the specified variable

setSharedVariableValue

public void setSharedVariableValue(java.lang.String variableName,
                                   java.lang.String value,
                                   boolean overrideValue)
                            throws VariableNotFoundException,
                                   InvalidVariableValueException
Sets the default value or the current value of the specified shared variable depending on the value of the overrideValue boolean that is passed in. If this boolean is false then the default value for this variable will be set. This will preserve customer specified values, because a default value is only used when the solution is intially loaded. Once the customer saves the solution the default will never be reloaded. If this boolean is true the the current variable value will be set to the value specified regardless of whether or not the customer has saved the solution with a different variable value. Therefore customer specified values are not preserved when the overrideValue boolean is true. This is equivalent to calling the setVariableValue method which always overrides any customer specified values.

The value specified must pass all validation associated with the specified variable. If validation fails no changes will be made an an InvalidVariableValueException will be thrown. See the deployment wizard log file and exception object for specific errors. NOTE: If valid this method will override customer specified values. This may not be expected by the customer. Consider setting these variables to readOnly or hidden or skipping the display of the configuration panels if you never want the customer modified values to be honored.

Parameters:
variableName - is the name of the shared variable that you want to override the value for
value - is the new value for the specified shared variable
overrideValue - indicates whether or not you want to always override the current value
Throws:
VariableNotFoundException - if the variable could not be found within the specified task and application
InvalidVariableValueException - if the value specified is invalid based on the validation rules for the specified shared variable. If no validation or default value was specified for the shared variable the validation rules of the first editable variable that this shared variable is associated with, will be used.

setSharedVariableValue

public void setSharedVariableValue(java.lang.String variableName,
                                   java.lang.String value)
                            throws VariableNotFoundException,
                                   InvalidVariableValueException
Overrides the current value of the specified shared variable. The value specified must pass all validation associated with the specified shared variable. If validation fails no changes will be made and an InvalidVariableValueException will be thrown. See the deployment wizard log file and exception object for specific errors. NOTE: If valid this method will override customer specified values. This may not be expected by the customer. Consider setting these variables to readOnly or hidden or skipping the display of the configuration panels if you never want the customer modified values to be honored.

Parameters:
variableName - is the name of the shared variable that you want to override the value for
value - is the new value for the specified shared variable
Throws:
VariableNotFoundException - if the shared variable could not be found
InvalidVariableValueException - if the value specified is invalid based on the validation rules for the specified shared variable. If no validation or default value was specified for the shared variable the validation rules of the first editable variable that this shared variable is associated with, will be used.

getCurrentVariableValueByKey

public java.lang.String getCurrentVariableValueByKey(java.lang.String key)
                                              throws VariableNotFoundException,
                                                     InvalidVariableFormatException
Return the current value for the specified variable.

Parameters:
key - is the fully qualified variable for which you need the current value
Returns:
String Null will be returned if the variable can not be found
Throws:
VariableNotFoundException - if the specified variable can not be found
InvalidVariableFormatException - if the key format is not <taskID>.<applicationID>.<variableName>

getCurrentVariableValue

public java.lang.String getCurrentVariableValue(java.lang.String taskID,
                                                java.lang.String applicationID,
                                                java.lang.String variableName)
                                         throws VariableNotFoundException
Return the current value for the specified variable.

Parameters:
taskID - - The id of the task that contains the application that contains the specified variable.
applicationID - - The id of the application that contains the specified variable.
variableName - - The name of the variable that you need the current value of.
Returns:
String Null will be returned if the variable can not be found
Throws:
VariableNotFoundException - if the specified variable can not be found.

getCurrentSharedVariableValue

public java.lang.String getCurrentSharedVariableValue(java.lang.String variableName)
                                               throws VariableNotFoundException
Returns the current value for the specified shared variable.

Parameters:
variableName - - The sharedAs name of the shared variable to return the value of.
Returns:
String If the variable does not exist, null will be returned.
Throws:
VariableNotFoundException - if the specified variable can not be found.

skipAllConfigurationPanels

public void skipAllConfigurationPanels(boolean skip)
Sets a boolean indicating whether or not the deployment wizard should skip all configuration panels.

Once all task selections have been made and variable values have been set, the validateSolution() method should be called to ensure that the solution is valid based on all changes that have been made. For example, the validate method will not allow configuration panels to be skipped if any variable that is contained in a selected task is not valid. As a safety precaution, the Deployment Wizard will still validate the the solution when it is loaded and the skip flag will be set to false if variable values are invalid. However, it's best if you proactively invoke validateSolution so your class can take any necessary corrective action. NOTE: This flag is only valid during the current deployment wizard session.

Parameters:
skip - indicates whether or not all configuration panels should be skipped.