com.ibm.websphere.management.application.client

Class AppDeploymentTask

  1. java.lang.Object
  2. extended bycom.ibm.websphere.management.application.client.AppDeploymentTask
All implemented interfaces:
java.io.Serializable

  1. public abstract class AppDeploymentTask
  2. extends java.lang.Object
  3. implements java.io.Serializable
Extending this class is deprecated in 8.0. Use WASDeploymentTask to create an application deployment task instead.


  public myTaskHelper implements AppDeploymentTaskHelper {

     private static final String[] COLUMNS = new String[] {
        "app.version",
        "property.name",
        "property.type",
        "property.desc",
        "property.value"}

     public AppDeploymentTask createTask(final AppDeploymentController controller,
        final String taskName)
     {

        AppDeploymentTask task = null;

        try {
           task = new WASDeploymentTask(controller, "myPropertyTask", COLUMNS,
              new boolean[] { true, true, false, false, false }, // required
              new boolean[] { false, false, false, false, true }, // mutable
              new boolean[] { true, false, false, false, false }); // hidden
        } catch (final Exception e) {
           RasUtils.logException(e, tc, CLASS_NAME, "createTask", "78", this);
        }

        return task;
     }
  }
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:
WASDeploymentTask, Serialized Form

Field Summary

Modifier and Type Field and Description
  1. protected
  2. AppDeploymentController
appController
Controller instance that manages tasks
  1. protected
  2. java.lang.String[][]
clientTaskData
Client task data
  1. protected
  2. java.lang.String[]
colNames
Task column names
  1. protected
  2. boolean
hasHiddenColumns
Specifies if the task has any hidden columns.
  1. protected
  2. boolean[]
hiddenColumns
Hidden columns.
  1. static
  2. java.lang.String
HIGHEST_VERSION
  1. protected
  2. boolean
isSufficientlyDone
Specifies if task has any required data that is not specified
  1. protected
  2. boolean
isTaskDisabled
Specifies if task should be shown/changed
  1. protected
  2. boolean
isTaskEmpty
Specifies if task has any data in it
  1. protected
  2. boolean
isValidationEnabled
Specifies if task should be validated.
  1. protected
  2. boolean[]
mutables
Columns that can be changed
  1. protected
  2. java.lang.String
name
Task name
  1. protected
  2. boolean[]
requiredColumns
Columns that can not have an empty (null or "") value
  1. protected
  2. java.lang.String[][]
taskData
Task data
  1. protected
  2. java.lang.String[]
taskValidateErrorMessages
Error messages generated when task is validated
  1. static
  2. int
VERSION_HIGHEST

Constructor Summary

Constructor and Description
AppDeploymentTask(AppDeploymentController controller)
Creates an instance of AppDeploymentTask

Method Summary

Modifier and Type Method and Description
  1. protected
  2. void
buildErrorMessages(java.util.Vector<java.lang.String> errorMessages)
Build error messages
  1. AppDeploymentController
getAppDeploymentController()
Returns AppDeploymentController instance
  1. java.lang.String
getCallerVersion()
Returns the major version of the client code that is calling this task.
  1. int
getClientMajorVersion()
Returns the major version of the client code that is calling this task.
  1. java.lang.String[][]
getClientTaskData()
Returns client task data
  1. java.lang.String[]
getColumnNames()
Returns column names for the task.
  1. boolean[]
getMutableColumns()
Returns mutable columns for the task
  1. boolean
getMutableColumns(int index)
Deprecated. see isMutableColumn(int)
  1. java.lang.String
getName()
Returns task name
  1. boolean[]
getRequiredColumns()
  1. boolean
getRequiredColumns(int index)
Deprecated. see isRequiredColumn(int)
  1. java.lang.String[][]
getTaskData()
Returns task data
  1. AppDeploymentMessages
getTaskMessages()
Returns AppDeploymentMessages instance for the task.
  1. boolean
isClientModuleEnabled()
Returns whether client module is enabled
  1. boolean
isClientModuleEnabled(java.lang.String checkClientModeValue)
Returns whether client module is enabled based on enable client module option and possibly client mode.
  1. boolean
isHiddenColumn(int index)
Returns if specific column is hidden
  1. boolean
isMutableColumn(int index)
Returns if specific column is mutable
  1. boolean
isRequiredColumn(int index)
Returns if value for specific column is required
  1. boolean
isSufficientlyDone()
Specifies if task has all the required columns populated
  1. boolean
isTaskDisabled()
Specifies if task should be shown or changed
  1. boolean
isTaskEmpty()
Specifies if task has any data
  1. boolean
isValidationEnabled()
Indicates if validation is enabled for task
  1. void
setAppDeploymentController(AppDeploymentController controller)
Sets the controller instance
  1. void
setClientTaskData(java.lang.String[][] data)
Set client task data
  1. void
setIsSufficientlyDone(boolean sufficientlyDone)
Sets that the task has all the required data
  1. void
setIsTaskDisabled(boolean taskDisabled)
Enables or disables the task
  1. void
setTaskData(java.lang.String[][] data)
Set task data
  1. void
setTaskData(java.lang.String[][] data,boolean skipDependencies)
Set task data
  1. void
setValidationEnabled(boolean status)
Sets status of task validation * * @param status flag to specify that task validation is enabled
  1. static
  2. java.lang.String[]
