public class EchoCommand extends AbstractCommand
| Modifier and Type | Field and Description |
|---|---|
static CommandType |
COMMAND_TYPE
command type constant identifying this type of command
|
static ParameterDefinition |
PARAM_MESSAGE
the required command parameter name that identifies the message to echo back to the client
|
static ParameterDefinition |
PARAM_PREFIX
the optional command parameter name that identifies a string to prefix the echo message
|
| Constructor and Description |
|---|
EchoCommand()
Constructor for
EchoCommand. |
EchoCommand(Command commandToTransform)
Constructor for
EchoCommand. |
EchoCommand(Map<String,Object> commandParameters)
Constructor for
EchoCommand. |
| Modifier and Type | Method and Description |
|---|---|
protected CommandType |
buildCommandType()
Builds the command type of this command.
|
protected ParameterDefinition[] |
buildParameterDefinitions()
Builds the set of parameter definitions that this command will use.
|
String |
getMessage()
Gets the message parameter value that will be echoed back to the client.
|
String |
getPrefix()
Gets the (optional) parameter whose value will be used by the server to prefix the
echoed message. |
void |
setMessage(String message)
Sets the message that will be echoed back to the client.
|
void |
setPrefix(String prefix)
An optional parameter whose value will be used by the server to prefix the
echoed message. |
allowAnyParameter, checkParameterValidity, convertParameters, getCommandType, getConfiguration, getParameterDefinition, getParameterDefinitions, getParameterValue, getParameterValues, getParameterValuesInternalMap, hasParameterValue, initializeMetadata, isCommandInResponse, removeParameterValue, removeParameterValues, setCommandInResponse, setParameterValue, setParameterValuesInternalMap, toString, toStringpublic static final CommandType COMMAND_TYPE
public static final ParameterDefinition PARAM_MESSAGE
public static final ParameterDefinition PARAM_PREFIX
public EchoCommand()
throws IllegalArgumentException,
InvalidParameterDefinitionException
EchoCommand.public EchoCommand(Map<String,Object> commandParameters) throws IllegalArgumentException, InvalidParameterDefinitionException
EchoCommand.public EchoCommand(Command commandToTransform)
EchoCommand.public String getMessage()
public void setMessage(String message)
message - a message that the server will echo back to the clientpublic String getPrefix()
echoed message.public void setPrefix(String prefix)
echoed message.prefix - string to be prefixed to the echo message when it is returned to the clientprotected 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()Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.