com.ibm.websphere.management.cmdframework.provider

Class AbstractTaskCommand

  1. java.lang.Object
  2. extended byorg.eclipse.emf.common.command.AbstractCommand
  3. extended bycom.ibm.websphere.management.cmdframework.provider.AbstractAdminCommand
  4. extended bycom.ibm.websphere.management.cmdframework.provider.AbstractTaskCommand
All implemented interfaces:
AdminCommand, TaskCommand, org.eclipse.emf.common.command.Command

  1. public abstract class AbstractTaskCommand
  2. extends AbstractAdminCommand
  3. implements TaskCommand
The class is the base class for any task command implementation. Any specific task command implementation should derive from this class and only override the methods that javadoc recommends to override.

Nested Class Summary

Nested classes/interfaces inherited from class com.ibm.websphere.management.cmdframework.provider.AbstractAdminCommand
AbstractAdminCommand.CmdNotificationListener
Nested classes/interfaces inherited from class org.eclipse.emf.common.command.AbstractCommand
org.eclipse.emf.common.command.AbstractCommand.NonDirtying

Field Summary

Fields inherited from class com.ibm.websphere.management.cmdframework.provider.AbstractAdminCommand
ASYNC_CUSTOM_TAG, asyncCmdSession, cmdMgrType, cnh, DYNAMIC_CUSTOM_TAG, listSetParamsTable, PRIVATE_CUSTOM_TAG
Fields inherited from class org.eclipse.emf.common.command.AbstractCommand
description, isExecutable, isPrepared, label

Constructor Summary

Constructor and Description
AbstractTaskCommand(com.ibm.websphere.management.cmdframework.commanddata.CommandData commandData)
AbstractTaskCommand(com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata inMetadata)

Method Summary

Modifier and Type Method and Description
  1. protected
  2. void
addNewStep(com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata metadata,com.ibm.websphere.management.cmdframework.commanddata.CommandStepData stepData,int i)
  1. void
addStep(AbstractCommandStep step,int index)
add an additional step for the task.
  1. protected
  2. void
afterStepsExecuted()
This method is called after the steps are executed.
  1. protected
  2. void
beforeStepsExecuted()
This method is called before the steps are executed.
  1. void
commandParamsModified()
This method is called before the user starts to navigate through steps.
  1. protected
  2. void
contructSteps()
  1. void
execute()
Implements the execution flow for a task command.
  1. CommandStep
getCommandStep(java.lang.String stepName)
  1. CommandStep
getCurrentStep(int operation)
  1. CommandStep
getCurrentStep(int operation,java.lang.String stepName)
  1. int
getCurrentStepIndex()
  1. com.ibm.websphere.management.cmdframework.commanddata.TaskCommandData
getTaskCommandData()
  1. com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata
getTaskCommandMetadata()
  1. TaskCommandResult
getTaskCommandResult()
  1. CommandStep
gotoStep(java.lang.String stepName)
  1. boolean
hasNextStep()
  1. boolean
hasPreviousStep()
  1. protected
  2. com.ibm.websphere.management.cmdframework.commanddata.CommandData
initCommandData()
  1. void
listAllStepParamsData()
  1. java.lang.String[]
listCommandSteps()
  1. CommandStep
nextStep()
  1. CommandStep
previousStep()
  1. void
processTaskParameters()
This method is called to process task parameters.
  1. void
resetCommandData(com.ibm.websphere.management.cmdframework.commanddata.CommandData cmdData)
Reset the command data.
  1. void
setCurrentStep(AbstractCommandStep newCurrentStep)
  1. void
setCurrentStepIndex(int index)
  1. protected
  2. java.lang.String
showArrayContents(java.lang.Object[] array)
  1. protected
  2. java.lang.String
showListContents(java.util.List list)
  1. protected
  2. void
stepModified(java.lang.String stepName)
This method is called whenever the user navigates away from the specified step.
  1. protected
  2. void
