public abstract class AbstractTaskCommand extends AbstractAdminCommand implements TaskCommand
AbstractAdminCommand.CmdNotificationListener
ASYNC_CUSTOM_TAG, asyncCmdSession, cmdMgrType, cnh, DYNAMIC_CUSTOM_TAG, listSetParamsTable, PRIVATE_CUSTOM_TAG
Constructor and Description |
---|
AbstractTaskCommand(com.ibm.websphere.management.cmdframework.commanddata.CommandData commandData) |
AbstractTaskCommand(com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata inMetadata) |
Modifier and Type | Method and Description |
---|---|
protected void |
addNewStep(com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata metadata,
com.ibm.websphere.management.cmdframework.commanddata.CommandStepData stepData,
int i) |
void |
addStep(AbstractCommandStep step,
int index)
add an additional step for the task.
|
protected void |
afterStepsExecuted()
This method is called after the steps are executed.
|
protected void |
beforeStepsExecuted()
This method is called before the steps are executed.
|
void |
commandParamsModified()
This method is called before the user starts to navigate through steps.
|
protected void |
contructSteps() |
void |
execute()
Implements the execution flow for a task command.
|
CommandStep |
getCommandStep(java.lang.String stepName)
Gets the command step of the specified command step name.
|
CommandStep |
getCurrentStep(int operation) |
CommandStep |
getCurrentStep(int operation,
java.lang.String stepName) |
int |
getCurrentStepIndex() |
com.ibm.websphere.management.cmdframework.commanddata.TaskCommandData |
getTaskCommandData() |
com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata |
getTaskCommandMetadata() |
TaskCommandResult |
getTaskCommandResult()
Gets the task command result.
|
CommandStep |
gotoStep(java.lang.String stepName)
Goes to the specified step.
|
boolean |
hasNextStep()
Tests if there is an enabled step after the cursor.
|
boolean |
hasPreviousStep()
Tests if there is an enabled step before the cursor.
|
protected com.ibm.websphere.management.cmdframework.commanddata.CommandData |
initCommandData()
Construct proper type of command data instance.
|
void |
listAllStepParamsData() |
java.lang.String[] |
listCommandSteps()
Lists the command step names contained in this task command including
the disabled command steps.
|
CommandStep |
nextStep()
Gets the next enabled command step.
|
CommandStep |
previousStep()
Gets the previous enabled step in the task command.
|
void |
processTaskParameters()
This method is called to process task parameters.
|
void |
resetCommandData(com.ibm.websphere.management.cmdframework.commanddata.CommandData cmdData)
Reset the command data.
|
void |
setCurrentStep(AbstractCommandStep newCurrentStep) |
void |
setCurrentStepIndex(int index) |
protected java.lang.String |
showArrayContents(java.lang.Object[] array) |
protected java.lang.String |
showListContents(java.util.List list) |
protected void |
stepModified(java.lang.String stepName)
This method is called whenever the user navigates away from the specified step.
|
protected void |
taskCommandExecuted(boolean success)
This method is called after the task command is executed.
|
void |
validate()
This provides a basic implementation for command parameter validation.
|
cleanupUploadedFiles, createParamEObject, createParameterMetadata, execute, generateScript, getChoices, getCmdHandler, getCmdMgrType, getCommandData, getCommandMetadata, getCommandMetadata, getCommandResult, getCommandSession, getConfigService, getConfigSession, getLocale, getName, getOrigParameterValue, getParameter, getParameter, getParameterMetadata, getResult, getTargetObject, getTargetObjectChoices, getUserData, initializeParameter, initializeParameter, isAsyncCommand, isDynamicStepCommand, isLocalMode, isParamReadonly, isPrivateParameter, isTable, listAllParameterName, listParameterName, listSetParams, listSetParams, redo, resetCommandMetadata, save, sendNotification, setCmdHandler, setCmdMgrType, setCommandMetadata, setCommandResult, setCommandSession, setConfigSession, setListSetParamsTable, setLocale, setOrigParameterValue, setParameter, setParameter, setTargetObject, setupListener
canExecute, canUndo, chain, dispose, getAffectedObjects, getDescription, getLabel, prepare, setDescription, setLabel, toString, undo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createParameterMetadata, execute, generateScript, getChoices, getCmdHandler, getCommandMetadata, getCommandResult, getConfigSession, getLocale, getName, getOrigParameterValue, getParameter, getTargetObject, getTargetObjectChoices, isAsyncCommand, isDynamicStepCommand, isPrivateParameter, listAllParameterName, listParameterName, listSetParams, save, setCmdHandler, setConfigSession, setLocale, setOrigParameterValue, setParameter, setTargetObject
public AbstractTaskCommand(com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata inMetadata) throws CommandNotFoundException
CommandNotFoundException
public AbstractTaskCommand(com.ibm.websphere.management.cmdframework.commanddata.CommandData commandData) throws CommandNotFoundException, CommandLoadException
protected void contructSteps() throws CommandNotFoundException
CommandNotFoundException
protected com.ibm.websphere.management.cmdframework.commanddata.CommandData initCommandData()
AbstractAdminCommand
initCommandData
in class AbstractAdminCommand
public CommandStep getCurrentStep(int operation)
public CommandStep getCurrentStep(int operation, java.lang.String stepName)
public void setCurrentStep(AbstractCommandStep newCurrentStep)
public int getCurrentStepIndex()
public void setCurrentStepIndex(int index)
public java.lang.String[] listCommandSteps()
TaskCommand
listCommandSteps
in interface TaskCommand
public final CommandStep nextStep() throws java.util.NoSuchElementException
TaskCommand
nextStep
in interface TaskCommand
java.util.NoSuchElementException
- if there is no enabled step after the cursor.public final CommandStep previousStep() throws java.util.NoSuchElementException
TaskCommand
previousStep
in interface TaskCommand
java.util.NoSuchElementException
- if there is no enabled step before the cursor.public final boolean hasNextStep()
TaskCommand
hasNextStep
in interface TaskCommand
public final boolean hasPreviousStep()
TaskCommand
hasPreviousStep
in interface TaskCommand
public final CommandStep gotoStep(java.lang.String stepName) throws java.util.NoSuchElementException
TaskCommand
gotoStep
in interface TaskCommand
stepName
- the step namejava.util.NoSuchElementException
- if the step is not found or not enabled.public CommandStep getCommandStep(java.lang.String stepName) throws CommandNotFoundException
TaskCommand
gotoStep
method, this method does not change
the cursor position. Typically this method is called when the task command
is executed in batch mode.getCommandStep
in interface TaskCommand
stepName
- the command step nameCommandNotFoundException
public final com.ibm.websphere.management.cmdframework.commanddata.TaskCommandData getTaskCommandData()
public final com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata getTaskCommandMetadata()
public void addStep(AbstractCommandStep step, int index)
step
- - the step instance.index
- - the position of added step in the step list. If index is
out of range, then the step will be added at the end.public void resetCommandData(com.ibm.websphere.management.cmdframework.commanddata.CommandData cmdData)
resetCommandData
in class AbstractAdminCommand
cmdData
- the new command data.protected void addNewStep(com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata metadata, com.ibm.websphere.management.cmdframework.commanddata.CommandStepData stepData, int i)
public void validate() throws CommandValidationException
validate
in interface AdminCommand
validate
in class AbstractAdminCommand
CommandValidationException
- if there is any invalid command parameter.public void processTaskParameters()
processTaskParameters
in interface TaskCommand
protected void beforeStepsExecuted()
protected void afterStepsExecuted()
protected void taskCommandExecuted(boolean success)
success
- true if the command is executed successfully; false otherwise.protected java.lang.String showArrayContents(java.lang.Object[] array)
protected java.lang.String showListContents(java.util.List list)
protected void stepModified(java.lang.String stepName)
stepName
- the name of the step.public void commandParamsModified()
public void execute()
execute
in interface org.eclipse.emf.common.command.Command
execute
in class AbstractAdminCommand
public TaskCommandResult getTaskCommandResult()
TaskCommand
getTaskCommandResult
in interface TaskCommand
public void listAllStepParamsData()