org.rhq.core.clientapi.server.core
Interface CoreServerService


public interface CoreServerService

The interface to a JON server's core administrative functions used by remote agents.


Method Summary
 void agentIsShuttingDown(String agentName)
          When an agent is shutting down, it will notify the server by calling this method.
 ConnectAgentResults connectAgent(ConnectAgentRequest connectRequest)
          Connect an agent with this server.
 FailoverListComposite getFailoverList(String agentName)
          Returns the current server list for the agent.
 InputStream getFileContents(String file)
          Returns a stream that contains the given file contents.
 List<Plugin> getLatestPlugins()
          Get a list of the registered plugins managed in the server.
 InputStream getPluginArchive(String pluginName)
          Return a stream containing the contents of a plugin jar.
 AgentRegistrationResults registerAgent(AgentRegistrationRequest agentRegistrationRequest)
          Register an agent with this server.
 

Method Detail

registerAgent

AgentRegistrationResults registerAgent(AgentRegistrationRequest agentRegistrationRequest)
                                       throws AgentRegistrationException,
                                              AgentNotSupportedException
Register an agent with this server. The agent may or may not already exist. An agent can re-register if it changes its remote endpoint for example (in the case when its port changes).

Parameters:
agentRegistrationRequest -
Returns:
the resultant registration information
Throws:
AgentRegistrationException - if the agent's registration request was rejected
AgentNotSupportedException - if the agent is not supported by this server

connectAgent

ConnectAgentResults connectAgent(ConnectAgentRequest connectRequest)
                                 throws AgentRegistrationException,
                                        AgentNotSupportedException
Connect an agent with this server. This is the server that will process all of this agent's activity. The agent must already be registered.

Parameters:
connectRequest -
Returns:
the results, which includes the current time in epoch millis of the server
Throws:
AgentRegistrationException - if the agent is not registered
AgentNotSupportedException - if the agent is not supported by this server

getLatestPlugins

List<Plugin> getLatestPlugins()
Get a list of the registered plugins managed in the server.

Returns:
the list of the plugin information describing the more recent plugins the server is managing

getPluginArchive

InputStream getPluginArchive(String pluginName)
Return a stream containing the contents of a plugin jar.

Parameters:
pluginName - The name of the plugin
Returns:
a stream by which the caller can use to pull down the contents of the requested plugin jar

getFileContents

InputStream getFileContents(String file)
Returns a stream that contains the given file contents. The file is located relative to a server-side defined location. If the characters ".." exist anywhere in the given file name, a runtime exception is thrown - you must ask for a file that is located under a server-side defined location. The file may specify one or more subdirectories within its relative path.

Parameters:
file - the file to download
Returns:
a stream that contains the file's data.

agentIsShuttingDown

void agentIsShuttingDown(String agentName)
When an agent is shutting down, it will notify the server by calling this method.

Parameters:
agentName - the name of the agent that is shutting down

getFailoverList

FailoverListComposite getFailoverList(String agentName)
Returns the current server list for the agent. This will return null if no server list exists for the agent.

Parameters:
agentName - the name of the agent requesting the server list
Returns:
The active server list for the agent
Throws:
IllegalArgumentException - if the agentName does not match a registered agent.


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