taskCommandExecuted(boolean success)
This method is called after the task command is executed.
  1. void
validate()
This provides a basic implementation for command parameter validation.
Methods inherited from class com.ibm.websphere.management.cmdframework.provider.AbstractAdminCommand
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
Methods inherited from class org.eclipse.emf.common.command.AbstractCommand
canExecute, canUndo, chain, dispose, getAffectedObjects, getDescription, getLabel, prepare, setDescription, setLabel, toString, undo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.ibm.websphere.management.cmdframework.AdminCommand
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
Methods inherited from interface org.eclipse.emf.common.command.Command
canExecute, canUndo, chain, dispose, getAffectedObjects, getDescription, getLabel, getResult, redo, undo

Constructor Detail

AbstractTaskCommand

  1. public AbstractTaskCommand(com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata inMetadata)
  2. throws CommandNotFoundException
Throws:

AbstractTaskCommand

  1. public AbstractTaskCommand(com.ibm.websphere.management.cmdframework.commanddata.CommandData commandData)
  2. throws CommandNotFoundException
  3. CommandLoadException
Throws:

Method Detail

contructSteps

  1. protected void contructSteps()
  2. throws CommandNotFoundException
Throws:

initCommandData

  1. protected com.ibm.websphere.management.cmdframework.commanddata.CommandData initCommandData( )
Description copied from class: AbstractAdminCommand
Construct proper type of command data instance.
Overrides:
Returns:
newly created command data instance.

getCurrentStep

  1. public CommandStep getCurrentStep( int operation)

getCurrentStep

  1. public CommandStep getCurrentStep( int operation,
  2. java.lang.String stepName)

setCurrentStep

  1. public void setCurrentStep(AbstractCommandStep newCurrentStep)

getCurrentStepIndex

  1. public int getCurrentStepIndex( )

setCurrentStepIndex

  1. public void setCurrentStepIndex( int index)

listCommandSteps

  1. public java.lang.String[] listCommandSteps( )
Description copied from interface: TaskCommand
Lists the command step names contained in this task command including the disabled command steps.
Specified by:
Returns:
the names of command steps defined in this command.

nextStep

  1. public final CommandStep nextStep( )
  2. throws java.util.NoSuchElementException
Description copied from interface: TaskCommand
Gets the next enabled command step. Returns the first enabled step if this method is called first time.
Specified by:
nextStep in interface TaskCommand
Returns:
the next enabled command step.
Throws:
java.util.NoSuchElementException - if there is no enabled step after the cursor.

previousStep

  1. public final CommandStep previousStep( )
  2. throws java.util.NoSuchElementException
Description copied from interface: TaskCommand
Gets the previous enabled step in the task command.
Specified by:
previousStep in interface TaskCommand
Returns:
the previous enabled step in the task command.
Throws:
java.util.NoSuchElementException - if there is no enabled step before the cursor.

hasNextStep

  1. public final boolean hasNextStep( )
Description copied from interface: TaskCommand
Tests if there is an enabled step after the cursor.
Specified by:
hasNextStep in interface TaskCommand
Returns:
true if there is an enabled step after the cursor.

hasPreviousStep

  1. public final boolean hasPreviousStep( )
Description copied from interface: TaskCommand
Tests if there is an enabled step before the cursor.
Specified by:
Returns:
true if there is an enabled step before the cursor.

gotoStep

  1. public final CommandStep gotoStep( java.lang.String stepName)
  2. throws java.util.NoSuchElementException
Description copied from interface: TaskCommand
Goes to the specified step. This method puts the cursor after the step if the call succeeds; the cusor is not moved if the call fails.
Specified by:
gotoStep in interface TaskCommand
Parameters:
stepName - the step name
Returns:
the specified step if the step is found and enabled.
Throws:
java.util.NoSuchElementException - if the step is not found or not enabled.

getCommandStep

  1. public CommandStep getCommandStep( java.lang.String stepName)
  2. throws CommandNotFoundException
