HOME

com.ireasoning.protocol.snmp
Class SnmpPoller

java.lang.Object
  extended bycom.ireasoning.protocol.ListenerManager
      extended bycom.ireasoning.protocol.snmp.SnmpPoller
All Implemented Interfaces:
Runnable

public class SnmpPoller
extends ListenerManager
implements Runnable

This class launches a new thread and does periodical SNMP polling against agent. After instanstiated and set polling interval, it can keep sending snmp get or getnext requests to agent periodically.

See Also:
snmppoll.java example

Field Summary
 
Fields inherited from class com.ireasoning.protocol.ListenerManager
_listeners
 
Constructor Summary
SnmpPoller(SnmpSession session)
          Constructs an SnmpPoller instance
 
Method Summary
 Exception getLastException()
          Checks if any exception occurred
 void pause()
          Pauses polling, which can be resumed by calling resume()
 void resume()
          Resumes polling
 void run()
          Method required by Runnable interface.
 void snmpGetNextPoll(SnmpOID[] oids, long interval)
          Starts polling (SNMP GetNextRequest) passed oids against SNMP agent periodically
 void snmpGetNextPoll(String[] oids, long interval)
          Starts polling (SNMP GetNextRequest) passed oids against SNMP agent periodically
 void snmpGetPoll(SnmpOID[] oids, long interval)
          Starts polling (SNMP GetRequest) passed oids against SNMP agent periodically
 void snmpGetPoll(String[] oids, long interval)
          Starts polling (SNMP GetRequest) passed oids against SNMP agent periodically
 void stop()
          Stops polling
 
Methods inherited from class com.ireasoning.protocol.ListenerManager
addListener, listenerExists, notifyListeners, notifyListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnmpPoller

public SnmpPoller(SnmpSession session)
Constructs an SnmpPoller instance

Parameters:
session - an SnmpSession instance, which has been initialized and connected to a remote agent
Method Detail

snmpGetPoll

public void snmpGetPoll(SnmpOID[] oids,
                        long interval)
Starts polling (SNMP GetRequest) passed oids against SNMP agent periodically

Parameters:
interval - The frequency of polling (in seconds).

snmpGetPoll

public void snmpGetPoll(String[] oids,
                        long interval)
Starts polling (SNMP GetRequest) passed oids against SNMP agent periodically

Parameters:
interval - The frequency of polling (in seconds).

snmpGetNextPoll

public void snmpGetNextPoll(SnmpOID[] oids,
                            long interval)
Starts polling (SNMP GetNextRequest) passed oids against SNMP agent periodically

Parameters:
interval - The frequency of polling (in seconds).

snmpGetNextPoll

public void snmpGetNextPoll(String[] oids,
                            long interval)
Starts polling (SNMP GetNextRequest) passed oids against SNMP agent periodically

Parameters:
interval - The frequency of polling (in seconds).

run

public void run()
Method required by Runnable interface. Not to be called directly

Specified by:
run in interface Runnable

pause

public void pause()
Pauses polling, which can be resumed by calling resume()

See Also:
resume()

resume

public void resume()
Resumes polling


stop

public void stop()
Stops polling


getLastException

public Exception getLastException()
Checks if any exception occurred

Returns:
most recently occurred Exception instance; null if no exception occurred.

HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.