org.rhq.enterprise.communications.command.impl.echo.server
Class EchoCommandService

java.lang.Object
  extended by org.rhq.enterprise.communications.command.server.CommandMBean
      extended by org.rhq.enterprise.communications.command.server.CommandService
          extended by org.rhq.enterprise.communications.command.impl.echo.server.EchoCommandService
All Implemented Interfaces:
MBeanRegistration, CommandExecutor, CommandServiceMBean

public class EchoCommandService
extends CommandService

Performs the echo command which will simply return the received message, with an optional prefix. This is used mainly for testing and debugging of connectivity to the command processor.

Author:
John Mazzitelli

Constructor Summary
EchoCommandService()
           
 
Method Summary
 CommandResponse execute(Command command, InputStream in, OutputStream out)
          Executes the given command and returns its response.
 CommandType[] getSupportedCommandTypes()
          Supports EchoCommand.COMMAND_TYPE.
 
Methods inherited from class org.rhq.enterprise.communications.command.server.CommandService
getCommandServiceId, getConnector, getServiceContainer, getSubsystem, prepareRemoteInputStream, prepareRemoteOutputStream, preRegister, setServiceContainer
 
Methods inherited from class org.rhq.enterprise.communications.command.server.CommandMBean
getLog, getMBeanServer, getObjectName, postDeregister, postRegister, preDeregister, startService, stopService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EchoCommandService

public EchoCommandService()
Method Detail

execute

public CommandResponse execute(Command command,
                               InputStream in,
                               OutputStream out)
Description copied from interface: CommandExecutor
Executes the given command and returns its response.

Parameters:
command - the command to execute
in - input stream should the executor want to get streamed data from the client
out - output stream should the executor want to stream data to the client
Returns:
the results of the command execution
See Also:
CommandExecutor.execute(Command, java.io.InputStream, java.io.OutputStream)

getSupportedCommandTypes

public CommandType[] getSupportedCommandTypes()
Supports EchoCommand.COMMAND_TYPE.

Returns:
array of supported command types
See Also:
CommandServiceMBean.getSupportedCommandTypes()


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