|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.management.snmp.manager.SnmpEventReportDispatcher com.sun.management.snmp.SnmpEventReportDispatcher
public class SnmpEventReportDispatcher
Implements an SNMP event report dispatcher.
Listener objects can be registered in an
SnmpEventReportDispatcher
.
The SnmpEventReportDispatcher
listens for any incoming
trap or inform PDU: each time it receives a trap or an inform PDU, it
informs all the listeners.
By default, the dispatcher listens to the UDP port 162.
The SnmpEventReportDispatcher
class implements
Runnable
: it is expected to be used as a
Thread
object. The run method never returns.
An SnmpEventReportDispatcher
object maintains 2 lists of
listener objects. The listener objects implement the
SnmpTrapListener
or SnmpInformListener
interface and will be activated each time an SNMP event report (trap
or inform PDU) is received.
By default, the SnmpEventReportDispatcher will create one
Task
per incoming message (inform or trap) and
triggered listener, and will execute this task in a new thread.
This default threading policy can be overridden by providing a specific
TaskServer
in the constructor of this object.
SnmpTrapListener
,
SnmpInformListener
,
TaskServer
Constructor Summary | |
---|---|
SnmpEventReportDispatcher()
Initializes an SnmpEventReportDispatcher which
listens on the port 162. |
|
SnmpEventReportDispatcher(int portNumber)
Initializes an SnmpEventReportDispatcher which listens
on the specified port. |
|
SnmpEventReportDispatcher(int portNumber,
InetAddress address,
TaskServer packetTaskServer,
TaskServer callbackTaskServer)
Initializes an SnmpEventReportDispatcher which listens
on the specified port. |
|
SnmpEventReportDispatcher(SnmpEngine engine,
int portNumber,
InetAddress address,
TaskServer packetTaskServer,
TaskServer callbackTaskServer)
Initializes an SnmpEventReportDispatcher which listens
on the specified port. |
|
SnmpEventReportDispatcher(SnmpEngine engine,
int portNumber,
TaskServer packetTaskServer,
TaskServer callbackTaskServer)
Initializes an SnmpEventReportDispatcher which listens
on the specified port. |
|
SnmpEventReportDispatcher(SnmpEngineParameters parameters,
SnmpEngineFactory factory,
int portNumber,
InetAddress address,
TaskServer packetTaskServer,
TaskServer callbackTaskServer)
Initializes an SnmpEventReportDispatcher which listens
on the specified port. |
|
SnmpEventReportDispatcher(SnmpEngineParameters parameters,
SnmpEngineFactory factory,
int portNumber,
TaskServer packetTaskServer,
TaskServer callbackTaskServer)
Initializes an SnmpEventReportDispatcher which listens
on the specified port. |
Method Summary | |
---|---|
protected void |
handleCallback(Runnable callbackHandler)
This method invokes a listener callback. |
protected void |
handlePacket(Runnable packetHandler)
This method handles a received SNMP DatagramPacket. |
Methods inherited from class com.sun.management.snmp.manager.SnmpEventReportDispatcher |
---|
addInformListener, addTrapListener, close, containsInformListener, containsTrapListener, getEngine, getEngineId, getInformListeners, getPduFactory, getSnmpInASNParseErrs, getSnmpInBadVersions, getSnmpInInforms, getSnmpInPkts, getSnmpInTraps, getSnmpInvalidMsgs, getSnmpUnknownSecurityModels, getTrapListeners, removeInformListener, removeTrapListener, run, setPduFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SnmpEventReportDispatcher() throws SocketException, IllegalArgumentException
SnmpEventReportDispatcher
which
listens on the port 162.
It instantiates an SnmpEngine.
WARNING : The SnmpEngineId is computed as follows:
SnmpEngineId
.
IllegalArgumentException
- If one of the
specified configuration files do not exist.
SocketException
- If the object cannot bind to the port 162.public SnmpEventReportDispatcher(int portNumber) throws SocketException, IllegalArgumentException
SnmpEventReportDispatcher
which listens
on the specified port.
It instantiates an SnmpEngine.
WARNING : The SnmpEngineId is computed as follows:
SnmpEngineId
.
portNumber
- The port number.
IllegalArgumentException
- If one of the
specified configuration files don't exist.
SocketException
- If the object cannot bind to the
specified port.public SnmpEventReportDispatcher(int portNumber, InetAddress address, TaskServer packetTaskServer, TaskServer callbackTaskServer) throws SocketException, IllegalArgumentException
SnmpEventReportDispatcher
which listens
on the specified port.
It instantiates an SnmpEngine.
WARNING : The SnmpEngineId is computed as follows:
SnmpEngineId
.
portNumber
- The port number.address
- The Ip address the dispatcher will listen for events
on. If null, the dispatcher will listen on localhost.packetTaskServer
- The task server to use when a trap or
inform PDU is received.callbackTaskServer
- The task server to use when invoking
a callback. This can be the same object as
packetTaskServer
IllegalArgumentException
- If one of the
specified configuration files don't exist.
SocketException
- If the object cannot bind to the
specified port.public SnmpEventReportDispatcher(SnmpEngineParameters parameters, SnmpEngineFactory factory, int portNumber, TaskServer packetTaskServer, TaskServer callbackTaskServer) throws SocketException, IllegalArgumentException
SnmpEventReportDispatcher
which listens
on the specified port.
It instantiates an SnmpEngine.
WARNING : The SnmpEngineId is computed as follows:
SnmpEngineId
.
parameters
- The engine parameters to use.factory
- The factory to use in order to create the engine.portNumber
- The port number.packetTaskServer
- The task server to use when a trap or
inform PDU is received.callbackTaskServer
- The task server to use when invoking
a callback. This can be the same object as
packetTaskServer
IllegalArgumentException
- If one of the
specified configuration files don't exist.
SocketException
- If the object cannot bind to the
specified port.public SnmpEventReportDispatcher(SnmpEngine engine, int portNumber, TaskServer packetTaskServer, TaskServer callbackTaskServer) throws SocketException, IllegalArgumentException
SnmpEventReportDispatcher
which listens
on the specified port.
engine
- The SnmpEngine
to use.portNumber
- The port number.packetTaskServer
- The task server to use when a trap or
inform PDU is received.callbackTaskServer
- The task server to use when invoking
a callback. This can be the same object as
packetTaskServer
IllegalArgumentException
- if the passed engine is null.
SocketException
- If the object cannot bind to the
specified port.public SnmpEventReportDispatcher(SnmpEngineParameters parameters, SnmpEngineFactory factory, int portNumber, InetAddress address, TaskServer packetTaskServer, TaskServer callbackTaskServer) throws SocketException, IllegalArgumentException
SnmpEventReportDispatcher
which listens
on the specified port.
It instantiates an SnmpEngine.
WARNING : The SnmpEngineId is computed as follows:
SnmpEngineId
.
parameters
- The engine parameters to use.factory
- The factory to use in order to create the engine.portNumber
- The port number.address
- The Ip address the dispatcher will listen for events
on. If null, the dispatcher will listen on localhost.packetTaskServer
- The task server to use when a trap or
inform PDU is received.callbackTaskServer
- The task server to use when invoking
a callback. This can be the same object as
packetTaskServer
IllegalArgumentException
- If one of the
specified configuration files don't exist.
SocketException
- If the object cannot bind to the
specified port.public SnmpEventReportDispatcher(SnmpEngine engine, int portNumber, InetAddress address, TaskServer packetTaskServer, TaskServer callbackTaskServer) throws SocketException, IllegalArgumentException
SnmpEventReportDispatcher
which listens
on the specified port.
engine
- The SnmpEngine
to use.portNumber
- The port number.address
- The Ip address the dispatcher will listen for events
on. If null, the dispatcher will listen on localhost.packetTaskServer
- The task server to use when a trap or
inform PDU is received.callbackTaskServer
- The task server to use when invoking
a callback. This can be the same object as
packetTaskServer
IllegalArgumentException
- if the passed engine is null.
SocketException
- If the object cannot bind to the
specified port.Method Detail |
---|
protected final void handleCallback(Runnable callbackHandler)
This method uses the callbackTaskServer in order to execute the given callbackHandler.
handleCallback
in class SnmpEventReportDispatcher
callbackHandler
- A Runnable object wrapping the listener
callback to be invoked.protected final void handlePacket(Runnable packetHandler)
This method uses the packetTaskServer in order to execute the given packetHandler.
handlePacket
in class SnmpEventReportDispatcher
packetHandler
- A Runnable object wrapping the packet
to be handled.
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |