org.rhq.core.clientapi.server.core
Class AgentRegistrationRequest

java.lang.Object
  extended by org.rhq.core.clientapi.server.core.AgentRegistrationRequest
All Implemented Interfaces:
Serializable

public class AgentRegistrationRequest
extends Object
implements Serializable

Represents a request to register a new agent.

See Also:
Serialized Form

Constructor Summary
AgentRegistrationRequest(String name, String address, int port, String remoteEndpoint, boolean regenerateTokenFlag, String originalToken, AgentVersion agentVersion)
          Creates a new AgentRegistrationRequest object.
 
Method Summary
 String getAddress()
          Returns the address that the agent is bound to in which it listens for requests.
 AgentVersion getAgentVersion()
          Returns the information that identifies the version of the agent asking to be registered.
 String getName()
          Returns the name that the agent is to be known as.
 String getOriginalToken()
          Returns the agent's original token, as it was known to the agent.
 int getPort()
          Returns the port that the agent is listening to.
 boolean getRegenerateToken()
          Returns true if the agent should be given a new token, even if the agent already has a token.
 String getRemoteEndpoint()
          Returns the remote endpoint string that fully describes how to connect to the agent.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgentRegistrationRequest

public AgentRegistrationRequest(String name,
                                String address,
                                int port,
                                String remoteEndpoint,
                                boolean regenerateTokenFlag,
                                String originalToken,
                                AgentVersion agentVersion)
Creates a new AgentRegistrationRequest object. Note that address and port must be specified, even though remoteEndpoint might also encode address and port. The originalToken may be null even if the agent was already registered (this can happen in the case if the token file was deleted on the agent machine; or if the agent was reinstalled which caused the loss of the token). The version information helps the server determine if this agent is obsolete or not.

Parameters:
name - unique name of the agent; usually just the address, but doesn't have to be
address - the address that the agent is listening to
port - the port that the agent is listening to
remoteEndpoint - the full remote endpoint string that the agent wants the server to use to connect to the agent
regenerateTokenFlag - if true, the agent will be assigned a new token. If false and the agent already exists, its current token is returned.
originalToken - the agent's original token, if this is a re-registration (may be null)
agentVersion - the agent's version information
Method Detail

getName

public String getName()
Returns the name that the agent is to be known as. No two agents can have the same name. For that reason, this is usually the same string as that of the address, but technically this does not have to be so. An agent name can be any string, so long as it is globally unique across all agents.

Returns:
the agent name

getAddress

public String getAddress()
Returns the address that the agent is bound to in which it listens for requests. This address is the address as seen by the server (which may or may not be the same as the address as seen by the agent).

Returns:
the address that the server should use when connecting to the agent

getPort

public int getPort()
Returns the port that the agent is listening to. The server should connect to the agent on this port.

Returns:
the port the agent listens to for incoming requests

getRemoteEndpoint

public String getRemoteEndpoint()
Returns the remote endpoint string that fully describes how to connect to the agent. It typically encodes and overrides the address and port values.

Returns:
the full remote endpoint to describe how to connect to the agent

getOriginalToken

public String getOriginalToken()
Returns the agent's original token, as it was known to the agent. This may be null if the agent was never registered before or the agent lost its token.

Returns:
agent's currently known token, or null

getRegenerateToken

public boolean getRegenerateToken()
Returns true if the agent should be given a new token, even if the agent already has a token. If false, and the agent is already registered, the agent will keep its old token. This allows an agent that already exists to request a new token, effectively invalidating the old token.

Returns:
regenerate token flag

getAgentVersion

public AgentVersion getAgentVersion()
Returns the information that identifies the version of the agent asking to be registered.

Returns:
agent version information

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


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