com.ibm.jsdt.facade
Class TaskConfiguration

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

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

Provides a facade of apis to modify attributes of TaskGroup and Task objects. 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.


Field Summary
static java.lang.String AIX
          Constant used to set AIX as the target operating system.
static java.lang.String HPUX_ITANIUM
          Constant used to set HP-UX 64BIT as the target operating system.
static java.lang.String HPUX_RISC
          Constant used to set HP-UX as the target operating system.
static java.lang.String LINUX
          Deprecated. Use LINUX_X86_32 or LINUX_X86_64 instead
static java.lang.String LINUX_ON_POWER
          Constant used to set Linux on POWER as the target operating system.
static java.lang.String LINUX_X86_32
          Constant used to set 32-bit x86-based Linux as the target operating system.
static java.lang.String LINUX_X86_64
          Constant used to set 64-bit x86-based Linux as the target operating system.
static java.lang.String OS400
          Constant used to set i5 as the target operating system.
static java.lang.String SUNOS_X86_32
          Constant used to set SUN OS x86 32 bit as the target operating system.
static java.lang.String SUNOS_X86_64
          Constant used to set SUN OS x86 64 BIT as the target operating system.
static java.lang.String WINDOWS
          Constant used to set Windows as the target operating system.
 
Constructor Summary
TaskConfiguration()
          Instantiates a TaskConfiguration option that is used to modify task and task group options.
 
Method Summary
 void addTargetInfoForTask(java.lang.String taskID, java.lang.String hostname, java.lang.String userId, java.lang.String password, java.lang.String operatingSystem, boolean storeCredentials)
          Adds a target to a specified task.
 void removeTargetFromTask(java.lang.String taskID, java.lang.String hostname)
          Removes a target from a specified task.
 void setAllTasksOptional(boolean isOptional, boolean setParentTaskGroup)
          Sets all tasks isOptional attribute based upon the boolean passed in.
 void setAllTasksSelectedByDefault(boolean selected, boolean setParentTaskGroup)
          Sets the selection of all tasks based upon the boolean passed in.
 void setAllTasksSelectedByDefault(boolean selected, boolean setParentTaskGroup, boolean override)
          Sets the selection of all the tasks depending on the value of the override boolean that is passed in which indicates whether or not to override tasks selection changes made by the user.
 void setTaskGroupOptional(java.lang.String id, boolean isOptional, boolean setAllChildTasks)
          Sets a task group's isOptional attribute based upon the boolean passed in.
 void setTaskGroupSelectedByDefault(java.lang.String id, boolean selectedByDefault, boolean setAllChildTasks)
          Sets the selection of a task group based upon the boolean passed in.
 void setTaskGroupSelectedByDefault(java.lang.String id, boolean selectedByDefault, boolean setAllChildTasks, boolean override)
          Sets the selection of the specified task group depending on the value of the override boolean that is passed in which indicates whether or not to override the task group selection change made by the user.
 void setTaskOptional(java.lang.String taskID, boolean isOptional, boolean setParentTaskGroup)
          Sets a task's isOptional attribute based upon the boolean passed in.
 void setTaskSelectedByDefault(java.lang.String taskID, boolean selectedByDefault, boolean setParentTaskGroup)
          Sets the selection of a task based upon the boolean passed in.
 void setTaskSelectedByDefault(java.lang.String taskID, boolean selectedByDefault, boolean setParentTaskGroup, boolean override)
          Sets the selection of the specified task depending on the value of the override boolean that is passed in which indicates whether or not to override the task selection change made by the user.
 void setVisibilityOnAllUnselectedTasksObjects(boolean visible)
          Sets a boolean indicating whether or not the deployment wizard should hide any task group and task that is not already selected when the Deployment Wizard is launched.
 void skipAllTargetPanels(boolean skip)
          Sets a boolean indicating whether or not the Deployment Wizard should skip all target panels.
 void skipAllTaskSelectionPanels(boolean skip)
          Sets a boolean indicating whether or not the Deployment Wizard should skip all task group and task selection panels.
 void skipTargetPanel(java.lang.String taskID, boolean skip)
          Skips the target panel for the specified task id based on the boolean passed in.
 
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
 

Field Detail

WINDOWS

public static java.lang.String WINDOWS
Constant used to set Windows as the target operating system.


LINUX

