|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rhq.core.domain.resource.Agent
public class Agent
A JON agent.
Nested Class Summary | |
---|---|
static class |
Agent.Status
|
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 | |
---|---|
void |
addStatus(Agent.Status newStatus)
If some subsystem makes a change to some data that this agent cares about (as summarized by the various Agent.Status elements), then that change should be added via this method. |
void |
clearStatus()
If this status was non-zero, some scheduled job would have had to come along to perform some work on behalf of this agent. |
boolean |
equals(Object obj)
|
String |
getAddress()
Returns the machine address that is used to connect to the agent. |
AffinityGroup |
getAffinityGroup()
Returns the AffinityGroup this agent currently belongs to. |
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()
|
Long |
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. |
Server |
getServer()
Returns the Server this agent is currently communicating to. |
int |
getStatus()
Returns 0 if this agent is current. |
List<String> |
getStatusMessages()
|
int |
hashCode()
|
boolean |
isBackFilled()
|
void |
setAddress(String address)
|
void |
setAffinityGroup(AffinityGroup affinityGroup)
Sets the AffinityGroup this agent should belong to. |
void |
setAgentToken(String agentToken)
|
void |
setBackFilled(boolean backFilled)
|
void |
setId(int id)
|
void |
setLastAvailabilityReport(Long lastAvailabilityReport)
Sets the timestamp when this agent last returned an availability report. |
void |
setName(String name)
|
void |
setPort(int port)
|
void |
setRemoteEndpoint(String locatorUri)
|
void |
setServer(Server server)
Sets the Server this agent should communicate with. |
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_AGENT_ID_BY_RESOURCE_ID
public static final String QUERY_FIND_AGENT_ID_BY_NAME
public static final String QUERY_FIND_AGENT_ID_BY_SCHEDULE_ID
public static final String QUERY_FIND_ALL
public static final String QUERY_FIND_BY_SERVER
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
public static final String QUERY_FIND_BY_AFFINITY_GROUP
public static final String QUERY_FIND_WITHOUT_AFFINITY_GROUP
public static final String QUERY_SET_AGENT_BACKFILLED
public static final String QUERY_IS_AGENT_BACKFILLED
public static final String QUERY_FIND_ALL_WITH_STATUS_BY_SERVER
public static final String QUERY_FIND_ALL_WITH_STATUS
public static final String QUERY_UPDATE_CLEAR_STATUS_BY_IDS
public static final String QUERY_REMOVE_SERVER_REFERENCE
public static final String QUERY_UPDATE_STATUS_BY_RESOURCE
public static final String QUERY_UPDATE_STATUS_BY_ALERT_DEFINITION
public static final String QUERY_UPDATE_STATUS_BY_MEASUREMENT_BASELINE
public static final String QUERY_UPDATE_STATUS_BY_AGENT
public static final String QUERY_UPDATE_STATUS_FOR_ALL
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 Long getLastAvailabilityReport()
null
, then this agent
has yet to send its very first availability report.
public void setLastAvailabilityReport(Long lastAvailabilityReport)
lastAvailabilityReport
- when the last availability report was received from this agentpublic AffinityGroup getAffinityGroup()
AffinityGroup
this agent currently belongs to.
AffinityGroup
this agent currently belongs topublic void setAffinityGroup(AffinityGroup affinityGroup)
AffinityGroup
this agent should belong to.
affinityGroup
- the AffinityGroup
this agent should belong topublic Server getServer()
Server
this agent is currently communicating to.
Server
this agent is currently communicating topublic void setServer(Server server)
Server
this agent should communicate with.
server
- the Server
this agent should communicate withpublic int getStatus()
Agent.Status
elements corresponding to the updates that have occurred that are related to this agent.
Agent.Status
elements corresponding to the updates that have occurred that are related to this agent.public void clearStatus()
public void addStatus(Agent.Status newStatus)
Agent.Status
elements), then that change should be added via this method.
Periodically, a background job will come along, check the status, and possibly perform
work on behalf of this agent based on the type of change.
public List<String> getStatusMessages()
public boolean isBackFilled()
public void setBackFilled(boolean backFilled)
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |