public class AbstractCommandStep extends AbstractAdminCommand implements CommandStep
AbstractAdminCommand.CmdNotificationListener
Modifier and Type | Field and Description |
---|---|
protected AbstractTaskCommand |
taskCmd |
ASYNC_CUSTOM_TAG, asyncCmdSession, cmdMgrType, cnh, DYNAMIC_CUSTOM_TAG, listSetParamsTable, PRIVATE_CUSTOM_TAG
Constructor and Description |
---|
AbstractCommandStep(AbstractTaskCommand parent,
com.ibm.websphere.management.cmdframework.commanddata.CommandData commandData) |
AbstractCommandStep(AbstractTaskCommand parent,
com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata metadata) |
Modifier and Type | Method and Description |
---|---|
void |
addRow(javax.management.AttributeList rowData,
int rowIndex)
Add a row to the table at the specified position.
|
void |
commandParamModified()
This method is called whenever the parameter data in the parent task command
are changed.
|
protected org.eclipse.emf.ecore.EObject |
createParamEObject()
Create an EObject to store the command's parameter values.
|
void |
deleteRow(int rowIndex)
Remove a row at the specified position from the table.
|
boolean |
equals(java.lang.Object obj)
If two instance of command step have same name, we consider them eaqual.
|
void |
execute()
Step can not be executed independently, therefore this method is not supported.
|
void |
execute(CommandHistory cmdHistory)
Step can not be executed independently, therefore this method is not supported.
|
protected void |
executeStep()
Execute the current step.
|
java.lang.Object[] |
getChoices(java.lang.String paramName,
int rowIndex)
Returns valid values for the specified parameter.
|
static com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata |
getCommandMetadata(java.lang.String cmdName) |
com.ibm.websphere.management.cmdframework.commanddata.CommandStepData |
getCommandStepData()
A convienent method that returns more type specific value than the generic CommandData.
|
Session |
getConfigSession()
Returns user's config session.
|
int |
getNumberOfRows()
Gets the number of rows in the table.
|
java.lang.Object |
getParameter(java.lang.String parameterName,
int rowIndex)
Gets the parameter value for a specified parameter and row index.
|
int |
hashcode()
Hash the command step according to the command name.
|
protected com.ibm.websphere.management.cmdframework.commanddata.CommandData |
initCommandData()
Construct proper type of command data instance.
|
protected void |
initializeRow(javax.management.AttributeList rowData,
int rowIndex) |
protected void |
initializeStep()
Initialize the current step.
|
boolean |
isEnabled()
Tests if this command step is enabled or not.
|
protected boolean |
isLocalMode() |
boolean |
isRequired()
Check if step has required data missing
|
boolean |
isRequired(int rowIndex)
Check if row at the specified position has required data missing
|
protected boolean |
isTable() |
java.util.Collection |
listSetParams(int rowIndex)
Lists all the parameters are set.
|
void |
resetCommandData(com.ibm.websphere.management.cmdframework.commanddata.CommandData stepData)
Reset the command data for the step.
|
void |
setParameter(java.lang.String paramName,
java.lang.Object value,
int rowIndex)
Sets a parameter value.
|
void |
stepModified(java.lang.String stepName)
This method is called whenever the parameter data in another task step
are changed.
|
protected void |
taskCommandExecuted(boolean success,
boolean executed)
This method is called when the task command completes the execution.
|
void |
validate()
Providers a default implmentation for the method.
|
cleanupUploadedFiles, createParameterMetadata, generateScript, getChoices, getCmdHandler, getCmdMgrType, getCommandData, getCommandMetadata, getCommandResult, getCommandSession, getConfigService, getLocale, getName, getOrigParameterValue, getParameter, getParameterMetadata, getResult, getTargetObject, getTargetObjectChoices, getUserData, initializeParameter, initializeParameter, isAsyncCommand, isDynamicStepCommand, isParamReadonly, isPrivateParameter, listAllParameterName, listParameterName, listSetParams, redo, resetCommandMetadata, save, sendNotification, setCmdHandler, setCmdMgrType, setCommandMetadata, setCommandResult, setCommandSession, setConfigSession, setListSetParamsTable, setLocale, setOrigParameterValue, setParameter, setTargetObject, setupListener
canExecute, canUndo, chain, dispose, getAffectedObjects, getDescription, getLabel, prepare, setDescription, setLabel, toString, undo
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createParameterMetadata, generateScript, getChoices, getCmdHandler, getCommandMetadata, getCommandResult, getLocale, getName, getOrigParameterValue, getParameter, getTargetObject, getTargetObjectChoices, isAsyncCommand, isDynamicStepCommand, isPrivateParameter, listAllParameterName, listParameterName, listSetParams, save, setCmdHandler, setConfigSession, setLocale, setOrigParameterValue, setParameter, setTargetObject
protected AbstractTaskCommand taskCmd
public AbstractCommandStep(AbstractTaskCommand parent, com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata metadata)
public AbstractCommandStep(AbstractTaskCommand parent, com.ibm.websphere.management.cmdframework.commanddata.CommandData commandData) throws CommandNotFoundException
CommandNotFoundException
public static com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata getCommandMetadata(java.lang.String cmdName) throws CommandNotFoundException
CommandNotFoundException
public boolean isEnabled()
CommandStep
isEnabled
in interface CommandStep
protected boolean isLocalMode()
isLocalMode
in class AbstractAdminCommand
public final int hashcode()
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
protected com.ibm.websphere.management.cmdframework.commanddata.CommandData initCommandData()
AbstractAdminCommand
initCommandData
in class AbstractAdminCommand
public final com.ibm.websphere.management.cmdframework.commanddata.CommandStepData getCommandStepData()
public final void resetCommandData(com.ibm.websphere.management.cmdframework.commanddata.CommandData stepData)
resetCommandData
in class AbstractAdminCommand
stepData
- the new command data for the step.public final void execute(CommandHistory cmdHistory)
execute
in interface AdminCommand
execute
in class AbstractAdminCommand
cmdHistory
- an implementation of command historypublic final void execute()
execute
in interface org.eclipse.emf.common.command.Command
execute
in class AbstractAdminCommand
public java.util.Collection listSetParams(int rowIndex) throws java.lang.IndexOutOfBoundsException
CommandStep
listSetParams
in interface CommandStep
listSetParams
in class AbstractAdminCommand
rowIndex
- the row index in the table. Ignored if the command step parameter data is not a table.java.lang.IndexOutOfBoundsException
public java.lang.Object getParameter(java.lang.String parameterName, int rowIndex) throws InvalidParameterNameException, java.lang.IndexOutOfBoundsException
CommandStep
getParameter
in interface CommandStep
getParameter
in class AbstractAdminCommand
parameterName
- the name of a paramterrowIndex
- the row index in the table. Ignored if the command step parameter data is not a table.InvalidParameterNameException
java.lang.IndexOutOfBoundsException
public void setParameter(java.lang.String paramName, java.lang.Object value, int rowIndex) throws InvalidParameterValueException, InvalidParameterNameException, java.lang.IndexOutOfBoundsException
CommandStep
setParameter
in interface CommandStep
setParameter
in class AbstractAdminCommand
paramName
- the name of a parameter.value
- the value of a parameter.rowIndex
- the row index in the table. Ignored if the command step parameter data is not a table.InvalidParameterValueException
InvalidParameterNameException
java.lang.IndexOutOfBoundsException
public int getNumberOfRows()
CommandStep
getNumberOfRows
in interface CommandStep
protected void initializeRow(javax.management.AttributeList rowData, int rowIndex) throws InvalidParameterValueException, java.lang.IndexOutOfBoundsException
InvalidParameterValueException
java.lang.IndexOutOfBoundsException
public void addRow(javax.management.AttributeList rowData, int rowIndex) throws InvalidParameterValueException, java.lang.IndexOutOfBoundsException
CommandStep
addRow
in interface CommandStep
rowData
- the parameter data in a row. The attribute name is a
parameter name and the attribute value is the value for the parameter.rowIndex
- the row index in the table. Ignored if the command step parameter data is not a table.InvalidParameterValueException
java.lang.IndexOutOfBoundsException
public void deleteRow(int rowIndex) throws java.lang.UnsupportedOperationException
CommandStep
deleteRow
in interface CommandStep
rowIndex
- the row index in the table.java.lang.UnsupportedOperationException
- if the command step parameter data is not a table.protected final boolean isTable()
isTable
in class AbstractAdminCommand
protected final org.eclipse.emf.ecore.EObject createParamEObject() throws CommandNotFoundException
AbstractAdminCommand
createParamEObject
in class AbstractAdminCommand
CommandNotFoundException
public void stepModified(java.lang.String stepName) throws CommandException
stepName
- the step name.CommandException
- if not able to change task step by subclass.public void commandParamModified()
public void validate() throws CommandValidationException
AbstractAdminCommand
validate
in interface AdminCommand
validate
in class AbstractAdminCommand
CommandValidationException
- if there is any invalid command parameter.protected void taskCommandExecuted(boolean success, boolean executed)
success
- true if the task command executed successfully, false otherwise.executed
- true if this step is ever executed, false otherwise.protected void executeStep()
protected void initializeStep() throws CommandException
This method is called when this step is returned to command user first time.
CommandException
public boolean isRequired()
CommandStep
isRequired
in interface CommandStep
public Session getConfigSession()
AdminCommand
getConfigSession
in interface AdminCommand
getConfigSession
in class AbstractAdminCommand
public boolean isRequired(int rowIndex)
CommandStep
isRequired
in interface CommandStep
rowIndex
- the row index in the table.public java.lang.Object[] getChoices(java.lang.String paramName, int rowIndex)
CommandStep
getChoices
in interface CommandStep
paramName
- the parameter name.rowIndex
- the row index in the table.