public static java.lang.String LINUX
Deprecated. Use LINUX_X86_32 or LINUX_X86_64 instead
Constant used to set Linux as the target operating system.


LINUX_X86_32

public static java.lang.String LINUX_X86_32
Constant used to set 32-bit x86-based Linux as the target operating system.


LINUX_X86_64

public static java.lang.String LINUX_X86_64
Constant used to set 64-bit x86-based Linux as the target operating system.


AIX

public static java.lang.String AIX
Constant used to set AIX as the target operating system.


SUNOS_X86_32

public static java.lang.String SUNOS_X86_32
Constant used to set SUN OS x86 32 bit as the target operating system.


SUNOS_X86_64

public static java.lang.String SUNOS_X86_64
Constant used to set SUN OS x86 64 BIT as the target operating system.


HPUX_RISC

public static java.lang.String HPUX_RISC
Constant used to set HP-UX as the target operating system.


HPUX_ITANIUM

public static java.lang.String HPUX_ITANIUM
Constant used to set HP-UX 64BIT as the target operating system.


OS400

public static java.lang.String OS400
Constant used to set i5 as the target operating system.


LINUX_ON_POWER

public static java.lang.String LINUX_ON_POWER
Constant used to set Linux on POWER as the target operating system.

Constructor Detail

TaskConfiguration

public TaskConfiguration()
                  throws DeployerNotRunningException
Instantiates a TaskConfiguration option that is used to modify task and task group options.

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

setTaskSelectedByDefault

public void setTaskSelectedByDefault(java.lang.String taskID,
                                     boolean selectedByDefault,
                                     boolean setParentTaskGroup)
                              throws TaskObjectNotFoundException,
                                     InvalidTaskOptionException
Sets the selection of a task based upon the boolean passed in. It will optionally set the selection state of the parent task group to the same state that is specified for the task.

For example: If the selected and setParentTaskGroup booleans are set to true for taskId "myTask", then task "myTask" will be selected as well it's parent task group. If setParentTaskGroup is false, then only task "myTask" will be selected.

NOTE: Selecting a task when the parent task group is not selected has no effect. RESTRICTIONS:

Parameters:
taskID - - The task id for the task that is being modified.
selectedByDefault - - Indicates whether or not to select the task
setParentTaskGroup - - Indicates whether or not to select the task's parent task group
Throws:
TaskObjectNotFoundException - if the specified task could not be found in the solution.
InvalidTaskOptionException - if one of the above mentioned restrictions are violated

setTaskSelectedByDefault

public void setTaskSelectedByDefault(java.lang.String taskID,
                                     boolean selectedByDefault,
                                     boolean setParentTaskGroup,
                                     boolean override)
                              throws TaskObjectNotFoundException,
                                     InvalidTaskOptionException
Sets the selection of the specified task depending on the value of the override boolean that is passed in which indicates whether or not to override the task selection change made by the user. If override boolean is true then the task selection change made by the user is overridden.

Parameters:
taskID - - The task id for the task that is being modified.
selectedByDefault - - Indicates whether or not to select the task
setParentTaskGroup - - Indicates whether or not to select the task's parent task group
override - - Indicates whether or not to override the task selection change made by the user
Throws:
TaskObjectNotFoundException - if the specified task could not be found in the solution.
InvalidTaskOptionException - if one of the above mentioned restrictions are violated

setAllTasksSelectedByDefault

public void setAllTasksSelectedByDefault(boolean selected,
                                         boolean setParentTaskGroup)
                                  throws InvalidTaskOptionException
Sets the selection of all tasks based upon the boolean passed in. It will optionally set the selection state of the parent task group to the same state that is specified for all the tasks.

For example: If the selected and setParentTaskGroup booleans are set to true all taskss will be selected as well their parent task group. If setParentTaskGroup is false, then only the individual tasks will be selected.

NOTE: Selecting a task when the parent task group is not selected has no effect. RESTRICTIONS:

Parameters:
selected - - Indicates whether or not to select the task
setParentTaskGroup - - Indicates whether or not to select the task's parent task group
Throws:
InvalidTaskOptionException - if any of the restrictions are violated

setAllTasksSelectedByDefault

public void setAllTasksSelectedByDefault(boolean selected,
                                         boolean setParentTaskGroup,
                                         boolean override)
                                  throws InvalidTaskOptionException
