|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.common.command.AbstractCommand
com.ibm.websphere.management.cmdframework.provider.AbstractAdminCommand
public abstract class AbstractAdminCommand
The class is the base class for any admin command implementation. Any specific admin 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 org.eclipse.emf.common.command.AbstractCommand |
---|
org.eclipse.emf.common.command.AbstractCommand.NonDirtying |
Field Summary |
---|
Fields inherited from class org.eclipse.emf.common.command.AbstractCommand |
---|
description, isExecutable, isPrepared, label |
Constructor Summary | |
---|---|
AbstractAdminCommand(CommandData inCommandData)
Constructs an instance of admin command based on its command data |
|
AbstractAdminCommand(CommandMetadata metadata)
|
Method Summary | |
---|---|
protected org.eclipse.emf.ecore.EObject |
createParamEObject()
Create an EObject to store the command's parameter values. |
abstract void |
execute()
Defines the execution logic of command. |
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)
Provides a default implement for the method which always returns null. |
protected CommandData |
getCommandData()
|
CommandMetadata |
getCommandMetadata()
Returns the meta data for the command. |
static CommandMetadata |
getCommandMetadata(java.lang.String cmdName)
|
CommandResult |
getCommandResult()
Return a more user friendly version of command result. |
protected ConfigService |
getConfigService()
Convenient method to access ConfigService component. |
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 |
getParameter(java.lang.String parameterName)
Gets the parameter value for the specified parameter. |
protected java.lang.Object |
getParameter(java.lang.String parameterName,
int rowIndex)
|
protected ParameterMetadata |
getParameterMetadata(java.lang.String paramName)
returns the metadata for the specified parameter. |
java.util.Collection |
getResult()
Provides a default implementation for this method. |
java.lang.Object |
getTargetObject()
Returns the target object of the command. |
java.lang.Object[] |
getTargetObjectChoices()
Provides a default implement for the method which always returns null. |
protected UserData |
getUserData()
Gets the user data for the command data. |
protected CommandData |
initCommandData()
Construct proper type of command data instance. |
protected void |
initializeParameter(java.lang.String paramName,
java.lang.Object value)
|
protected boolean |
isParamReadonly(java.lang.String paramName)
|
protected boolean |
isTable()
|
java.util.Collection |
listSetParams()
Gets all the command parameters whose value are set. |
protected java.util.Collection |
listSetParams(int rowIndex)
|
void |
redo()
|
protected void |
resetCommandData(CommandData cmdData)
Resets the command data for the command. |
void |
save(java.io.OutputStream outputStream)
Serializes the command into the specified output stream. |
protected void |
setCommandResult(CommandResult thisResult)
|
void |
setConfigSession(Session session)
Sets the user's config session. |
void |
setLocale(java.util.Locale locale)
Sets the caller's locale. |
void |
setParameter(java.lang.String paramName,
java.lang.Object value)
Sets the value for the specified parameter. |
protected void |
setParameter(java.lang.String paramName,
java.lang.Object value,
int rowIndex)
|
void |
setTargetObject(java.lang.Object obj)
Sets the target object for the command. |
void |
validate()
Providers a default implmentation for the method. |
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 org.eclipse.emf.common.command.Command |
---|
canExecute, canUndo, chain, dispose, getAffectedObjects, getDescription, getLabel, undo |
Constructor Detail |
---|
public AbstractAdminCommand(CommandMetadata metadata)
public AbstractAdminCommand(CommandData inCommandData) throws CommandNotFoundException
inCommandData
- the command data for the command
CommandNotFoundException
- if the command is not found.Method Detail |
---|
public static CommandMetadata getCommandMetadata(java.lang.String cmdName) throws CommandNotFoundException
CommandNotFoundException
protected CommandData initCommandData()
public java.util.Locale getLocale()
AdminCommand
getLocale
in interface AdminCommand
public void setLocale(java.util.Locale locale)
AdminCommand
setLocale
in interface AdminCommand
locale
- the caller's Locale.public java.lang.String getName()
AdminCommand
getName
in interface AdminCommand
public CommandMetadata getCommandMetadata()
AdminCommand
getCommandMetadata
in interface AdminCommand
protected CommandData getCommandData()
public java.lang.Object getTargetObject()
AdminCommand
getTargetObject
in interface AdminCommand
public void setTargetObject(java.lang.Object obj) throws InvalidParameterValueException
AdminCommand
setTargetObject
in interface AdminCommand
obj
- the target object value
InvalidParameterValueException
public java.util.Collection listSetParams()
AdminCommand
listSetParams
in interface AdminCommand
protected java.util.Collection listSetParams(int rowIndex)
public java.lang.Object getParameter(java.lang.String parameterName) throws InvalidParameterNameException
AdminCommand
getParameter
in interface AdminCommand
parameterName
- the parameter name.
InvalidParameterNameException
protected java.lang.Object getParameter(java.lang.String parameterName, int rowIndex) throws InvalidParameterNameException
InvalidParameterNameException
public void setParameter(java.lang.String paramName, java.lang.Object value) throws InvalidParameterValueException, InvalidParameterNameException
AdminCommand
setParameter
in interface AdminCommand
paramName
- the parameter name.value
- the parameter value.
InvalidParameterValueException
- if the parameter value is not valid.
InvalidParameterNameException
protected void initializeParameter(java.lang.String paramName, java.lang.Object value) throws InvalidParameterValueException, InvalidParameterNameException
InvalidParameterValueException
InvalidParameterNameException
protected void setParameter(java.lang.String paramName, java.lang.Object value, int rowIndex) throws InvalidParameterValueException, InvalidParameterNameException
InvalidParameterValueException
InvalidParameterNameException
protected boolean isTable()
public java.lang.Object[] getChoices(java.lang.String paramName)
getChoices
in interface AdminCommand
paramName
- the parameter name.
public java.lang.Object[] getTargetObjectChoices()
getTargetObjectChoices
in interface AdminCommand
public void validate() throws CommandValidationException
validate
in interface AdminCommand
CommandValidationException
public void setConfigSession(Session session)
AdminCommand
setConfigSession
in interface AdminCommand
session
- the user's admin session.public Session getConfigSession()
AdminCommand
getConfigSession
in interface AdminCommand
public CommandResult getCommandResult()
AdminCommand
getCommandResult
in interface AdminCommand
protected void setCommandResult(CommandResult thisResult)
public void save(java.io.OutputStream outputStream)
AdminCommand
save
in interface AdminCommand
outputStream
- the output stream that is used to serialize the command
datapublic abstract void execute()
execute
in interface org.eclipse.emf.common.command.Command
public void execute(CommandHistory cmdHistory)
AdminCommand
execute
in interface AdminCommand
cmdHistory
- an implementation of command historypublic java.util.Collection getResult()
getResult
in interface org.eclipse.emf.common.command.Command
getResult
in class org.eclipse.emf.common.command.AbstractCommand
public void redo()
redo
in interface org.eclipse.emf.common.command.Command
protected org.eclipse.emf.ecore.EObject createParamEObject() throws CommandNotFoundException
CommandNotFoundException
protected UserData getUserData()
protected void resetCommandData(CommandData cmdData)
cmdData
- the new command data.public java.lang.String generateScript(java.lang.String lang) throws CommandException
AdminCommand
generateScript
in interface AdminCommand
lang
- the name of the scripting language.
CommandException
- if user specified scripting language is not supported.
XXX todo: more specific exception.protected ParameterMetadata getParameterMetadata(java.lang.String paramName) throws InvalidParameterNameException
paramName
- name of parameter
InvalidParameterNameException
protected boolean isParamReadonly(java.lang.String paramName) throws InvalidParameterNameException
InvalidParameterNameException
protected ConfigService getConfigService()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |