Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.agent.server
Class AgentCommandsServer

java.lang.Object
  extended by org.hyperic.hq.agent.server.AgentCommandsServer
All Implemented Interfaces:
AgentServerHandler

public class AgentCommandsServer
extends java.lang.Object
implements AgentServerHandler

The server-side of the commands the Agent supports. This object implements the appropriate interface to plugin to the Agent as an AgentServerHandler. It provides the server-side to what is called from AgentCommandsClient.


Constructor Summary
AgentCommandsServer()
           
 
Method Summary
 AgentRemoteValue dispatchCommand(java.lang.String cmd, AgentRemoteValue args, java.io.InputStream inStream, java.io.OutputStream outStream)
          dispatchCommand is the method used to invoke any command, previously retrieved via getCommandSet.
 AgentAPIInfo getAPIInfo()
          Get information about the API, including the version number, which is used to ensure that remote APIs match up with local APIs.
 java.lang.String[] getCommandSet()
          Get an array of strings with the commands that this handler recognizes.
 void shutdown()
          inform the plugin that it should shutdown.
 void startup(AgentDaemon agent)
          inform the plugin that it should startup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentCommandsServer

public AgentCommandsServer()
Method Detail

getAPIInfo

public AgentAPIInfo getAPIInfo()
Description copied from interface: AgentServerHandler
Get information about the API, including the version number, which is used to ensure that remote APIs match up with local APIs.

Specified by:
getAPIInfo in interface AgentServerHandler
Returns:
an AgentAPIInfo object, valid for this server handler.

getCommandSet

public java.lang.String[] getCommandSet()
Description copied from interface: AgentServerHandler
Get an array of strings with the commands that this handler recognizes.

Specified by:
getCommandSet in interface AgentServerHandler

dispatchCommand

public AgentRemoteValue dispatchCommand(java.lang.String cmd,
                                        AgentRemoteValue args,
                                        java.io.InputStream inStream,
                                        java.io.OutputStream outStream)
                                 throws AgentRemoteException
Description copied from interface: AgentServerHandler
dispatchCommand is the method used to invoke any command, previously retrieved via getCommandSet. Note that if the inStream and outStream are used, they must be left in a state which the agent can use to communicate exceptions and results back correctly.

Specified by:
dispatchCommand in interface AgentServerHandler
Parameters:
cmd - name of the command to execute
args - argument to pass to the command
inStream - Input stream which can be used to read special command specific data from the remote entity
outStream - Output stream which can be used to write special command specific data to the remote entity.
Returns:
The object which was the result of the method invocation
Throws:
AgentRemoteException - indicating an exception occurred during execution
See Also:
AgentServerHandler.getCommandSet()

startup

public void startup(AgentDaemon agent)
             throws AgentStartException
Description copied from interface: AgentServerHandler
inform the plugin that it should startup. When this method is invoked, a plugin should setup all the internal resources it needs (like helper threads, etc.)

Specified by:
startup in interface AgentServerHandler
Parameters:
agent - The agent.
Throws:
AgentStartException

shutdown

public void shutdown()
Description copied from interface: AgentServerHandler
inform the plugin that it should shutdown. When this method is invoked, a plugin should cleanup all resources (such as open sockets, threads, etc.).

Specified by:
shutdown in interface AgentServerHandler

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.