Sets the selection of all the tasks depending on the value of the override boolean that is passed in which indicates whether or not to override tasks selection changes made by the user. If override boolean is true then the tasks selection changes made by the user are overridden.

Parameters:
selected - - Indicates whether or not to select the task
setParentTaskGroup - - Indicates whether or not to select the task's parent task group
override - - Indicates whether or not to override tasks selection changes made by the user
Throws:
InvalidTaskOptionException - if any of the restrictions are violated

addTargetInfoForTask

public void addTargetInfoForTask(java.lang.String taskID,
                                 java.lang.String hostname,
                                 java.lang.String userId,
                                 java.lang.String password,
                                 java.lang.String operatingSystem,
                                 boolean storeCredentials)
                          throws TaskObjectNotFoundException,
                                 InvalidHostnameException
Adds a target to a specified task.

Parameters:
taskID -
hostname - - Hostname, IP or fullyqualified hostname of the machine this task will be deployed to
userId - - Valid user name on this machine
password - - Valid password
operatingSystem - - Operating System of this machine. Use the predefined operating system constants in this class.o
storeCredentials - - Indicates whether or not to save the user id and pwd for subsequent sessions of the Deployment Wizard
Throws:
TaskObjectNotFoundException - if the specified task can not be found in the solution.
InvalidHostnameException - if the hostname specified is not a properly formatted ip address, hostname or fullyqualified hostname

removeTargetFromTask

public void removeTargetFromTask(java.lang.String taskID,
                                 java.lang.String hostname)
                          throws TaskObjectNotFoundException
Removes a target from a specified task.

Parameters:
taskID - - ID of the task that the specified hostname is being removed from.
hostname - - Hostname, IP or fullyqualified hostname that is being removed.
Throws:
TaskObjectNotFoundException

setTaskGroupSelectedByDefault

public void setTaskGroupSelectedByDefault(java.lang.String id,
                                          boolean selectedByDefault,
                                          boolean setAllChildTasks)
                                   throws InvalidTaskOptionException,
                                          TaskObjectNotFoundException
Sets the selection of a task group based upon the boolean passed in. It will optionally set the selection state of all it's child tasks to the same state that is specified for the task.

Setting a task group as selected by default has no effect on the child tasks. If you desire the child tasks to be selected based on whether the parent task group is selected then ensure the setAllChildTasks parameter is true. RESTRICTIONS:

Parameters:
id - - The id for the task group that is being modified.
selectedByDefault - - Indicates whether or not to select the task group
setAllChildTasks - - Indicates whether or not to set the selection state of all the children to the same state as the parent task group
Throws:
TaskObjectNotFoundException - if the specified task could not be found in the solution.
InvalidTaskOptionException - if one of the above mentioned restrictions are violated

setTaskGroupSelectedByDefault

public void setTaskGroupSelectedByDefault(java.lang.String id,
                                          boolean selectedByDefault,
                                          boolean setAllChildTasks,
                                          boolean override)
                                   throws InvalidTaskOptionException,
                                          TaskObjectNotFoundException
Sets the selection of the specified task group depending on the value of the override boolean that is passed in which indicates whether or not to override the task group selection change made by the user. If override boolean is true then the task group selection change made by the user is overridden.

Parameters:
id - - The id for the task group that is being modified.
selectedByDefault - - Indicates whether or not to select the task group
setAllChildTasks - - Indicates whether or not to set the selection state of all the children to the same state as the parent task group
override - - Indicates whether or not to override the task group selection change made by the user
Throws:
TaskObjectNotFoundException - if the specified task could not be found in the solution.
InvalidTaskOptionException - if one of the above mentioned restrictions are violated

skipAllTaskSelectionPanels

public void skipAllTaskSelectionPanels(boolean skip)
Sets a boolean indicating whether or not the Deployment Wizard should skip all task group and task selection panels. NOTE: This attribute is only valid during the current deployment wizard session.

Parameters:
skip -

skipTargetPanel

public void skipTargetPanel(java.lang.String taskID,
                            boolean skip)
                     throws TaskObjectNotFoundException
Skips the target panel for the specified task id based on the boolean passed in.

Once all task selections have been made the validate 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 a target panel to be skipped if at least one target has not been defined for each task. If this method is not called validation will be ran when the solution is loaded and the skip flag will be set to false if the specified task does not have a target defined. NOTE: This attribute is only valid during the current deployment wizard session.

