|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.communications.command.AbstractCommand
org.rhq.enterprise.communications.command.impl.generic.GenericCommand
public class GenericCommand
Defines a custom command in which the command metadata (in other words, command type and parameter definitions) are mutable. That is, there are setters defined in this class that allow for command type and parameter definitions to be modified.
Of course, a custom command is worthless unless there is a command service on the server side that can process the command. That is to say, the command type and parameter definitions must be acceptable to the command service where the command is issued.
It is generally not a good thing to allow users of commands to be able to modify command types and parameter definitions as this could make the command inoperable (which is why this capability does not exist in the base superclass}. However, this capability may be needed for specialized clients.
Note that modifications to a custom command have no effect on previous executions of the command. While this may
seem obvious, a less obvious effect is that a command whose AbstractCommand.isCommandInResponse() was
true at the time of execution will be stored in the resulting CommandResponse - changing that flag to
false after the fact will not alter that previous command response.
| Constructor Summary | |
|---|---|
GenericCommand()
|
|
GenericCommand(Command commandToTransform)
|
|
GenericCommand(CommandType commandType,
ParameterDefinition[] paramDefs)
Specialized constructor for GenericCommand that allows the instantiator to dynamically define this
generic commands metadata at runtime. |
|
GenericCommand(Map<String,Object> commandParameters)
|
|
| Method Summary | |
|---|---|
protected CommandType |
buildCommandType()
Builds the command type of this command. |
protected ParameterDefinition[] |
buildParameterDefinitions()
Builds the set of parameter definitions that this command will use. |
void |
setCommandType(CommandType newCommandType)
Allows the caller to modify this custom command's type. |
void |
setParameterDefinitions(ParameterDefinition[] newParameterDefinitions)
Allows the caller to modify this custom command's parameter definitions. |
| Methods inherited from class org.rhq.enterprise.communications.command.AbstractCommand |
|---|
allowAnyParameter, checkParameterValidity, convertParameters, getCommandType, getConfiguration, getParameterDefinition, getParameterDefinitions, getParameterValue, getParameterValues, getParameterValuesInternalMap, hasParameterValue, initializeMetadata, isCommandInResponse, removeParameterValue, removeParameterValues, setCommandInResponse, setParameterValue, setParameterValuesInternalMap, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GenericCommand()
throws IllegalArgumentException,
InvalidParameterDefinitionException
IllegalArgumentException
InvalidParameterDefinitionExceptionAbstractCommand.AbstractCommand()
public GenericCommand(Map<String,Object> commandParameters)
throws IllegalArgumentException,
InvalidParameterDefinitionException
IllegalArgumentException
InvalidParameterDefinitionExceptionAbstractCommand.AbstractCommand(Map)public GenericCommand(Command commandToTransform)
AbstractCommand.AbstractCommand(Command)
public GenericCommand(CommandType commandType,
ParameterDefinition[] paramDefs)
GenericCommand that allows the instantiator to dynamically define this
generic commands metadata at runtime.
commandType - this command typeparamDefs - the definitions for this command's parameters| Method Detail |
|---|
public void setCommandType(CommandType newCommandType)
type. Note that calling this method with
a command type that is not understood by a server-side command service will render this command inoperable.
newCommandType - this command's new command typepublic void setParameterDefinitions(ParameterDefinition[] newParameterDefinitions)
parameter definitions. Note that
calling this method with definitions that are not understood by a server-side command service will render this
command inoperable.
The given set of parameter definitions completely override the currently existing definitions (i.e. they are not merged; the new definitions replace the old definitions).
Changing the parameter definitions may invalidate the current set of parameter values. Calling
AbstractCommand.checkParameterValidity(boolean) will determine if the current parameter values are still
valid for the new parameter definitions.
newParameterDefinitions - this command's new parameter definitionsprotected CommandType buildCommandType()
AbstractCommandnull.
This method is called by the command's constructors.
buildCommandType in class AbstractCommandnullAbstractCommand.buildCommandType()protected ParameterDefinition[] buildParameterDefinitions()
AbstractCommandnull if the command accepts any and all parameters, regardless of name or typeThis method is called by the command's constructors.
buildParameterDefinitions in class AbstractCommandnullAbstractCommand.buildParameterDefinitions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||