IBM WebSphere Application ServerTM
Release 7

com.ibm.websphere.management.application.client
Class AppDeploymentTask

java.lang.Object
  extended by com.ibm.websphere.management.application.client.AppDeploymentTask
All Implemented Interfaces:
java.io.Serializable

public abstract class AppDeploymentTask
extends java.lang.Object
implements java.io.Serializable

An AppDeploymentTask instance is a step in the application installation or editing procedure. Each task has a name which specifies the operation that it performs e.g.
DataSourceFor10CMPBeans (used to specify data source for EJB1.0 beans in an application)
BindJndiForEJBNonMessageBinding (used to specify JNDI names for non MDB EJBs)
MapWebModToVH (used to specify virtual hosts for web modules) etc.
A task contains application specific data that is either shown to the user so that they can change it or is modified programmatically. The task data is a two dimensional array of strings (i.e. a table of strings). The first row of the table contains the column headings that represent specific attributes from application or modules. The rest of the rows contain values of these attributes in a task-specific manner. For example, a task to map web modules to virtual hosts has three columns that are webModule, uri and virtualHost. Each row represents a single web module for which user can read/write virtual host information. For example, the taskData for this task may look like

webModule uri virtualHost
MyModuleName myMod.war+WEB_INF/web.xml default_host
XYModuleName xyMod.war+WEB_INF/web.xml another_host

The contents of task data are very specific to a particular task.

See Also:
Serialized Form

Field Summary
protected  AppDeploymentController appController
          Controller instance that manages tasks
protected  java.lang.String[] colNames
          Task column names
protected  boolean hasHiddenColumns
          Specifies if the task has any hidden columns.
protected  boolean[] hiddenColumns
          Hidden columns.
static java.lang.String HIGHEST_VERSION
           
protected  boolean isSufficientlyDone
          Specifies if task has any required data that is not specified
protected  boolean isTaskDisabled
          Specifies if task should be shown/changed
protected  boolean isTaskEmpty
          Specifies if task has any data in it
protected  boolean isValidationEnabled
          Specifies if task should be validated.
protected  boolean[] mutables
          Columns that can be changed
protected  java.lang.String name
          Task name
protected  boolean[] requiredColumns
          Columns that can not have an empty ("") value
protected  java.lang.String[][] taskData
          Task data
protected  java.lang.String[] taskValidateErrorMessages
          Error messages generated when task is validated
static int VERSION_HIGHEST
           
 
Constructor Summary
AppDeploymentTask(AppDeploymentController controller)
          Creates an instance of AppDeploymentTask
 
Method Summary
protected  void buildErrorMessages(java.util.Vector<java.lang.String> errors)
          Build error messages
 AppDeploymentController getAppDeploymentController()
          Returns AppDeploymentController instance
 java.lang.String getCallerVersion()
          Returns the major version of the client code that is calling this task.
 int getClientMajorVersion()
           
 java.lang.String[] getColumnNames()
          Returns column names for the task.
 boolean[] getMutableColumns()
          Returns mutable columns for the task
 boolean getMutableColumns(int index)
          Deprecated. see isMutableColumn(int)
 java.lang.String getName()
          Returns task name
 boolean[] getRequiredColumns()
           
 boolean getRequiredColumns(int index)
          Deprecated. see isRequiredColumn(int)
 java.lang.String[][] getTaskData()
          Returns task data
 AppDeploymentMessages getTaskMessages()
          Returns AppDeploymentMessages instance for the task.
 boolean isHiddenColumn(int index)
          Returns if specific column is hidden
 boolean isMutableColumn(int index)
          Returns if specific column is mutable
 boolean isRequiredColumn(int index)
          Deprecated. see isRequiredColumn(int)
 boolean isSufficientlyDone()
          Specifies if task has all the required columns populated
 boolean isTaskDisabled()
          Specifies if task should be shown or changed
 boolean isTaskEmpty()
          Specifies if task has any data
 boolean isValidationEnabled()
          Indicates if validation is enabled for task
 void setAppDeploymentController(AppDeploymentController controller)
          Sets the controller instance
 void setIsSufficientlyDone(boolean sufficientlyDone)
          Sets that the task has all the required data
 void setIsTaskDisabled(boolean taskDisabled)
          Enables or disables the task
 void setTaskData(java.lang.String[][] data)
          Set task data
 void setValidationEnabled(boolean status)
          Sets status of task validation
 java.lang.String toString()
          Returns a string representation of this object.
 java.lang.String[] validate()
          Validates the task data
protected  void verifyTaskData(java.lang.String[][] data)
          Verify data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION_HIGHEST

public static final int VERSION_HIGHEST
See Also:
Constant Field Values

HIGHEST_VERSION

public static final java.lang.String HIGHEST_VERSION

appController

protected transient AppDeploymentController appController
Controller instance that manages tasks


name

protected java.lang.String name
Task name


isTaskEmpty

protected boolean isTaskEmpty
Specifies if task has any data in it


isSufficientlyDone

protected boolean isSufficientlyDone
Specifies if task has any required data that is not specified


isTaskDisabled

protected boolean isTaskDisabled
Specifies if task should be shown/changed


isValidationEnabled

protected boolean isValidationEnabled
Specifies if task should be validated.


taskData

protected java.lang.String[][] taskData
Task data


colNames

protected java.lang.String[] colNames
Task column names


taskValidateErrorMessages

protected java.lang.String[] taskValidateErrorMessages
Error messages generated when task is validated


mutables

protected boolean[] mutables
Columns that can be changed


requiredColumns

protected boolean[] requiredColumns
Columns that can not have an empty ("") value


hiddenColumns

protected boolean[] hiddenColumns
Hidden columns. These should not be shown by the tool that displays the tasks to the end user.


hasHiddenColumns

protected boolean hasHiddenColumns
Specifies if the task has any hidden columns.

Constructor Detail

AppDeploymentTask

public AppDeploymentTask(AppDeploymentController controller)
Creates an instance of AppDeploymentTask

Parameters:
controller - The AppDeploymentController instance.
Method Detail

getAppDeploymentController

public AppDeploymentController getAppDeploymentController()
Returns AppDeploymentController instance

Returns:
AppDeploymentController instance

setAppDeploymentController

public void setAppDeploymentController(AppDeploymentController controller)
Sets the controller instance

Parameters:
controller - The AppDeploymentController instance.

getName

public java.lang.String getName()
Returns task name

Returns:
String task name

getColumnNames

public java.lang.String[] getColumnNames()
Returns column names for the task. These column names also appear as the first row of the task.

Returns:
String[] Task column names.

isTaskEmpty

public boolean isTaskEmpty()
Specifies if task has any data

Returns:
boolean true if task has no data; false otherwise

isTaskDisabled

public boolean isTaskDisabled()
Specifies if task should be shown or changed

Returns:
boolean true if task should not be shown; false otherwise

setIsTaskDisabled

public void setIsTaskDisabled(boolean taskDisabled)
Enables or disables the task

Parameters:
taskDisabled - flag to disable the task

isSufficientlyDone

public boolean isSufficientlyDone()
Specifies if task has all the required columns populated

Returns:
boolean true if task has all the required data; false otherwise

setIsSufficientlyDone

public void setIsSufficientlyDone(boolean sufficientlyDone)
Sets that the task has all the required data

Parameters:
sufficientlyDone - flag to specify that the task has all the required data

getMutableColumns

public boolean[] getMutableColumns()
Returns mutable columns for the task

Returns:
boolean[] an array of boolean values for columns specifying if they are mutable

isMutableColumn

public boolean isMutableColumn(int index)
Returns if specific column is mutable

Parameters:
index - Index of column to check
Returns:
boolean true if ith column is mutable; false otherwise

getMutableColumns

@Deprecated
public boolean getMutableColumns(int index)
Deprecated. see isMutableColumn(int)

Returns if specific column is mutable

Parameters:
index - Index of column to check
Returns:
boolean true if ith column is mutable; false otherwise

getRequiredColumns

public boolean[] getRequiredColumns()

isRequiredColumn

@Deprecated
public boolean isRequiredColumn(int index)
Deprecated. see isRequiredColumn(int)

Returns if value for specific column is required

Parameters:
index - Index of column to check
Returns:
boolean true if the specific column must have a value; false otherwise

getRequiredColumns

@Deprecated
public boolean getRequiredColumns(int index)
Deprecated. see isRequiredColumn(int)

Returns if value for specific column is required

Parameters:
index - Index of column to check
Returns:
boolean true if the specific column must have a value; false otherwise

isHiddenColumn

public boolean isHiddenColumn(int index)
Returns if specific column is hidden

Parameters:
index - Index of column to check
Returns:
boolean true if the specific column should not be shown; false otherwise

isValidationEnabled

public boolean isValidationEnabled()
Indicates if validation is enabled for task

Returns:
boolean true if validation is eanbled for task; false otherwise

setValidationEnabled

public void setValidationEnabled(boolean status)
Sets status of task validation

Parameters:
status - flag to specify that task validation is enabled

getTaskData

public java.lang.String[][] getTaskData()
Returns task data

Returns:
String[][] Copy of task data

setTaskData

public void setTaskData(java.lang.String[][] data)
                 throws com.ibm.websphere.management.application.client.AppDeploymentException
Set task data

Parameters:
data - Task data
Throws:
com.ibm.websphere.management.application.client.AppDeploymentException

verifyTaskData

protected void verifyTaskData(java.lang.String[][] data)
                       throws com.ibm.websphere.management.application.client.AppDeploymentException
Verify data

Parameters:
data - Task data
Throws:
com.ibm.websphere.management.application.client.AppDeploymentException

validate

public java.lang.String[] validate()
Validates the task data

Returns:
String[] an array of error messages; null otherwise

buildErrorMessages

protected void buildErrorMessages(java.util.Vector<java.lang.String> errors)
Build error messages

Parameters:
errors - Vector of error messages

getTaskMessages

public AppDeploymentMessages getTaskMessages()
Returns AppDeploymentMessages instance for the task. The AppDeploymentMessages instance can provide translated message information such as task description etc.

Returns:
AppDeploymentMessages instance

getCallerVersion

public java.lang.String getCallerVersion()
Returns the major version of the client code that is calling this task. Typically this is useful only when tasks are created on application server for editing. In that scenario if a remote client (e.g. wsadmin) running lower level WebSphere calls a WebSphere server code (AppManagement.getApplicationInfo) then the server code needs to figure out the client version to know what task information to pass back. If a task in v5 has new columns added in v6 then they can not be passed to the remote wsadmin client since the runtime on that client will know nothing about the new columns. In that case client version is helpful in determining what to pass back. For all other scenarios (install, local mode install/edit, update) the client version is treated as the highest version i.e. version that can handle the latest version of the task.

Returns:
String remote client's major version for edit mode, highest version in all other cases.

getClientMajorVersion

public int getClientMajorVersion()

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object.

IBM WebSphere Application ServerTM
Release 7