Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.bizapp.agent.server
Class CommandsServer

java.lang.Object
  extended by org.hyperic.hq.bizapp.agent.server.CommandsServer
All Implemented Interfaces:
AgentNotificationHandler, AgentServerHandler, TokenStorer

public class CommandsServer
extends java.lang.Object
implements AgentServerHandler, TokenStorer, AgentNotificationHandler


Constructor Summary
CommandsServer()
           
 
Method Summary
 AgentRemoteValue dispatchCommand(java.lang.String cmd, AgentRemoteValue args, java.io.InputStream in, java.io.OutputStream out)
          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.
 java.io.OutputStream getTokenStoreStream()
          This method returns an OutputStream which the TokenManager can use to write out all its token information.
 void handleNotification(java.lang.String msgClass, java.lang.String msg)
           
 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

CommandsServer

public CommandsServer()
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 in,
                                        java.io.OutputStream out)
                                 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
in - Input stream which can be used to read special command specific data from the remote entity
out - 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()

getTokenStoreStream

public java.io.OutputStream getTokenStoreStream()
                                         throws java.io.IOException
Description copied from interface: TokenStorer
This method returns an OutputStream which the TokenManager can use to write out all its token information. The TokenManager will also close this stream when it finishes.

Specified by:
getTokenStoreStream in interface TokenStorer
Throws:
java.io.IOException

handleNotification

public void handleNotification(java.lang.String msgClass,
                               java.lang.String msg)
Specified by:
handleNotification in interface AgentNotificationHandler

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.