org.rhq.enterprise.communications.command.impl.echo
Class EchoCommand

java.lang.Object
  extended by org.rhq.enterprise.communications.command.AbstractCommand
      extended by org.rhq.enterprise.communications.command.impl.echo.EchoCommand
All Implemented Interfaces:
Serializable, Command

public class EchoCommand
extends AbstractCommand

The ECHO command used for mainly testing and debugging connectivity.

Author:
John Mazzitelli
See Also:
Serialized Form

Field Summary
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 Summary
EchoCommand()
          Constructor for EchoCommand.
EchoCommand(Command commandToTransform)
          Constructor for EchoCommand.
EchoCommand(Map<String,Object> commandParameters)
          Constructor for EchoCommand.
 
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.
 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.
 
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
 

Field Detail

COMMAND_TYPE

public static final CommandType COMMAND_TYPE
command type constant identifying this type of command


PARAM_MESSAGE

public static final ParameterDefinition PARAM_MESSAGE
the required command parameter name that identifies the message to echo back to the client


PARAM_PREFIX

public static final ParameterDefinition PARAM_PREFIX
the optional command parameter name that identifies a string to prefix the echo message

Constructor Detail

EchoCommand

public EchoCommand()
            throws IllegalArgumentException,
                   InvalidParameterDefinitionException
Constructor for EchoCommand.

Throws:
IllegalArgumentException
InvalidParameterDefinitionException
See Also:
AbstractCommand.AbstractCommand()

EchoCommand

public EchoCommand(Map<String,Object> commandParameters)
            throws IllegalArgumentException,
                   InvalidParameterDefinitionException
Constructor for EchoCommand.

Throws:
IllegalArgumentException
InvalidParameterDefinitionException
See Also:
AbstractCommand.AbstractCommand(Map)

EchoCommand

public EchoCommand(Command commandToTransform)
Constructor for EchoCommand.

See Also:
AbstractCommand.AbstractCommand(Command)
Method Detail

getMessage

public String getMessage()
Gets the message parameter value that will be echoed back to the client.

Returns:
the message that the server will echo back to the client

setMessage

public void setMessage(String message)
Sets the message that will be echoed back to the client.

Parameters:
message - a message that the server will echo back to the client

getPrefix

public String getPrefix()
Gets the (optional) parameter whose value will be used by the server to prefix the echoed message.

Returns:
string to be prefixed to the echo message when it is returned to the client

setPrefix

public void setPrefix(String prefix)
An optional parameter whose value will be used by the server to prefix the echoed message.

Parameters:
prefix - string to be prefixed to the echo message when it is returned to the client

buildCommandType

protected CommandType buildCommandType()
Description copied from class: AbstractCommand
Builds the command type of this command. It must not be null.

This method is called by the command's constructors.

Specified by:
buildCommandType in class AbstractCommand
Returns:
the command's type definition; must not be null
See Also:
AbstractCommand.buildCommandType()

buildParameterDefinitions

protected ParameterDefinition[] buildParameterDefinitions()
Description copied from class: AbstractCommand
Builds the set of parameter definitions that this command will use. Parameter definitions define what parameters this command accepts. Implementors must return one of the following:

This method is called by the command's constructors.

Specified by:
buildParameterDefinitions in class AbstractCommand
Returns:
an array of parameter definitions or null
See Also:
AbstractCommand.buildParameterDefinitions()


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.