Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jdmk.snmp.manager
Class SnmpEventReportDispatcher

    java.lang.Object
      |
      +--com.sun.jdmk.snmp.manager.SnmpEventReportDispatcher

public class SnmpEventReportDispatcher
extends java.lang.Object
implements java.lang.Runnable

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.

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.

See Also:
  `SnmpTrapListener`, `SnmpInformListener`

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, TaskServer taskServer)` Initializes an `SnmpEventReportDispatcher` which listens on the specified port and gives messages to taskServer

Method Summary
`void` | `addEventReportListener(SnmpEventReportListener handler)` Deprecated. As of JDMK 4.0, replaced by `addTrapListener(javax.management.snmp.manager.SnmpTrapListener)`
`void` | `addInformListener(SnmpInformListener handler)` Adds an inform request listener to this `SnmpEventReportDispatcher`.
`void` | `addTrapListener(SnmpTrapListener handler)` Adds a trap listener to this `SnmpEventReportDispatcher`.
`boolean` | `containsEventReportReceiver(SnmpEventReportListener handler)` Deprecated. As of JDMK 4.0, replaced by `containsTrapListener(javax.management.snmp.manager.SnmpTrapListener)`
`boolean` | `containsInformListener(SnmpInformListener handler)` Returns `true` if the specified object is listening to inform requests.
`boolean` | `containsTrapListener(SnmpTrapListener handler)` Returns `true` if the specified object is listening to traps.
`java.util.Enumeration` | `getEventReportListeners()` Deprecated. As of JDMK 4.0, replaced by `getTrapListeners()`
`java.util.Enumeration` | `getInformListeners()` Gets all of the inform request listeners.
`SnmpPduFactory` | `getPduFactory()` Gets the PDU factory associated to this `SnmpEventReportDispatcher`.
`java.util.Enumeration` | `getTrapListeners()` Gets all of the trap listeners.
`void` | `removeEventReportListener(SnmpEventReportListener handler)` Deprecated. As of JDMK 4.0, replaced by `removeTrapListener(javax.management.snmp.manager.SnmpTrapListener)`
`void` | `removeInformListener(SnmpInformListener handler)` Removes an inform request listener.
`void` | `removeTrapListener(SnmpTrapListener handler)` Removes a trap listener.
`void` | `run()` Dispatching loop.
`void` | `setPduFactory(SnmpPduFactory factory)` Sets the PDU factory associated to this `SnmpEventReportDispatcher`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SnmpEventReportDispatcher

    public SnmpEventReportDispatcher()
                              throws java.net.SocketException

  Initializes an `SnmpEventReportDispatcher` which listens on the port 162.
  Throws:
    java.net.SocketException - If the object cannot bind to the port 162.

### SnmpEventReportDispatcher

    public SnmpEventReportDispatcher(int portNumber)
                              throws java.net.SocketException

  Initializes an `SnmpEventReportDispatcher` which listens on the specified port.
  Parameters:
    `portNumber` - The port number.
  Throws:
    java.net.SocketException - If the object cannot bind to the specified port.

### SnmpEventReportDispatcher

    public SnmpEventReportDispatcher(int portNumber,
                                     TaskServer taskServer)
                              throws java.net.SocketException

  Initializes an `SnmpEventReportDispatcher` which listens on the specified port and gives messages to taskServer
  Parameters:
    `portNumber` - The port number.
    `taskServer` - The task server.
  Throws:
    java.net.SocketException - If the object cannot bind to the specified port.

Method Detail

### run

    public void run()

  Dispatching loop. This method waits for an event report to be received and activates each registered listener.

  This method is normally called by `Thread.start`.

  Specified by:
    run in interface java.lang.Runnable

### addEventReportListener

    public void addEventReportListener(SnmpEventReportListener handler)

  Deprecated. As of JDMK 4.0, replaced by `addTrapListener(javax.management.snmp.manager.SnmpTrapListener)`

  Adds an event report listener to this `SnmpEventReportDispatcher`.
  Parameters:
    `handler` - The listener to add.

### addTrapListener

    public void addTrapListener(SnmpTrapListener handler)

  Adds a trap listener to this `SnmpEventReportDispatcher`.
  Parameters:
    `handler` - The listener to add.

### addInformListener

    public void addInformListener(SnmpInformListener handler)

  Adds an inform request listener to this `SnmpEventReportDispatcher`.
  Parameters:
    `handler` - The listener to add.

### removeEventReportListener

    public void removeEventReportListener(SnmpEventReportListener handler)

  Deprecated. As of JDMK 4.0, replaced by `removeTrapListener(javax.management.snmp.manager.SnmpTrapListener)`

  Removes an event report listener.
  Parameters:
    `handler` - The listener to be removed.

### removeTrapListener

    public void removeTrapListener(SnmpTrapListener handler)

  Removes a trap listener.
  Parameters:
    `handler` - The listener to be removed.

### removeInformListener

    public void removeInformListener(SnmpInformListener handler)

  Removes an inform request listener.
  Parameters:
    `handler` - The listener to be removed.

### containsEventReportReceiver

    public boolean containsEventReportReceiver(SnmpEventReportListener handler)

  Deprecated. As of JDMK 4.0, replaced by `containsTrapListener(javax.management.snmp.manager.SnmpTrapListener)`

  Returns `true` if the specified object is listening to event reports.
  Parameters:
    `handler` - A listener.
  Returns:
    `true` if it is a registered listener, `false` otherwise.

### containsTrapListener

    public boolean containsTrapListener(SnmpTrapListener handler)

  Returns `true` if the specified object is listening to traps.
  Parameters:
    `handler` - A listener.
  Returns:
    `true` if it is a registered listener, `false` otherwise.

### containsInformListener

    public boolean containsInformListener(SnmpInformListener handler)

  Returns `true` if the specified object is listening to inform requests.
  Parameters:
    `handler` - A listener.
  Returns:
    `true` if it is a registered listener, `false` otherwise.

### getEventReportListeners

    public java.util.Enumeration getEventReportListeners()

  Deprecated. As of JDMK 4.0, replaced by `getTrapListeners()`

  Gets all of the event report listeners.
  Returns:
    An enumeration of `SnmpEventReportListener` objects.

### getTrapListeners

    public java.util.Enumeration getTrapListeners()

  Gets all of the trap listeners.
  Returns:
    An enumeration of `SnmpTrapListener` objects.

### getInformListeners

    public java.util.Enumeration getInformListeners()

  Gets all of the inform request listeners.
  Returns:
    An enumeration of `SnmpInformListener` objects.

### getPduFactory

    public SnmpPduFactory getPduFactory()

  Gets the PDU factory associated to this `SnmpEventReportDispatcher`.
  Returns:
    The PDU factory (always non-null).

### setPduFactory

    public void setPduFactory(SnmpPduFactory factory)

  Sets the PDU factory associated to this `SnmpEventReportDispatcher`.
  Parameters:
    `factory` - The PDU factory (if null, the default factory is set).

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD