|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsnmp.SNMPv1TrapListenerInterface
The class SNMPv1TrapListenerInterface implements a server which listens for trap messages sent from remote SNMP entities. The approach is that from version 1 of SNMP, using no encryption of data. Communication occurs via UDP, using port 162, the standard SNMP trap port. Note that this class will only accept SNMPv1 traps. To receive both SNMPv1 and SNMPv2 traps, use the more general SNMPTrapListenerInterface class. Applications utilize this class with classes which implement the SNMPTrapListener interface. These must provide a processTrap() method, and are registered/deregistered with this class through its addTrapListener() and removeTrapListener methods.
Field Summary | |
static int |
SNMP_TRAP_PORT
|
Constructor Summary | |
SNMPv1TrapListenerInterface()
Construct a new trap receiver object to receive traps from remote SNMP hosts. |
|
SNMPv1TrapListenerInterface(java.io.PrintWriter errorReceiver)
Construct a new trap receiver object to receive traps from remote SNMP hosts. |
Method Summary | |
void |
addTrapListener(SNMPTrapListener listener)
|
int |
getReceiveBufferSize()
Returns the current size of the buffer used to receive response packets. |
void |
removeTrapListener(SNMPTrapListener listener)
|
void |
run()
The run() method for the trap interface's listener. |
void |
setErrorReceiver(java.io.PrintWriter errorReceiver)
Set the specified PrintWriter to receive error messages. |
void |
setReceiveBufferSize(int receiveBufferSize)
Set the size of the buffer used to receive response packets. |
void |
startReceiving()
Start listening for trap messages. |
void |
stopReceiving()
Stop listening for trap messages. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SNMP_TRAP_PORT
Constructor Detail |
public SNMPv1TrapListenerInterface() throws java.net.SocketException
public SNMPv1TrapListenerInterface(java.io.PrintWriter errorReceiver) throws java.net.SocketException
Method Detail |
public void setErrorReceiver(java.io.PrintWriter errorReceiver)
public void addTrapListener(SNMPTrapListener listener)
public void removeTrapListener(SNMPTrapListener listener)
public void startReceiving()
public void stopReceiving() throws java.net.SocketException
java.net.SocketException
public void run()
run
in interface java.lang.Runnable
public void setReceiveBufferSize(int receiveBufferSize)
public int getReceiveBufferSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |