Package com.tailf.ncs.snmp.snmp4j
Class NotificationReceiver
Object
com.tailf.ncs.snmp.snmp4j.NotificationReceiver
This class mediated the use of Snmp4j
 for receiving and mapping of incoming snmp notifications.
 
As such it sets up the notification receiving capabilities according to the ncs configuration.
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidReturns the set of snmp peer ip addresses for registered managed devices.static NotificationReceiverFactory method to get a NotificationReceiver instance.static NotificationReceivergetNotificationReceiver(String host, int port) Factory method to get a NotificationReceiver instance.Get a copy of the registered chain of NotificationHandlerInstances An NotificationHandlerInstance is an NotificationHandler together with its registered opaque object.booleanCheck it the NotificationReceiver is enabled This flag is controlled by the NCS configurationbooleanCheck it the NotificationReceiver has startedvoidregister(NotificationHandler responder, Object opaque) This method is used to register handler callback classes to the notification receiver.voidregister(ArrayList<NotifHandlerInstance> handlerChain) This register method takes an ArrayList of NotificationHandlerInstances and registers these.voidstart()This method is called to start subscription on notificationsvoidstop()This method is called to stop subscription on notifications
- 
Method Details- 
getKnownIPAddressesReturns the set of snmp peer ip addresses for registered managed devices.- Returns:
- set of ConfValue where the values are either of type ConfIPv4 or ConfIPv6
 
- 
registerThis method is used to register handler callback classes to the notification receiver. There can be many handlers registered on the notification receiver in which case they are chained in a sequence corresponding to the order in which they where registered. An received notification will be processed by the handlers in order but the process chain stopped if the previous handler returned a suspend return value. It is possible to register a opaque object that is passed to the handler when it is called. This way information for the handler can be stored and maintained.- Parameters:
- responder- - handler class to process notifications
- opaque- - object to pass to the handler at execution
- Throws:
- NcsException
 
- 
registerThis register method takes an ArrayList of NotificationHandlerInstances and registers these. Any old registration will be swept away. This method is useful when it is of interest to change the default filter handling of the NotificationReceiver.- Parameters:
- handlerChain-
- Throws:
- NcsException
 
- 
getRegisteredNotificationHandlersGet a copy of the registered chain of NotificationHandlerInstances An NotificationHandlerInstance is an NotificationHandler together with its registered opaque object.- Returns:
- ArrayList of NotificationHandlerInstances
 
- 
startThis method is called to start subscription on notifications- Throws:
- IOException
 
- 
stopThis method is called to stop subscription on notifications- Throws:
- IOException
 
- 
isStartedpublic boolean isStarted()Check it the NotificationReceiver has started- Returns:
- true if started
 
- 
isEnabledpublic boolean isEnabled()Check it the NotificationReceiver is enabled This flag is controlled by the NCS configuration- Returns:
- true if enabled
 
- 
getNotificationReceiverpublic static NotificationReceiver getNotificationReceiver(String host, int port) throws NcsException Factory method to get a NotificationReceiver instance. The NotificationReceiver is a singleton i.e. there an only be one instance of this class- Parameters:
- host- hostname for the NCS server
- port- port number for the NCS server
- Returns:
- NotificationReceiver
- Throws:
- NcsException
 
- 
getNotificationReceiverFactory method to get a NotificationReceiver instance. The NotificationReceiver is a singleton i.e. there an only be one instance of this class- Throws:
- NcsException
 
- 
destroyNotificationReceiverpublic static void destroyNotificationReceiver()
 
-