Parameters:
taskID - is the id of the task whose target panels will be skipped based on the boolean specified
skip - indicates whether or not to skip the target panel for the specified task
Throws:
TaskObjectNotFoundException - if the specified task can not be found in the solution

skipAllTargetPanels

public void skipAllTargetPanels(boolean skip)
Sets a boolean indicating whether or not the Deployment Wizard should skip all target panels.

Once all task selections have been made 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 all target panels to be skipped if at least one target has not been defined for each task. As a safety precaution the Deployment Wizard will validate the solution when it is loaded and the skip flag will be set to false if each task does not have a target defined. NOTE: This attribute is only valid during the current deployment wizard session.

Parameters:
skip - indicates whether or not to skip the target panel for the specified task
Throws:
TaskObjectNotFoundException - if the specified task can not be found in the solution

setVisibilityOnAllUnselectedTasksObjects

public void setVisibilityOnAllUnselectedTasksObjects(boolean visible)
Sets a boolean indicating whether or not the deployment wizard should hide any task group and task that is not already selected when the Deployment Wizard is launched. This is useful to prevent a user from modifying task selection when the set of task groups and tasks to be selected have been predetermined.

NOTE: This method should not be called unless at least one task group has been pre-selected. This preselection could have been through settings in the Developer IDE or apis called that modify task selection. This is necessary to avoid launching the Deployment Wizard with no task groups or tasks visible because nothing was preselected.

Parameters:
visible -

setTaskOptional

public void setTaskOptional(java.lang.String taskID,
                            boolean isOptional,
                            boolean setParentTaskGroup)
                     throws TaskObjectNotFoundException,
                            InvalidTaskOptionException
Sets a task's isOptional attribute based upon the boolean passed in. It will optionally set the isOptional state of the parent task group to the same state that is specified for the task. If a task has isOptional set to false, this means it is required and will automatically force the task to be selected and disabled so the user can not modify the selection state.

Setting a task as required or optional has no effect on the it's parent task group. If you desire the parent task group to be required or optional based on whether the task is required or optional then ensure the setParentTaskGroup paramater is true. RESTRICTIONS:

Parameters:
id - - The task id for the task that is being modified.
isOptional - - Indicates whether or not to the task is optional or required.
setParentTaskGroup - - Indicates whether or not to change the parent task group value based on the task value
Throws:
TaskObjectNotFoundException - if the specified task could not be found in the solution.
InvalidTaskOptionException - if one of the above mentioned restrictions are violated

setAllTasksOptional

public void setAllTasksOptional(boolean isOptional,
                                boolean setParentTaskGroup)
                         throws InvalidTaskOptionException
Sets all tasks isOptional attribute based upon the boolean passed in. It will optionally set the isOptional attribute of each task's parent task group to the same boolean value that is specified for all the tasks.

Setting a task as required or optional has no effect on the it's parent task group. If you desire the parent task group to be required or optional based on whether the task is required or optional then ensure the setParentTaskGroup paramater is true. RESTRICTIONS:

Parameters:
isOptional -
setParentTaskGroup -
Throws:
InvalidTaskOptionException - if one of the above mentioned restrictions are violated

setTaskGroupOptional

public void setTaskGroupOptional(java.lang.String id,
                                 boolean isOptional,
                                 boolean setAllChildTasks)
                          throws TaskObjectNotFoundException,
                                 InvalidTaskOptionException
Sets a task group's isOptional attribute based upon the boolean passed in. It will optionally set the isOptional state of all it's children tasks to the same state that is specified for the task group. If a task group has isOptional set to false, this means it is required and will automatically force the task group to be selected and disabled so the user can not modify the selection state.

Setting a task group as required or optional has no effect on the child tasks. If you desire the child tasks to be required or optional based on whether the parent task group is required or optional then ensure the setAllChildTasks paramater is true. RESTRICTIONS:

Parameters:
id - - The task id for the task that is being modified.
isOptional - - Indicates whether or not the task group is optional or required.
setAllChildTasks - - Indicates whether or not to change the child tasks value based on the parent task group value
Throws:
TaskObjectNotFoundException - if the specified task could not be found in the solution.
InvalidTaskOptionException - if one of the above mentioned restrictions are violated