|
Luky Library - 4.1.1 (20061117-1148) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectluky.events.MyEventManager
luky.snmp.SnmpManager
public class SnmpManager
The SnmpManger application will use the OneGetPdu to request a MIB
variable. It contains a mib resolver and thread spawner.
Create your object and use performGet() to trigger the result,
or call start to commence a continous polling that will fire
events on a state change.
![]() |
![]() |
Field Summary | |
---|---|
int |
interval
|
Fields inherited from class luky.events.MyEventManager |
---|
listenerList |
Constructor Summary | |
---|---|
SnmpManager(String host,
String community,
int port,
int interval,
String mib,
String oid)
Constructor. |
Method Summary | |
---|---|
void |
init(int interval,
String mib)
init routing. |
boolean |
initOk()
|
String |
performGet()
performs a get operation for a single poll, not a continious polling |
String |
performSet()
performs a set operation for a single oid, not a continious polling |
void |
run()
performs a get operation for a single oid, in a continious polling |
void |
setOid(String oid)
sets a new Oid for this manager |
void |
setOid(String oid,
String mib)
sets a new Oid for this manager |
void |
setSnmpSetValue(String value)
|
void |
start()
starts a new thread to poll oid, sends event on state change |
void |
stop()
stop the polling, destoys the context of the poll |
void |
update(Observable obs,
Object ov)
Implementing the Observer interface. |
Methods inherited from class luky.events.MyEventManager |
---|
addMyEventListener, fireMyEvent, removeMyEventListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int interval
Constructor Detail |
---|
public SnmpManager(String host, String community, int port, int interval, String mib, String oid)
host
- target hostcommunity
- snmp community string (suggest: "public")port
- snmp port, 161 is normalinterval
- delay between polls, in microsecondsmib
- mib file (full path) to translate a mib, if the oid needs it e.g. sysUptime.0oid
- can be a number .1.3.etc or a id eg. sysUptime.0Method Detail |
---|
public void setOid(String oid, String mib)
mib
- mib file (full path) to translate a mib, if the oid needs it e.g. sysUptime.0oid
- can be a number .1.3.etc or a id eg. sysUptime.0public void setOid(String oid)
oid
- can be a number .1.3.etc or a id eg. sysUptime.0public void init(int interval, String mib)
interval
- delay between polls, in microsecondsmib
- mib file (full path) to translate a mib, if the oid needs it e.g. sysUptime.0
can The files can be seperated by a space, tab, new line, carriage return and pipe symbol.
("../mibs/RFC1213-MIB ../mibs/IF-MIB"); MIBs can also be loaded from string URLs. In case
of loading the files from space seperated directories, the whole String should be given
within the double quotes. for e.g. if the MIB file is present in the directory 'Program Files',
("\"../../mibs/Program Files/RFC1213-MIB\"")public void update(Observable obs, Object ov)
update
in interface Observer
obs
- the OneGetPdu variableov
- the varbindOneGetPdu
,
varbind
public void setSnmpSetValue(String value)
public String performGet()
public String performSet()
public void run()
run
in interface Runnable
public boolean initOk()
public void start()
public void stop()
|
Luky Library - 4.1.1 (20061117-1148) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |