com.ibm.websphere.management.cmdframework
Interface AdminCommand
All Superinterfaces:
org.eclipse.emf.common.command.Command
All known subinterfaces:
All known implementing classes:
- public interface AdminCommand
- extends org.eclipse.emf.common.command.Command
This class defines methods in following functionalities:
- get meta data regarding to the command,
- get and set command data such as target object and the parameter values,
- execute the command,
- serialize the command.
Method Summary
Modifier and Type | Method and Description |
---|---|
|
createParameterMetadata(java.lang.String pmName,java.util.Hashtable featureList)
Create a ParameterMetadata object.
|
|
execute(CommandHistory cmdHistory)
Executes the command and puts the command data into the command history.
|
|
generateScript(java.lang.String lang)
Generates the corresponding wsadmin script for the specified scripting language.
|
|
getChoices(java.lang.String paramName)
Returns valid values for the specified parameter.
|
|
getCmdHandler()
Get the handler which was set to handle command notifications
|
|
getCommandMetadata()
Returns the meta data for the command.
|
getCommandResult()
Return a more user friendly version of command result.
|
|
getConfigSession()
Returns user's config session.
|
|
|
getLocale()
return the user's locale.
|
|
getName()
Returns a non-localized admin command name.
|
|
getOrigParameterValue(java.lang.String parameterName)
Gets the original parameter value for the
UploadFile or DownloadFile parameter.
|
|
getParameter(java.lang.String parameterName)
Gets the parameter value for the specified parameter.
|
|
getTargetObject()
Returns the target object of the command.
|
|
getTargetObjectChoices()
Returns valid values for the target object.
|
|
isAsyncCommand()
Check if it is an async command, which is specified by command provider.
|
|
isDynamicStepCommand()
Check if it is a dynamic step command, which is specified by command provider.
|
|
isPrivateParameter(java.lang.String paramName)
Check if it is a private parameter, which is specified by command provider.
|
|
listAllParameterName()
Returns all the parameter names including private one on the
ParameterMetadata objects.
|
|
listParameterName()
Returns parameter names that are not private on the
ParameterMetadata objects.
|
|
listSetParams()
Gets all the command parameters whose value are set.
|
|
save(java.io.OutputStream outputStream)
Serializes the command into the specified output stream.
|
|
setCmdHandler(com.ibm.websphere.management.cmdframework.provider.CmdNotificationHandler handler)
Set the handler to handle command notifications
|
|
setConfigSession(Session session)
Sets the user's config session.
|
|
setLocale(java.util.Locale locale)
Sets the caller's locale.
|
|
setOrigParameterValue(java.lang.String paramName,java.lang.Object value)
Sets the original value for the
UploadFile or DownloadFile parameter.
|
|
setParameter(java.lang.String paramName,java.lang.Object value)
Sets the value for the specified parameter.
|
|
setTargetObject(java.lang.Object targetObj)
Sets the target object for the command.
|
|
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
- java.lang.String getName()
Returns a non-localized admin command name.
Returns:
the name of this admin command.
getCommandMetadata
- com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata getCommandMetadata( )
Returns the meta data for the command.
Returns:
the meta data for the command.
getTargetObject
- 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
- void setTargetObject(java.lang.Object targetObj)
- throws InvalidParameterValueException
Sets the target object for the command.
setConfigSession
- 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
- Session getConfigSession()
Returns user's config session.
It returns null if the config session is never set.
Returns:
user's config session.
setLocale
- 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
- java.util.Locale getLocale()
return the user's locale. It may be null if the locale is never set.
listSetParams
- java.util.Collection listSetParams( )
Gets all the command parameters whose value are set.
Returns:
the command parameter names whose value are set.
getParameter
- java.lang.Object getParameter(java.lang.String parameterName)
- throws InvalidParameterNameException
Gets the parameter value for the specified parameter.
Parameters:
parameterName
- the parameter name. Returns:
the parameter value.
Throws:
setParameter
- void setParameter(java.lang.String paramName,
- java.lang.Object value)
- throws InvalidParameterValueException
- 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
- java.lang.Object getOrigParameterValue( java.lang.String parameterName)
- throws InvalidParameterNameException
Gets the original parameter value for the
UploadFile
or DownloadFile
parameter.
Parameters:
parameterName
- the parameter name. Returns:
the parameter value.
Throws:
setOrigParameterValue
- void setOrigParameterValue(java.lang.String paramName,
- java.lang.Object value)
- throws InvalidParameterValueException
- 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
- 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
- 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
- void validate()
- throws CommandValidationException
Validates the command parameters.
Throws:
CommandValidationException
- if there is any invalid command parameter. execute
- void execute(CommandHistory cmdHistory)
Executes the command and puts the command data into the command history.
Parameters:
cmdHistory
- an implementation of command history getCommandResult
- CommandResult getCommandResult( )
Return a more user friendly version of command result.
Returns:
the result generated from last execution.
save
- void save(java.io.OutputStream outputStream)
- 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
- java.lang.String generateScript( java.lang.String lang)
- 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
- void setCmdHandler(com.ibm.websphere.management.cmdframework.provider.CmdNotificationHandler handler)
Set the handler to handle command notifications
Parameters:
handler
- handler for command notification getCmdHandler
- 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
- 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
- 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
- boolean isPrivateParameter(java.lang.String paramName)
- 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
- 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
- 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
- com.ibm.websphere.management.cmdframework.commandmetadata.ParameterMetadata createParameterMetadata( java.lang.String pmName,
- java.util.Hashtable featureList)
- throws InvalidParameterValueException
- 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