org.rhq.enterprise.communications.command.impl.generic
Class GenericCommandClient

java.lang.Object
  extended by org.rhq.enterprise.communications.command.client.AbstractCommandClient
      extended by org.rhq.enterprise.communications.command.impl.generic.GenericCommandClient
All Implemented Interfaces:
CommandClient

public class GenericCommandClient
extends AbstractCommandClient

Provides a client API for any generic, custom command. Somewhat different than the typical command client implementation, users of this class must utilize the setCommandType(CommandType) to set the type of command prior to invoking via the AbstractCommandClient.invoke(Map) method. This class can be used to send any command via the AbstractCommandClient.invoke(Command) method (without the need to call setCommandType(CommandType).

Author:
John Mazzitelli

Constructor Summary
GenericCommandClient()
           
GenericCommandClient(RemoteCommunicator communicator)
           
 
Method Summary
 Command createNewCommand(Map<String,Object> params)
          Returns a GenericCommand object that can be used as a generic command.
 void setCommandType(CommandType commandType)
          Sets the command type to be used when this client creates new commands via the createNewCommand(Map) method.
 
Methods inherited from class org.rhq.enterprise.communications.command.client.AbstractCommandClient
connectRemoteCommunicator, disconnectRemoteCommunicator, getRemoteCommunicator, invoke, invoke, setRemoteCommunicator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericCommandClient

public GenericCommandClient()
See Also:
AbstractCommandClient.AbstractCommandClient()

GenericCommandClient

public GenericCommandClient(RemoteCommunicator communicator)
See Also:
AbstractCommandClient.AbstractCommandClient(RemoteCommunicator)
Method Detail

createNewCommand

public Command createNewCommand(Map<String,Object> params)
Returns a GenericCommand object that can be used as a generic command. Callers should ensure that they set the command type prior to calling this method.

Parameters:
params - contains parameter values keyed on the parameter names (may be null)
Returns:
a new Command instance
See Also:
CommandClient.createNewCommand(Map)

setCommandType

public void setCommandType(CommandType commandType)
Sets the command type to be used when this client creates new commands via the createNewCommand(Map) method.

Parameters:
commandType - the command type to use when creating new commands.


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