public class AgentInstance
extends java.lang.Object
When the AgentMonitor discovers an agent, a new AgentInstace object is instantiated to represent it. When the AgentMonitor detects that an agent has expired, the corresponding AgentInstance object is marked as invalid.
AgentInstance objects are used as the source for all agent specific monitoring events.
Constructor and Description |
---|
AgentInstance(AgentID aid,
AgentVersion version,
AgentPlatform platform,
long starttime,
java.lang.String cluster,
byte[] ip,
int rbeState,
RuleBaseStatus[] rbStatus,
MicroAgentID[] maStatus,
COM.TIBCO.hawk.console.nest.shared.AgentInstanceID aiid,
byte[] groupOpID,
COM.TIBCO.hawk.console.nest.console.AgentEventMonitor agentEventMonitor) |
Modifier and Type | Method and Description |
---|---|
AgentID |
getAgentID()
Returns the AgentID of this agent.
|
AgentPlatform |
getAgentPlatform()
Returns the agent platform.
|
AgentVersion |
getAgentVersion()
Returns the agent version.
|
java.lang.String |
getCluster()
Returns the cluster parameter used to initialize the agent.
|
java.lang.String |
getIPAddress()
Returns the IP address string "%d.%d.%d.%d"
|
int |
getRuleBaseEngineState()
Returns the current state of the agent's rule base engine.
|
long |
getStartTime()
Returns the agent's start time.
|
MicroAgentID[] |
getStatusMicroAgents()
Returns a list representing the currently loaded microagents.
|
RuleBaseStatus[] |
getStatusRuleBases()
Returns a list representing the currently loaded and active rule bases.
|
java.lang.Object |
getUserData()
Returns the user data.
|
boolean |
isValid()
Returns true if this AgentInstance is still valid, false otherwise.
|
void |
makeInvalid() |
void |
retransmitAlerts(long[] alertIDs)
Requests that the agent retransmit the active alerts
indicated by
alertIDs . |
void |
setMicroAgentStatusTable(MicroAgentID[] maStatus) |
void |
setRuleBaseEngineState(int rbeState) |
void |
setRuleBaseStatusTable(RuleBaseStatus[] rbStatus) |
void |
setUserData(java.lang.Object userData)
Sets the user data.
|
java.lang.String |
toString() |
public AgentInstance(AgentID aid, AgentVersion version, AgentPlatform platform, long starttime, java.lang.String cluster, byte[] ip, int rbeState, RuleBaseStatus[] rbStatus, MicroAgentID[] maStatus, COM.TIBCO.hawk.console.nest.shared.AgentInstanceID aiid, byte[] groupOpID, COM.TIBCO.hawk.console.nest.console.AgentEventMonitor agentEventMonitor)
public AgentID getAgentID()
public AgentVersion getAgentVersion()
public AgentPlatform getAgentPlatform()
public long getStartTime()
It reflects the time the agent was initialized from the perspective of the system clock on the host the agent is running on. This value is the number of milliseconds since January 1, 1970, 00:00:00 GMT.
public java.lang.String getCluster()
public java.lang.Object getUserData()
public void setUserData(java.lang.Object userData)
public boolean isValid()
public int getRuleBaseEngineState()
public RuleBaseStatus[] getStatusRuleBases()
public MicroAgentID[] getStatusMicroAgents()
public void retransmitAlerts(long[] alertIDs)
alertIDs
. A null argument requests
all currently active alerts. This method does not block. The requested
alerts are delivered asynchronously to the onRetransmittedAlert()
handler method of the AgentMonitorListener registered
with the console in the form of PostAlertEvent objects whose isRetransmitted()
method returns true.
An active alert is defined as one that has not yet been cleared. You can learn which alerts are currently active per rulebase by invoking getAlertIDs() on the RuleBaseStatus elements of the array returned by getStatusRuleBases(). If you request a retransmission of a cleared alert, it will not be returned.
Note: It is possible for you make a request for an alert you believe to be
active but gets cleared before your request reaches the agent. Such requests
are treated by the agent as a request for a non-active alert and are not serviced.
Also, the agent does not maintain all copies of duplicate alerts, it only
maintains the most recently delivered copy.
(See
AlertMonitorListener
for more details and a description of duplicate alerts.)
This facility is provided so that applications using the TIBHawkConsole may retrieve alerts that agents may have delivered prior to console initialization. Typically, agents will already be running whenever a console application starts. These agents may have already issued alerts which are still outstanding. When an agent is discovered with the AgentMonitorListener.onAgentAlive() method, the AgentInstance source of that event can be examined to learn the alertIDs of all outstanding alerts the agent had at the time of discovery. It can then request a retransmission of one or more of those alerts using their alertID values.
WARNING: when used on networks with a large number of agents, it is NOT advisable to automatically request retransmissions for all outstanding alerts from all agents upon their discovery. Doing so may result in an unacceptably large number of simultaneous network messages produced as all agents attempt to service your requests. The best strategy is to retrieve these alerts on an as-needed basis. If your application does need all currently outstanding alerts at start time, it should throttle its requests. In determining the throttle rate, you should consider the average number of alerts that can be outstanding on the entire network at the times when your application may be started. This is an empirical measure that might best be left as a configuration option with a conservative default value.
public java.lang.String getIPAddress()
public void makeInvalid()
public void setRuleBaseStatusTable(RuleBaseStatus[] rbStatus)
public void setRuleBaseEngineState(int rbeState)
public void setMicroAgentStatusTable(MicroAgentID[] maStatus)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2000-2019 TIBCO Inc. All Rights Reserved.