Class AgentInstance

java.lang.Object
COM.TIBCO.hawk.console.hawkeye.AgentInstance

public class AgentInstance extends Object
AgentInstance objects are used to represent agents.

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 Details

    • AgentInstance

      public AgentInstance(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 Details

    • getAgentID

      public AgentID getAgentID()
      Returns the AgentID of this agent.
      Returns:
      The agent id.
    • getAgentVersion

      public AgentVersion getAgentVersion()
      Returns the agent version.
      Returns:
      The agent version.
    • getAgentPlatform

      public AgentPlatform 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

      public String getCluster()
      Returns the cluster parameter used to initialize the agent.
      Returns:
      The agent cluster.
    • getUserData

      public Object getUserData()
      Returns the user data.
      Returns:
      The user data.
      See Also:
    • setUserData

      public void setUserData(Object userData)
      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

      public RuleBaseStatus[] getStatusRuleBases()
      Returns a list representing the currently loaded and active rule bases.
      Returns:
      A list representing the currently loaded and active rule bases.
    • getStatusMicroAgents

      public MicroAgentID[] 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 by 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.

      See Also:
    • getIPAddress

      public String getIPAddress()
      Returns the IP address string "%d.%d.%d.%d"
      Returns:
      IP address in a string format
    • makeInvalid

      public void makeInvalid()
    • setRuleBaseStatusTable

      public void setRuleBaseStatusTable(RuleBaseStatus[] rbStatus)
    • setRuleBaseEngineState

      public void setRuleBaseEngineState(int rbeState)
    • setMicroAgentStatusTable

      public void setMicroAgentStatusTable(MicroAgentID[] maStatus)
    • toString

      public String toString()
      Overrides:
      toString in class Object