com.adventnet.utils.agent
Class SubAgentPoller

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--com.adventnet.utils.agent.SubAgentPoller

public class SubAgentPoller
extends java.lang.Thread
implements com.adventnet.utilities.ui.event.ActionHandlerListener

This class is to check whether the SubAgent is alive or not.

This continuously polls the SubAgent with the parameters set and updates the proxy Tables with the status of the SubAgents.

This class also sends SubAgent LinkUp and LinkDown Traps on configurations.


Field Summary
(package private)  java.util.Vector addVarBindVector
           
(package private)  RegistrationListener agent
           
(package private)  SnmpAgent agentRef
           
(package private)  DynamicRegistrationWithCommunity dynCom
           
(package private)  DynamicRegistrationEntry dynEntry
           
(package private)  java.util.Vector dynProxyVector
           
(package private)  DynamicRegistration dynReg
           
(package private)  DynamicRegistrationWithInstance dynRegInst
           
(package private)  java.util.Vector holderVector
           
(package private)  java.lang.String linkDownOidForContext
           
(package private)  java.lang.String linkDownOidForInstance
           
(package private)  java.lang.String linkDownOidForOid
           
(package private)  java.lang.String linkUpOidForContext
           
(package private)  java.lang.String linkUpOidForInstance
           
(package private)  java.lang.String linkUpOidForOid
           
(package private)  java.lang.String managerHost
           
(package private)  long pollingInterval
           
(package private)  DynamicSnmpProxy proxy
           
(package private)  int retries
           
(package private)  SnmpOID snmpOID
           
(package private)  int timeOut
           
(package private)  int trapPort
           
(package private)  int trapVersion
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY, values
 
Constructor Summary
SubAgentPoller(java.util.Vector dynProxyVector, RegistrationListener agent, DynamicRegistration dynReg, long pollingInterval, int timeOut, int retries)
          Constructs a SubAgent poller for the OID based Proxy Table.
SubAgentPoller(java.util.Vector dynProxyVector, RegistrationListener agent, DynamicRegistrationWithCommunity dynCom, long pollingInterval, int timeOut, int retries)
          Constructs a SubAgent poller for the Context based Proxy Table.
SubAgentPoller(java.util.Vector dynProxyVector, RegistrationListener agent, DynamicRegistrationWithInstance dynRegInst, long pollingInterval, int timeOut, int retries)
          Constructs a SubAgent poller for the Instance based Proxy Table.
 
Method Summary
(package private)  void doPolling()
           
 java.util.Vector getExtraVarBinds()
          Getter for the Vector of Additional VarBinds sent along with the SubAgent LinkUp or LinkDown Traps.
 java.lang.String getLinkDownOidForContext()
          Getter for the LinkDownOid sent with the LinkUp Traps for Context Based Proxy.
 java.lang.String getLinkDownOidForInstance()
          Getter for the LinkDownOid sent with the LinkUp Traps for Instance Based Proxy.
 java.lang.String getLinkDownOidForOid()
          Getter for the LinkUpOid sent with the LinkDown Traps for OID Based Proxy.
 java.lang.String getLinkUpOidForContext()
          Getter for the LinkUpOid sent with the LinkUp Traps for Context Based Proxy.
 java.lang.String getLinkUpOidForInstance()
          Getter for the LinkUpOid sent with the LinkUp Traps for Instance Based Proxy.
 java.lang.String getLinkUpOidForOid()
          Getter for the LinkUpOid sent with the LinkUp Traps for OID Based Proxy.
 void handleAction(com.adventnet.utilities.ui.event.ActionHandlerEvent event)
          Implementation method of ActionHandlerListener Interface.
 void run()
          Starts Polling the SubAgents.
 void sendTrap(java.lang.String status, DynamicRegistrationEntry entry, java.lang.String proxyType)
          The Method to send the LinkUp and LinkDown Traps\Notifications API users need not call this method directly.
 void setAgent(SnmpAgent agentRef)
          Setter for the SnmpAgent Reference.
 void setExtraVarBinds(java.util.Vector vector)
          Method to set Additional VarBinds to be sent along with the SubAgent LinkUp or LinkDown Traps.
 void setLinkDownOidForContext(java.lang.String linkDownOid)
          Setter for the LinkDownTrap OID for Context Based Proxy.
 void setLinkDownOidForInstance(java.lang.String linkDownOid)
          Setter for the LinkDownTrap OID for Instance Based Proxy.
 void setLinkDownOidForOid(java.lang.String linkDownOid)
          Setter for the LinkDownTrap OID for OID Based Proxy.
 void setLinkUpOidForContext(java.lang.String linkUpOid)
          Setter for the LinkUpTrap OID for Context Based Proxy.
 void setLinkUpOidForInstance(java.lang.String linkUpOid)
          Setter for the LinkUpTrap OID for Instance Based Proxy.
 void setLinkUpOidForOid(java.lang.String linkUpOid)
          Setter for the LinkUpTrap OID for OID Based Proxy.
 void setManagerHost(java.lang.String host)
          Deprecated. The method is no Longer used. The Traps will be sent to the Entries in the ForwardingTable.
 void setTrapPort(int port)
          Deprecated. The method is no Longer used. The Traps will be sent to the Entries in the ForwardingTable.
 void setTrapVersion(int version)
          Deprecated. The method is no Longer used. The Traps will be sent to the Entries in the ForwardingTable.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dynProxyVector

