|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rhq.core.domain.resource.Agent
public class Agent
A JON agent.
Field Summary | |
---|---|
static String |
QUERY_COUNT_ALL
|
static String |
QUERY_FIND_ALL
|
static String |
QUERY_FIND_ALL_SUSPECT_AGENTS
|
static String |
QUERY_FIND_BY_ADDRESS_AND_PORT
|
static String |
QUERY_FIND_BY_AGENT_TOKEN
|
static String |
QUERY_FIND_BY_NAME
|
static String |
QUERY_FIND_BY_RESOURCE_ID
|
static String |
QUERY_FIND_RESOURCE_IDS_FOR_AGENT
|
static long |
serialVersionUID
|
Constructor Summary | |
---|---|
protected |
Agent()
Creates a new instance of Agent |
|
Agent(String name,
String address,
int port,
String remoteEndpoint,
String agentToken)
Constructor for Agent . |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
static String |
generateRandomToken(String seed)
Generates a string of up to 100 chars of a (generally) random token. |
String |
getAddress()
Returns the machine address that is used to connect to the agent. |
String |
getAgentToken()
Returns the token string that allows the agent to talk back to the server. |
long |
getCreatedTime()
Returns when this agent object was initially created. |
int |
getId()
|
Date |
getLastAvailabilityReport()
Returns the timestamp when this agent last returned an availability report. |
long |
getModifiedTime()
Returns when this agent object was modified - usually when it receives a new security token. |
String |
getName()
The agent's name will usually, but is not required to, be the fully qualified domain name of the machine where the agent is running. |
int |
getPort()
Returns the port number that the agent is listening to when accepting messages from the server. |
String |
getRemoteEndpoint()
The remote endpoint is the full connection string that is to be used to connect to the agent. |
int |
hashCode()
|
void |
setAddress(String address)
|
void |
setAgentToken(String agentToken)
|
void |
setId(int id)
|
void |
setLastAvailabilityReport(Date lastAvailabilityReport)
Sets the timestamp when this agent last returned an availability report. |
void |
setName(String name)
|
void |
setPort(int port)
|
void |
setRemoteEndpoint(String locatorUri)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
public static final String QUERY_FIND_BY_NAME
public static final String QUERY_FIND_BY_ADDRESS_AND_PORT
public static final String QUERY_FIND_BY_AGENT_TOKEN
public static final String QUERY_FIND_BY_RESOURCE_ID
public static final String QUERY_FIND_ALL
public static final String QUERY_COUNT_ALL
public static final String QUERY_FIND_RESOURCE_IDS_FOR_AGENT
public static final String QUERY_FIND_ALL_SUSPECT_AGENTS
Constructor Detail |
---|
protected Agent()
public Agent(@NotNull String name, String address, int port, String remoteEndpoint, String agentToken)
Agent
.
name
- address
- port
- remoteEndpoint
- agentToken
- Method Detail |
---|
public int getId()
public void setId(int id)
@NotNull public String getName()
address
. However, there is no technical reason
why you cannot have an agent with a name such as "foo". In fact, there are use-cases where the agent name is not
the same as the address (e.g. perhaps you expect the machine to periodically change hostnames due to DNS name
changes and so you want to name it something more permanent).
Agent names must be unique - no two agents can have the same name.
public void setName(@NotNull String name)
@NotNull public String getAddress()
public void setAddress(@NotNull String address)
public int getPort()
public void setPort(int port)
@NotNull public String getAgentToken()
public void setAgentToken(@NotNull String agentToken)
public String getRemoteEndpoint()
null
, a default protocol mechanism will be used. The remote endpoint will usually have both the
address
and port
encoded in it.
public void setRemoteEndpoint(String locatorUri)
public long getCreatedTime()
public long getModifiedTime()
public Date getLastAvailabilityReport()
null
, then this agent
has yet to send its very first availability report.
public void setLastAvailabilityReport(Date lastAvailabilityReport)
lastAvailabilityReport
- when the last availability report was received from this agentpublic boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public static String generateRandomToken(String seed)
setAgentToken(String)
if you need to assign the agent a new token.
seed
- a string to help seed the random number generator - try to make this as unique as possible so as not
to collide with other agents (agent name would be a good candidate)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |