com.ibm.websphere.management.application.client
Class AppDeploymentTask
- java.lang.Object
-
- 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
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", "79", 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
Fields Modifier and Type Field and Description protected AppDeploymentController
appController
Controller instance that manages tasksprotected java.lang.String[][]
clientTaskData
Client task dataprotected java.lang.String[]
colNames
Task column namesprotected 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 specifiedprotected boolean
isTaskDisabled
Specifies if task should be shown/changedprotected boolean
isTaskEmpty
Specifies if task has any data in itprotected boolean
isValidationEnabled
Specifies if task should be validated.protected boolean[]
mutables
Columns that can be changedprotected java.lang.String
name
Task nameprotected boolean[]
requiredColumns
Columns that can not have an empty (null or "") valueprotected java.lang.String[][]
taskData
Task dataprotected java.lang.String[]
taskValidateErrorMessages
Error messages generated when task is validatedstatic int
VERSION_HIGHEST
-
Constructor Summary
Constructors Constructor and Description AppDeploymentTask(AppDeploymentController controller)
Creates an instance of AppDeploymentTask
-
Method Summary
Methods Modifier and Type Method and Description protected void
buildErrorMessages(java.util.Vector<java.lang.String> errorMessages)
Build error messagesAppDeploymentController
getAppDeploymentController()
Returns AppDeploymentController instancejava.lang.String
getCallerVersion()
Returns the major version of the client code that is calling this task.int
getClientMajorVersion()
Returns the major version of the client code that is calling this task.java.lang.String[][]
getClientTaskData()
Returns client task datajava.lang.String[]
getColumnNames()
Returns column names for the task.boolean[]
getMutableColumns()
Returns mutable columns for the taskboolean
getMutableColumns(int index)
Deprecated.see isMutableColumn(int)java.lang.String
getName()
Returns task nameboolean[]
getRequiredColumns()
boolean
getRequiredColumns(int index)
Deprecated.see isRequiredColumn(int)java.lang.String[][]
getTaskData()
Returns task dataAppDeploymentMessages
getTaskMessages()
Returns AppDeploymentMessages instance for the task.boolean
isClientModuleEnabled()
Returns whether client module is enabledboolean
isClientModuleEnabled(java.lang.String checkClientModeValue)
Returns whether client module is enabled based on enable client module option and possibly client mode.boolean
isHiddenColumn(int index)
Returns if specific column is hiddenboolean
isMutableColumn(int index)
Returns if specific column is mutableboolean
isRequiredColumn(int index)
Returns if value for specific column is requiredboolean
isSufficientlyDone()
Specifies if task has all the required columns populatedboolean
isTaskDisabled()
Specifies if task should be shown or changedboolean
isTaskEmpty()
Specifies if task has any databoolean
isValidationEnabled()
Indicates if validation is enabled for taskvoid
setAppDeploymentController(AppDeploymentController controller)
Sets the controller instancevoid
setClientTaskData(java.lang.String[][] data)
Set client task datavoid
setIsSufficientlyDone(boolean sufficientlyDone)
Sets that the task has all the required datavoid
setIsTaskDisabled(boolean taskDisabled)
Enables or disables the taskvoid
setTaskData(java.lang.String[][] data)
Set task datavoid
setTaskData(java.lang.String[][] data, boolean skipDependencies)
Set task datavoid
setValidationEnabled(boolean status)
Sets status of task validation * * @param status flag to specify that task validation is enabledstatic java.lang.String[]
taskDataToTraceObject(java.lang.String label, java.lang.String[][] taskData)
java.lang.String
toString()
Returns a string representation of this object.java.lang.String[]
validate()
Validates the task dataprotected void
verifyTaskData(java.lang.String[][] data)
Verify data
-
-
-
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
-
clientTaskData
protected java.lang.String[][] clientTaskData
Client 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 (null or "") 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
-
taskDataToTraceObject
public static java.lang.String[] taskDataToTraceObject(java.lang.String label, java.lang.String[][] taskData)
-
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
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
@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 * * @param 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 or null- Throws:
com.ibm.websphere.management.application.client.AppDeploymentException
-
setTaskData
public void setTaskData(java.lang.String[][] data, boolean skipDependencies) throws com.ibm.websphere.management.application.client.AppDeploymentException
Set task data- Parameters:
data
- task data or nullskipDependencies
-- 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 or null- 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> errorMessages)
Build error messages- Parameters:
errorMessages
- 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()
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
public boolean isClientModuleEnabled()
Returns whether client module is enabled- Returns:
- true if client module is enabled, otherwise false
-
isClientModuleEnabled
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
public void setClientTaskData(java.lang.String[][] data)
Set client task data- Parameters:
client
- task data or null
-
getClientTaskData
public java.lang.String[][] getClientTaskData()
Returns client task data- Returns:
- String[][] copy of client task data
-
toString
public java.lang.String toString()
Returns a string representation of this object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this object.
-
-