Class AgentInstance
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.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAgentInstance(AgentID aid, AgentVersion version, AgentPlatform platform, long starttime, 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) -
Method Summary
Modifier and TypeMethodDescriptionReturns the AgentID of this agent.Returns the agent platform.Returns the agent version.Returns the cluster parameter used to initialize the agent.Returns the IP address string "%d.%d.%d.%d"intReturns the current state of the agent's rule base engine.longReturns the agent's start time.Returns a list representing the currently loaded microagents.Returns a list representing the currently loaded and active rule bases.Returns the user data.booleanisValid()Returns true if this AgentInstance is still valid, false otherwise.voidvoidretransmitAlerts(long[] alertIDs) Requests that the agent retransmit the active alerts indicated byalertIDs.voidsetMicroAgentStatusTable(MicroAgentID[] maStatus) voidsetRuleBaseEngineState(int rbeState) voidsetRuleBaseStatusTable(RuleBaseStatus[] rbStatus) voidsetUserData(Object userData) Sets the user data.toString()
-
Constructor Details
-
Method Details
-
getAgentID
Returns the AgentID of this agent.- Returns:
- The agent id.
-
getAgentVersion
Returns the agent version.- Returns:
- The agent version.
-
getAgentPlatform
Returns the agent platform.- Returns:
- The agent platform
-
getStartTime
public long getStartTime()Returns the agent's start time.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.
- Returns:
- The agent's start time.
-
getCluster
Returns the cluster parameter used to initialize the agent.- Returns:
- The agent cluster.
-
getUserData
Returns the user data.- Returns:
- The user data.
- See Also:
-
setUserData
Sets the user data.- See Also:
-
isValid
public boolean isValid()Returns true if this AgentInstance is still valid, false otherwise. An AgentInstance will become invalid when the agent it represents is declared to be expired.- Returns:
- True if this AgentInstance is still valid, false otherwise.
- See Also:
-
getRuleBaseEngineState
public int getRuleBaseEngineState()Returns the current state of the agent's rule base engine. The value may be mapped to a symbolic value using the AlertState interface.- Returns:
- The current state of the agent's rule base engine.
- See Also:
-
getStatusRuleBases
Returns a list representing the currently loaded and active rule bases.- Returns:
- A list representing the currently loaded and active rule bases.
-
getStatusMicroAgents
Returns a list representing the currently loaded microagents.- Returns:
- A list representing the currently loaded microagents.
-
retransmitAlerts
public void retransmitAlerts(long[] alertIDs) Requests that the agent retransmit the active alerts indicated byalertIDs. A null argument requests all currently active alerts. This method does not block. The requested alerts are delivered asynchronously to theonRetransmittedAlert()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
AlertMonitorListenerfor 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.
- See Also:
-
getIPAddress
Returns the IP address string "%d.%d.%d.%d"- Returns:
- IP address in a string format
-
makeInvalid
public void makeInvalid() -
setRuleBaseStatusTable
-
setRuleBaseEngineState
public void setRuleBaseEngineState(int rbeState) -
setMicroAgentStatusTable
-
toString
-