Class DefaultTrapContext
- All Implemented Interfaces:
Runnable
,ListeningContextFace
addTrapListener()
method,
the unhandled trap listeners are added via the
addUnhandledTrapListener()
.
Use one of the getInstance()
methods to get the instance and add a trap
listener. This class will fire undecoded trap events, i.e. the raw
data is sent and no attempt is made to decode the data into a pdu.
The SnmpContext classes provide functionality for decoded trap events. These classes will register themselves to the DefaultTrapContext object and only pass the event on if it matches their configuration.
Note that because only one instance of this class
can exist, the first call of getInstance()
will define
the settings
(i.e. port number and socket type) for the lifetime of the stack. All
the subsequent calls of getInstance()
will return the existing
instance, irrespective of the arguments.
On UNIX and Linux operating systems the default port where trap are sent (i.e. 162) can only be opened as root.
Note, this class is now deprecated. We are (very) slowly trying to move to a more general way of receiving packets and adding agent functionality. ListeningContext and ListeningContextPool allow the stack to listen to more than one port.
- Version:
- $Revision: 3.12 $ $Date: 2009/03/05 13:12:50 $
- Author:
- Birgit Arkesteijn
- See Also:
-
Field Summary
Fields inherited from interface uk.co.westhawk.snmp.stack.ListeningContextFace
DEFAULT_TRAP_PORT
-
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultTrapContext
getInstance
(int port) Deprecated.Returns the instance of DefaultTrapContext.static DefaultTrapContext
getInstance
(int port, String typeSocketA) Deprecated.Returns the instance of DefaultTrapContext.Methods inherited from class uk.co.westhawk.snmp.stack.ListeningContext
addRawPduListener, addUnhandledRawPduListener, destroy, getBindAddress, getHashKey, getMaxRecvSize, getPort, getTypeSocket, removeRawPduListener, removeUnhandledRawPduListener, run, setMaxRecvSize, toString
-
Method Details
-
getInstance
Deprecated.Returns the instance of DefaultTrapContext. It will create the instance if it didn't exists. See the note above.- Throws:
IOException
-
getInstance
Deprecated.Returns the instance of DefaultTrapContext. It will create the instance if it didn't exists. See the note above.- Throws:
IOException
-
ListeningContext
andListeningContextPool