com.ibm.websphere.management.cmdframework

Interface AdminCommand

All Superinterfaces:
org.eclipse.emf.common.command.Command
All known subinterfaces:
CommandStep, TaskCommand
All known implementing classes:
AbstractAdminCommand, AbstractCommandStep, AbstractTaskCommand, SimpleAdminCommand

  1. public interface AdminCommand
  2. extends org.eclipse.emf.common.command.Command
Defines the base interface for all the admin commands.

This class defines methods in following functionalities:


Method Summary

Modifier and Type Method and Description
  1. com.ibm.websphere.management.cmdframework.commandmetadata.ParameterMetadata
createParameterMetadata(java.lang.String pmName,java.util.Hashtable featureList)
Create a ParameterMetadata object.
  1. void
execute(CommandHistory cmdHistory)
Executes the command and puts the command data into the command history.
  1. java.lang.String
generateScript(java.lang.String lang)
Generates the corresponding wsadmin script for the specified scripting language.
  1. java.lang.Object[]
getChoices(java.lang.String paramName)
Returns valid values for the specified parameter.
  1. com.ibm.websphere.management.cmdframework.provider.CmdNotificationHandler
getCmdHandler()
Get the handler which was set to handle command notifications
  1. com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata
getCommandMetadata()
Returns the meta data for the command.
  1. CommandResult
getCommandResult()
Return a more user friendly version of command result.
  1. Session
getConfigSession()
Returns user's config session.
  1. java.util.Locale
getLocale()
return the user's locale.
  1. java.lang.String
getName()
Returns a non-localized admin command name.
  1. java.lang.Object
getOrigParameterValue(java.lang.String parameterName)
Gets the original parameter value for the UploadFile or DownloadFile parameter.
  1. java.lang.Object
getParameter(java.lang.String parameterName)
Gets the parameter value for the specified parameter.
  1. java.lang.Object
getTargetObject()
Returns the target object of the command.
  1. java.lang.Object[]
getTargetObjectChoices()
Returns valid values for the target object.
  1. boolean
isAsyncCommand()
Check if it is an async command, which is specified by command provider.
  1. boolean
isDynamicStepCommand()
Check if it is a dynamic step command, which is specified by command provider.
  1. boolean
isPrivateParameter(java.lang.String paramName)
Check if it is a private parameter, which is specified by command provider.
  1. java.util.List
listAllParameterName()
Returns all the parameter names including private one on the ParameterMetadata objects.
  1. java.util.List
listParameterName()
Returns parameter names that are not private on the ParameterMetadata objects.
  1. java.util.Collection
listSetParams()
Gets all the command parameters whose value are set.
  1. void
save(java.io.OutputStream outputStream)
Serializes the command into the specified output stream.
  1. void
setCmdHandler(com.ibm.websphere.management.cmdframework.provider.CmdNotificationHandler handler)
Set the handler to handle command notifications
  1. void
setConfigSession(Session session)
Sets the user's config session.
  1. void
setLocale(java.util.Locale locale)
Sets the caller's locale.
  1. void
setOrigParameterValue(java.lang.String paramName,java.lang.Object value)
Sets the original value for the UploadFile or DownloadFile parameter.
  1. void
setParameter(java.lang.String paramName,java.lang.Object value)
Sets the value for the specified parameter.
  1. void
setTargetObject(java.lang.Object targetObj)
Sets the target object for the command.
  1. void
validate()
Validates the command parameters.
Methods inherited from interface org.eclipse.emf.common.command.Command
canExecute, canUndo, chain, dispose, execute, getAffectedObjects, getDescription, getLabel, getResult, redo, undo

Method Detail

getName

  1. java.lang.String getName()
Returns a non-localized admin command name.
Returns:
the name of this admin command.

getCommandMetadata

  1. com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata getCommandMetadata( )
Returns the meta data for the command.
Returns:
the meta data for the command.

getTargetObject

  1. java.lang.Object getTargetObject( )
Returns the target object of the command. If the admin command does not contains any target object, this method returns null.
Returns:
the target object of the command.

setTargetObject

  1. void setTargetObject(java.lang.Object targetObj)
  2. throws InvalidParameterValueException
Sets the target object for the command.
Parameters:
targetObj - the target object value
Throws:

setConfigSession

  1. void setConfigSession(Session session)
Sets the user's config session. This is only needed for configuration related commands.
Parameters:
session - the user's admin session.

getConfigSession

  1. Session getConfigSession()
Returns user's config session. It returns null if the config session is never set.
Returns:
user's config session.

setLocale

  1. void setLocale(java.util.Locale locale)
Sets the caller's locale. If this method is not called, the system default locale will be used.
Parameters:
locale - the caller's Locale.

getLocale

  1. java.util.Locale getLocale()
return the user's locale. It may be null if the locale is never set.

listSetParams

  1. java.util.Collection listSetParams( )
Gets all the command parameters whose value are set.
Returns:
the command parameter names whose value are set.

getParameter

  1. java.lang.Object getParameter(java.lang.String parameterName)
  2. throws InvalidParameterNameException