Description copied from interface: TaskCommand
Gets the command step of the specified command step name. Unlike the gotoStep method, this method does not change the cursor position. Typically this method is called when the task command is executed in batch mode.
Specified by:
Parameters:
stepName - the command step name
Returns:
the command step of the specified command step name.
Throws:

getTaskCommandData

  1. public final com.ibm.websphere.management.cmdframework.commanddata.TaskCommandData getTaskCommandData( )

getTaskCommandMetadata

  1. public final com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata getTaskCommandMetadata( )

addStep

  1. public void addStep(AbstractCommandStep step,
  2. int index)
add an additional step for the task.
Parameters:
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.

resetCommandData

  1. public void resetCommandData(com.ibm.websphere.management.cmdframework.commanddata.CommandData cmdData)
Reset the command data. Subclass may override this method to put more logic in, but the overriding implementation must call the base implementation first.
Overrides:
Parameters:
cmdData - the new command data.

addNewStep

  1. protected void addNewStep(com.ibm.websphere.management.cmdframework.commandmetadata.TaskCommandMetadata metadata,
  2. com.ibm.websphere.management.cmdframework.commanddata.CommandStepData stepData,
  3. int i)

validate

  1. public void validate()
  2. throws CommandValidationException
This provides a basic implementation for command parameter validation. Basically it validates that the parameter values match up the paramter type and all the required parameters are specified. Subclass may override this method to provide more validation, but it is strongly recommended that the overriding implementation calls the base implementation first.
Specified by:
validate in interface AdminCommand
Overrides:
Throws:
CommandValidationException - if there is any invalid command parameter.

processTaskParameters

  1. public void processTaskParameters( )
This method is called to process task parameters. Command providers which override this processTaskParameters must invoke super.processTaskParameters first and check the command result for any error. The subclass would simply return in the event that the command result indicates that an error occurred. This gives AbstractTaskCommand the chance to perform any preprocessing that might be necessary.
Specified by:

beforeStepsExecuted

  1. protected void beforeStepsExecuted( )
This method is called before the steps are executed. The default implementation is a no-op. Subclass may optionally override this method to do something before steps are executed.

afterStepsExecuted

  1. protected void afterStepsExecuted( )
This method is called after the steps are executed. The default implementation is a no-op. Subclass may optionally override this method to do something after steps are executed.

taskCommandExecuted

  1. protected void taskCommandExecuted( boolean success)
This method is called after the task command is executed. The default implementation is a no-op. Subclass may optionally override this method to clean up data structure or release resources after the task command is executed.
Parameters:
success - true if the command is executed successfully; false otherwise.

showArrayContents

  1. protected java.lang.String showArrayContents( java.lang.Object[] array)

showListContents

  1. protected java.lang.String showListContents( java.util.List list)

stepModified

  1. protected void stepModified(java.lang.String stepName)
This method is called whenever the user navigates away from the specified step. The default implementation notifies all the steps except the specified step that the specified step is modified. Subclass may optionally override this method to response to the modification further, however it is strongly recommended that the subclass implementation calls the base implementation first.
Parameters:
stepName - the name of the step.

commandParamsModified

  1. public void commandParamsModified( )
This method is called before the user starts to navigate through steps. The default implementation notifies all the steps dified. Subclass may optionally override this method to response to the modification further, however it is strongly recommended that the subclass implementation calls the base implementation first.

execute

  1. public void execute()
Implements the execution flow for a task command. This method is final. In other words, subclass should not override this method. The reason is that command framework controls the general control flow. Subclasses may override more specific methods to implement the task command specific semantics and behavior.
Specified by:
execute in interface org.eclipse.emf.common.command.Command
Specified by:

getTaskCommandResult

  1. public TaskCommandResult getTaskCommandResult( )
Description copied from interface: TaskCommand
Gets the task command result.
Specified by:

listAllStepParamsData

  1. public void listAllStepParamsData( )