java.util.Vector dynProxyVector

dynEntry

DynamicRegistrationEntry dynEntry

agent

RegistrationListener agent

dynReg

DynamicRegistration dynReg

dynRegInst

DynamicRegistrationWithInstance dynRegInst

dynCom

DynamicRegistrationWithCommunity dynCom

proxy

DynamicSnmpProxy proxy

agentRef

SnmpAgent agentRef

pollingInterval

long pollingInterval

timeOut

int timeOut

retries

int retries

addVarBindVector

java.util.Vector addVarBindVector

holderVector

java.util.Vector holderVector

trapPort

int trapPort

trapVersion

int trapVersion

managerHost

java.lang.String managerHost

snmpOID

SnmpOID snmpOID

linkUpOidForOid

java.lang.String linkUpOidForOid

linkDownOidForOid

java.lang.String linkDownOidForOid

linkUpOidForContext

java.lang.String linkUpOidForContext

linkDownOidForContext

java.lang.String linkDownOidForContext

linkUpOidForInstance

java.lang.String linkUpOidForInstance

linkDownOidForInstance

java.lang.String linkDownOidForInstance
Constructor Detail

SubAgentPoller

public SubAgentPoller(java.util.Vector dynProxyVector,
                      RegistrationListener agent,
                      DynamicRegistration dynReg,
                      long pollingInterval,
                      int timeOut,
                      int retries)
Constructs a SubAgent poller for the OID based Proxy Table.
Parameters:
dynProxyVector - The vector of ProxyEntries which are to be polled.
dynReg - The DynamicRegistration instance associated with the proxyTable
agent - The RegistrationListener associated with the Agent.
pollingInterval - The TimeInterval between two consecutive polls.
timeOut - The Time for which this Poller should wait to get back the response
retries - The number of retires to be made to receive the response.

SubAgentPoller

public SubAgentPoller(java.util.Vector dynProxyVector,
                      RegistrationListener agent,
                      DynamicRegistrationWithCommunity dynCom,
                      long pollingInterval,
                      int timeOut,
                      int retries)
Constructs a SubAgent poller for the Context based Proxy Table.
Parameters:
dynProxyVector - The vector of ProxyEntries which are to be polled.
dynCom - The DynamicRegistrationWithCommunity instance associated with the proxyTable
agent - The RegistrationListener associated with the Agent.
pollingInterval - The TimeInterval between two consecutive polls.
timeOut - The Time for which this Poller should wait to get back the response
retries - The number of retires to be made to receive the response.

SubAgentPoller

public SubAgentPoller(java.util.Vector dynProxyVector,
                      RegistrationListener agent,
                      DynamicRegistrationWithInstance dynRegInst,
                      long pollingInterval,
                      int timeOut,
                      int retries)
Constructs a SubAgent poller for the Instance based Proxy Table.
Parameters:
dynProxyVector - The vector of ProxyEntries which are to be polled.
dynRegInst - The DynamicRegistrationWithInstance instance associated with the proxyTable
agent - The RegistrationListener associated with the Agent.
pollingInterval - The TimeInterval between two consecutive polls.
timeOut - The Time for which this Poller should wait to get back the response
retries - The number of retires to be made to receive the response.
Method Detail

run

public void run()
Starts Polling the SubAgents.
Overrides:
run in class java.lang.Thread

setAgent

public void setAgent(SnmpAgent agentRef)
Setter for the SnmpAgent Reference.
Parameters:
agentRef - The SnmpAgent Reference.

setExtraVarBinds

public void setExtraVarBinds(java.util.Vector vector)
Method to set Additional VarBinds to be sent along with the SubAgent LinkUp or LinkDown Traps.
Parameters:
addVector - the Vector of additional VarBinds.

getExtraVarBinds

public java.util.Vector getExtraVarBinds()
Getter for the Vector of Additional VarBinds sent along with the SubAgent LinkUp or LinkDown Traps.
Returns:
the Vector of additional VarBinds.

setLinkUpOidForOid

public void setLinkUpOidForOid(java.lang.String linkUpOid)
Setter for the LinkUpTrap OID for OID Based Proxy. Default value will be .1.3.6.1.4.1.2162.10.3.1.4.1
Parameters:
The - LinkUpOid to be sent with the Traps.

getLinkUpOidForOid

public java.lang.String getLinkUpOidForOid()
Getter for the LinkUpOid sent with the LinkUp Traps for OID Based Proxy.
Returns:
The LinkUp Oid String.

setLinkDownOidForOid

public void setLinkDownOidForOid(java.lang.String linkDownOid)
Setter for the LinkDownTrap OID for OID Based Proxy. Default value will be .1.3.6.1.4.1.2162.10.3.1.4.2
Parameters:
The - LinkUpOid to be sent with the Traps.

getLinkDownOidForOid

public java.lang.String getLinkDownOidForOid()
Getter for the LinkUpOid sent with the LinkDown Traps for OID Based Proxy.
Returns:
The LinkDown Oid String.

setLinkUpOidForInstance

public void setLinkUpOidForInstance(java.lang.String linkUpOid)
Setter for the LinkUpTrap OID for Instance Based Proxy. Default value will be .1.3.6.1.4.1.2162.10.3.1.6.1
Parameters:
The - LinkUpOid to be sent with the Traps.

getLinkUpOidForInstance

public java.lang.String getLinkUpOidForInstance()
Getter for the LinkUpOid sent with the LinkUp Traps for Instance Based Proxy.
Returns:
The LinkUp Oid String.

setLinkDownOidForInstance

public void setLinkDownOidForInstance(java.lang.String linkDownOid)
Setter for the LinkDownTrap OID for Instance Based Proxy. Default value will be .1.3.6.1.4.1.2162.10.3.1.6.2
Parameters:
The - LinkDownOid to be sent with the Traps.

getLinkDownOidForInstance

public java.lang.String getLinkDownOidForInstance()
Getter for the LinkDownOid sent with the LinkUp Traps for Instance Based Proxy.
Returns:
The LinkDown Oid String.

setLinkUpOidForContext

public void setLinkUpOidForContext(java.lang.String linkUpOid)
Setter for the LinkUpTrap OID for Context Based Proxy. Default value will be .1.3.6.1.4.1.2162.10.3.1.5.1
Parameters:
The - LinkUpOid to be sent with the Traps.

getLinkUpOidForContext

public java.lang.String getLinkUpOidForContext()
Getter for the LinkUpOid sent with the LinkUp Traps for Context Based Proxy.
Returns:
The LinkUp Oid String.

setLinkDownOidForContext

public void setLinkDownOidForContext(java.lang.String linkDownOid)
Setter for the LinkDownTrap OID for Context Based Proxy. Default value will be .1.3.6.1.4.1.2162.10.3.1.5.2
Parameters:
The - LinkDownOid to be sent with the Traps.

getLinkDownOidForContext

public java.lang.String getLinkDownOidForContext()
Getter for the LinkDownOid sent with the LinkUp Traps for Context Based Proxy.
Returns:
The LinkDown Oid String.

doPolling

void doPolling()

setTrapPort

public void setTrapPort(int port)
Deprecated. The method is no Longer used. The Traps will be sent to the Entries in the ForwardingTable.

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

setManagerHost

public void setManagerHost(java.lang.String host)
Deprecated. The method is no Longer used. The Traps will be sent to the Entries in the ForwardingTable.

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

setTrapVersion

public void setTrapVersion(int version)
Deprecated. The method is no Longer used. The Traps will be sent to the Entries in the ForwardingTable.

Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

sendTrap

public void sendTrap(java.lang.String status,
                     DynamicRegistrationEntry entry,
                     java.lang.String proxyType)
The Method to send the LinkUp and LinkDown Traps\Notifications API users need not call this method directly.
Parameters:
status - the change in Status of the SubAgent (up\down)
entry - the DynamicRegistrationEntry of the proxy Agent.
proxyType - String specifying the Type of Proxy This can be "OIDBased", "ContextBased" or "InstanceBased".

handleAction

public void handleAction(com.adventnet.utilities.ui.event.ActionHandlerEvent event)
Implementation method of ActionHandlerListener Interface. If the event object is "STOP POLLER" then this poller will be completely stopped.
Specified by:
handleAction in interface com.adventnet.utilities.ui.event.ActionHandlerListener
Parameters:
event - the ActionHandlerEvent that has to be handled.