public interface AdminCommand
extends org.eclipse.emf.common.command.Command
This class defines methods in following functionalities:
Modifier and Type | Method and Description |
---|---|
com.ibm.websphere.management.cmdframework.commandmetadata.ParameterMetadata |
createParameterMetadata(java.lang.String pmName,
java.util.Hashtable featureList)
Create a ParameterMetadata object.
|
void |
execute(CommandHistory cmdHistory)
Executes the command and puts the command data into the command history.
|
java.lang.String |
generateScript(java.lang.String lang)
Generates the corresponding wsadmin script for the specified scripting language.
|
java.lang.Object[] |
getChoices(java.lang.String paramName)
Returns valid values for the specified parameter.
|
com.ibm.websphere.management.cmdframework.provider.CmdNotificationHandler |
getCmdHandler()
Get the handler which was set to handle command notifications
|
com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata |
getCommandMetadata()
Returns the meta data for the command.
|
CommandResult |
getCommandResult()
Return a more user friendly version of command result.
|
Session |
getConfigSession()
Returns user's config session.
|
java.util.Locale |
getLocale()
return the user's locale.
|
java.lang.String |
getName()
Returns a non-localized admin command name.
|
java.lang.Object |
getOrigParameterValue(java.lang.String parameterName)
Gets the original parameter value for the
UploadFile or DownloadFile parameter. |
java.lang.Object |
getParameter(java.lang.String parameterName)
Gets the parameter value for the specified parameter.
|
java.lang.Object |
getTargetObject()
Returns the target object of the command.
|
java.lang.Object[] |
getTargetObjectChoices()
Returns valid values for the target object.
|
boolean |
isAsyncCommand()
Check if it is an async command, which is specified by command provider.
|
boolean |
isDynamicStepCommand()
Check if it is a dynamic step command, which is specified by command provider.
|
boolean |
isPrivateParameter(java.lang.String paramName)
Check if it is a private parameter, which is specified by command provider.
|
java.util.List |
listAllParameterName()
Returns all the parameter names including private one on the
ParameterMetadata objects. |
java.util.List |
listParameterName()
Returns parameter names that are not private on the
ParameterMetadata objects. |
java.util.Collection |
listSetParams()
Gets all the command parameters whose value are set.
|
void |
save(java.io.OutputStream outputStream)
Serializes the command into the specified output stream.
|
void |
setCmdHandler(com.ibm.websphere.management.cmdframework.provider.CmdNotificationHandler handler)
Set the handler to handle command notifications
|
void |
setConfigSession(Session session)
Sets the user's config session.
|
void |
setLocale(java.util.Locale locale)
Sets the caller's locale.
|
void |
setOrigParameterValue(java.lang.String paramName,
java.lang.Object value)
Sets the original value for the
UploadFile or DownloadFile parameter. |
void |
setParameter(java.lang.String paramName,
java.lang.Object value)
Sets the value for the specified parameter.
|
void |
setTargetObject(java.lang.Object targetObj)
Sets the target object for the command.
|
void |
validate()
Validates the command parameters.
|
java.lang.String getName()
com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata getCommandMetadata()
java.lang.Object getTargetObject()
void setTargetObject(java.lang.Object targetObj) throws InvalidParameterValueException
targetObj
- the target object valueInvalidParameterValueException
void setConfigSession(Session session)
session
- the user's admin session.Session getConfigSession()
void setLocale(java.util.Locale locale)
locale
- the caller's Locale.java.util.Locale getLocale()
java.util.Collection listSetParams()
java.lang.Object getParameter(java.lang.String parameterName) throws InvalidParameterNameException
parameterName
- the parameter name.InvalidParameterNameException
void setParameter(java.lang.String paramName, java.lang.Object value) throws InvalidParameterValueException, InvalidParameterNameException
paramName
- the parameter name.value
- the parameter value.InvalidParameterValueException
- if the parameter value is not valid.InvalidParameterNameException
java.lang.Object getOrigParameterValue(java.lang.String parameterName) throws InvalidParameterNameException
UploadFile
or DownloadFile
parameter.parameterName
- the parameter name.InvalidParameterNameException
void setOrigParameterValue(java.lang.String paramName, java.lang.Object value) throws InvalidParameterValueException, InvalidParameterNameException
UploadFile
or DownloadFile
parameter.paramName
- the parameter name.value
- the parameter value.InvalidParameterValueException
- if the parameter value is not valid.InvalidParameterNameException
java.lang.Object[] getChoices(java.lang.String paramName)
paramName
- the parameter name.java.lang.Object[] getTargetObjectChoices()
void validate() throws CommandValidationException
CommandValidationException
- if there is any invalid command parameter.void execute(CommandHistory cmdHistory)
cmdHistory
- an implementation of command historyCommandResult getCommandResult()
void save(java.io.OutputStream outputStream) throws CommandException
outputStream
- the output stream that is used to serialize the command
dataCommandException
- if the save operation fails.java.lang.String generateScript(java.lang.String lang) throws CommandException
lang
- the name of the scripting language.CommandException
- if user specified scripting language is not supported.
XXX todo: more specific exception.void setCmdHandler(com.ibm.websphere.management.cmdframework.provider.CmdNotificationHandler handler)
handler
- handler for command notificationcom.ibm.websphere.management.cmdframework.provider.CmdNotificationHandler getCmdHandler()
boolean isAsyncCommand()
boolean isDynamicStepCommand()
boolean isPrivateParameter(java.lang.String paramName) throws InvalidParameterNameException
paramName
- is the name of parameter.InvalidParameterNameException
- if user specified an invalid parameter name.java.util.List listAllParameterName()
ParameterMetadata
objects.java.util.List listParameterName()
ParameterMetadata
objects.com.ibm.websphere.management.cmdframework.commandmetadata.ParameterMetadata createParameterMetadata(java.lang.String pmName, java.util.Hashtable featureList) throws InvalidParameterValueException, InvalidParameterNameException
pmName
- is the name of ParameterMetadata.featureList
- is a Hashtable of ParameterMetadata features (attributes) in feature id - value pair.
CommandMetadataPackage.PARAMETER_METADATA
for list of available features for PARAMETER_METADATA.InvalidParameterNameException
- if the feature (attribute) id is invalid.InvalidParameterValueException
- if the feature (attribute) value type is incorrect.BaseMetadata
,
ParameterMetadata