taskDataToTraceObject(java.lang.String label,java.lang.String[][] taskData)
  1. java.lang.String
toString()
Returns a string representation of this object.
  1. java.lang.String[]
validate()
Validates the task data
  1. protected
  2. 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

  1. public static final int VERSION_HIGHEST
See Also:

HIGHEST_VERSION

  1. public static final java.lang.String HIGHEST_VERSION

appController

  1. protected transient AppDeploymentController appController
Controller instance that manages tasks

name

  1. protected java.lang.String name
Task name

isTaskEmpty

  1. protected boolean isTaskEmpty
Specifies if task has any data in it

isSufficientlyDone

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

isTaskDisabled

  1. protected boolean isTaskDisabled
Specifies if task should be shown/changed

isValidationEnabled

  1. protected boolean isValidationEnabled
Specifies if task should be validated.

taskData

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

clientTaskData

  1. protected java.lang.String[][] clientTaskData
Client task data

colNames

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

taskValidateErrorMessages

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

mutables

  1. protected boolean[] mutables
Columns that can be changed

requiredColumns

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

hiddenColumns

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

hasHiddenColumns

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

Constructor Detail

AppDeploymentTask

  1. public AppDeploymentTask(AppDeploymentController controller)
Creates an instance of AppDeploymentTask
Parameters:
controller - The AppDeploymentController instance.

Method Detail

taskDataToTraceObject

  1. public static java.lang.String[] taskDataToTraceObject( java.lang.String label,
  2. java.lang.String[][] taskData)

getAppDeploymentController

  1. public AppDeploymentController getAppDeploymentController( )
Returns AppDeploymentController instance
Returns:
AppDeploymentController instance

setAppDeploymentController

  1. public void setAppDeploymentController( AppDeploymentController controller)
Sets the controller instance
Parameters:
controller - The AppDeploymentController instance.

getName

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

getColumnNames

  1. 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

  1. public boolean isTaskEmpty()
Specifies if task has any data
Returns:
boolean true if task has no data; false otherwise

isTaskDisabled

  1. public boolean isTaskDisabled()
Specifies if task should be shown or changed
Returns:
boolean true if task should not be shown; false otherwise

setIsTaskDisabled

  1. public void setIsTaskDisabled(boolean taskDisabled)
Enables or disables the task
Parameters:
taskDisabled - flag to disable the task

isSufficientlyDone

  1. 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

  1. 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

  1. public boolean[] getMutableColumns( )
Returns mutable columns for the task
Returns:
boolean[] an array of boolean values for columns specifying if they are mutable

isMutableColumn

  1. 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

  1. @Deprecated
  2. 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

  1. public boolean[] getRequiredColumns( )

isRequiredColumn

  1. public boolean isRequiredColumn( int index)
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

  1. @Deprecated
  2. 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

  1. 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

  1. public boolean isValidationEnabled( )
Indicates if validation is enabled for task
Returns:
boolean true if validation is eanbled for task; false otherwise

setValidationEnabled

  1. public void setValidationEnabled( boolean status)
Sets status of task validation * * @param status flag to specify that task validation is enabled

getTaskData

  1. public java.lang.String[][] getTaskData( )
Returns task data
Returns:
String[][] copy of task data

setTaskData

  1. public void setTaskData(java.lang.String[][] data)
  2. throws com.ibm.websphere.management.application.client.AppDeploymentException
Set task data
Parameters:
data - task data or null
Throws:
com.ibm.websphere.management.application.client.AppDeploymentException

setTaskData

  1. public void setTaskData(java.lang.String[][] data,
  2. boolean skipDependencies)
  3. throws com.ibm.websphere.management.application.client.AppDeploymentException
Set task data
Parameters:
data - task data or null
skipDependencies -
Throws:
com.ibm.websphere.management.application.client.AppDeploymentException

verifyTaskData

  1. protected void verifyTaskData(java.lang.String[][] data)
  2. throws com.ibm.websphere.management.application.client.AppDeploymentException
Verify data
Parameters:
data - task data or null
Throws:
com.ibm.websphere.management.application.client.AppDeploymentException

validate

  1. public java.lang.String[] validate( )
Validates the task data
Returns:
String[] an array of error messages; null otherwise

buildErrorMessages

  1. protected void buildErrorMessages( java.util.Vector<java.lang.String> errorMessages)
Build error messages
Parameters:
errorMessages - Vector of error messages

getTaskMessages

  1. 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

  1. 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

  1. public int getClientMajorVersion( )
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:
int remote client's major version for edit mode, highest version in all other cases.

isClientModuleEnabled

  1. public boolean isClientModuleEnabled( )
Returns whether client module is enabled
Returns:
true if client module is enabled, otherwise false

isClientModuleEnabled

  1. public boolean isClientModuleEnabled( java.lang.String checkClientModeValue)
Returns whether client module is enabled based on enable client module option and possibly client mode.
Parameters:
checkClientModeValue - whether to take into consideration of client mode to check if client module is enabled. If a client mode is specified, then do further checking to see whether the mode is set to the value passed in.
Returns:
true if client module is enabled, otherwise false

setClientTaskData

  1. public void setClientTaskData(java.lang.String[][] data)
Set client task data

getClientTaskData

  1. public java.lang.String[][] getClientTaskData( )
Returns client task data
Returns:
String[][] copy of client task data

toString

  1. 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.