Gets the parameter value for the specified parameter.
Parameters:
parameterName - the parameter name.
Returns:
the parameter value.
Throws:

setParameter

  1. void setParameter(java.lang.String paramName,
  2. java.lang.Object value)
  3. throws InvalidParameterValueException
  4. InvalidParameterNameException
Sets the value for the specified parameter.
Parameters:
paramName - the parameter name.
value - the parameter value.
Throws:
InvalidParameterValueException - if the parameter value is not valid.

getOrigParameterValue

  1. java.lang.Object getOrigParameterValue( java.lang.String parameterName)
  2. throws InvalidParameterNameException
Gets the original parameter value for the UploadFile or DownloadFile parameter.
Parameters:
parameterName - the parameter name.
Returns:
the parameter value.
Throws:

setOrigParameterValue

  1. void setOrigParameterValue(java.lang.String paramName,
  2. java.lang.Object value)
  3. throws InvalidParameterValueException
  4. InvalidParameterNameException
Sets the original value for the UploadFile or DownloadFile parameter.
Parameters:
paramName - the parameter name.
value - the parameter value.
Throws:
InvalidParameterValueException - if the parameter value is not valid.

getChoices

  1. java.lang.Object[] getChoices(java.lang.String paramName)
Returns valid values for the specified parameter. Implementation of this method is optional. If command provider does not implement this method, then this method returns null.
Parameters:
paramName - the parameter name.
Returns:
an array of valid values for the specified parameter.

getTargetObjectChoices

  1. java.lang.Object[] getTargetObjectChoices( )
Returns valid values for the target object. Implementation of this method is optional. If command provider does not implement this method, then this method returns null.
Returns:
an array of valid values for the specified parameter.

validate

  1. void validate()
  2. throws CommandValidationException
Validates the command parameters.
Throws:
CommandValidationException - if there is any invalid command parameter.

execute

  1. void execute(CommandHistory cmdHistory)
Executes the command and puts the command data into the command history.
Parameters:
cmdHistory - an implementation of command history

getCommandResult

  1. CommandResult getCommandResult( )
Return a more user friendly version of command result.
Returns:
the result generated from last execution.

save

  1. void save(java.io.OutputStream outputStream)
  2. throws CommandException
Serializes the command into the specified output stream.
Parameters:
outputStream - the output stream that is used to serialize the command data
Throws:
CommandException - if the save operation fails.

generateScript

  1. java.lang.String generateScript( java.lang.String lang)
  2. throws CommandException
Generates the corresponding wsadmin script for the specified scripting language.
Parameters:
lang - the name of the scripting language.
Returns:
wsadmin script for the command.
Throws:
CommandException - if user specified scripting language is not supported. XXX todo: more specific exception.

setCmdHandler

  1. void setCmdHandler(com.ibm.websphere.management.cmdframework.provider.CmdNotificationHandler handler)
Set the handler to handle command notifications
Parameters:
handler - handler for command notification

getCmdHandler

  1. com.ibm.websphere.management.cmdframework.provider.CmdNotificationHandler getCmdHandler( )
Get the handler which was set to handle command notifications
Returns:
Handler for command notifications. Null if no handler was set.

isAsyncCommand

  1. boolean isAsyncCommand()
Check if it is an async command, which is specified by command provider.
Returns:
true if this command is async; false otherwise.

isDynamicStepCommand

  1. boolean isDynamicStepCommand()
Check if it is a dynamic step command, which is specified by command provider.
Returns:
true if this command has dynamic step; false otherwise.

isPrivateParameter

  1. boolean isPrivateParameter(java.lang.String paramName)
  2. throws InvalidParameterNameException
Check if it is a private parameter, which is specified by command provider.
Parameters:
paramName - is the name of parameter.
Returns:
true if this parameter is private; false otherwise.
Throws:
InvalidParameterNameException - if user specified an invalid parameter name.

listAllParameterName

  1. java.util.List listAllParameterName( )
Returns all the parameter names including private one on the ParameterMetadata objects.
Returns:
a list of parameter name in String type.

listParameterName

  1. java.util.List listParameterName( )
Returns parameter names that are not private on the ParameterMetadata objects.
Returns:
a list of parameter name in String type.

createParameterMetadata

  1. com.ibm.websphere.management.cmdframework.commandmetadata.ParameterMetadata createParameterMetadata( java.lang.String pmName,
  2. java.util.Hashtable featureList)
  3. throws InvalidParameterValueException
  4. InvalidParameterNameException
Create a ParameterMetadata object.
Parameters:
pmName - is the name of ParameterMetadata.
featureList - is a Hashtable of ParameterMetadata features (attributes) in feature id - value pair.

See CommandMetadataPackage.PARAMETER_METADATA for list of available features for PARAMETER_METADATA.
Returns:
a new object of class ParameterMetadata.
Throws:
InvalidParameterNameException - if the feature (attribute) id is invalid.
InvalidParameterValueException - if the feature (attribute) value type is incorrect.
See Also:
BaseMetadata, ParameterMetadata