Interface | Description |
---|---|
EventContext |
This interface describes the context for the notification event
|
NotificationHandler |
Interface that all Handlers must implement
to be able to register for the NotificationReceiver
|
Class | Description |
---|---|
CommandResponderImpl |
Internal snmp4j callback class used by the SnmpNotificationReceiver
|
EventContextImpl |
EventContext implementation class
|
FilterAckInforms |
Standard filter for sending Acknowledge response to
Snmp INFORMs
This filter is implemented as a handler in the same way as
user defined handlers and the only difference is that it is always
registered in the beginning of the handler chain.
|
FilterKnownIPAddresses |
Standard filter for suppression of notifications
emanating from ip addresses outside defined set of addresses
The filter determines the source ip address first from the
snmpTrapAddress 1.3.6.1.6.3.18.1.3 varbind if this is set,
or otherwise from the emanating peer ip address.
|
FilterOutNonNotifications |
Standard filter for suppression of received snmp events
which are not TRAP, NOTIFICATION or INFORM
This filter is implemented as a handler in the same way as
user defined handlers and the only difference is that it is always
registered in the beginning of the handler chain.
|
NotifHandlerInstance |
Helper class which holds handler and if applicable
the corresponding opaque object for a registered handler
|
NotificationReceiver |
This class class mediated the use of Snmp4j
for receiving and mapping of incoming snmp notifications.
|
Enum | Description |
---|---|
HandlerResponse |
Response enums controlling the execution of the handler chain
|
This package contains classes provided to support the use of snmp4j in NCS.
For the moment this support consists of a SNMP notification receiver that uses snmp4j to listen for notifications.
The benefit of using these classes is that the configuration of snmp4j is contained in the NCS configuration. The user provides handlers (or callbacks) that processes the notifications e.g. maps these to NCS alarms that are delivered to the NCS Alarm API *
Example: The expected usage of the NotificationReceiver and the, by the user, provided NotificationHandlers are in the main() method of the service manager:
public class App { .... public static void main(String[] args) { .... // setting up AlarmManager and Snmp Notification receiver try { // We set up the AlarmSinkCentral to enable asynch // alarm provision to NCS. Socket cdbSocket = new Socket("localhost", Conf.NCS_PORT); Cdb cdb = new Cdb("snmp-notif-alarm-sink", cdbSocket); AlarmSinkCentral sinkCentral = AlarmSinkCentral.getAlarmSink(100000, cdb); // start sinkCental if not already running if (!sinkCentral.isAlive()) { sinkCentral.start(); } // Register snmp NotificationHandlers // and start the NotificationReceiver ExampleHandler handl = new ExampleHandler(); NotificationReceiver notifRec = NotificationReceiver.getNotificationReceiver() // register example handler notifRec.register(handl, null); // example of an anonymous handler notifRec.register(new NotificationHandler() { public HandlerResponse processPdu(CommandResponderEvent event, Object opaque) throws Exception { System.out.println("\n\n" + "------>Anonymous Filter called" + "\n\n"); return HandlerResponse.CONTINUE; } }, null); // start the NotificationReceiver notifRec.start(); } catch (Exception e) { e.printStackTrace(); } .... } .... }