README for Topo Notification Filter Example



Topo Notification Filter: Overview

Topo Notification Filter is used to filter the notifications received from TopoObservers and to notify only for a specific managed object criteria.  To make use of this feature

To know the details of Topo Notification Filter, please refer to the topic "Filtering Notifications" in Developer Guide->Topology Service->Notification.

Example Overview

This example illustrates the implementation of Topo Notification Filter. Invoking this example would display the discovery status for all the networks in stdout.txt file in <Web NMS Home>/logs directory or in the command prompt. The discovery status indicates whether the discovery for a particular network is yet to be started, started or completed. This is done by writing an XML file (FilterXml.conf) and a user class (NetDiscoveryStatusListener) which implements the TopoNotificationHandler interface.  The user class gets invoked, when the properties specified in the XML file matches with the discovered managed object properties.

The XML file includes the following criteria:
 
<APPLICATION>
  <APPLN_NAME
     applnName="Web-server" />
  <NOTIFICATION
    Type="Added"
  Type1="Property"/>
  <MO_PROP_TEST
    isNetwork="true"
  discoveryStatus="*"/>
  <USERCLASS
     userClassName="test.NetDiscoveryStatusListener" />
  <MO_PROPS
 prop1="name"
   prop2="discoveryStatus" />
  <ARGUMENTS
arg1="192.168.3.0"
arg2="192.168.1.0"/>
</APPLICATION>

XML File Description
 
Parameter Usage
APPLN_NAME The name given to the XML tree application, which contains the match criteria.
NOTIFICATION Represents the type (add, delete, update, status, managed, properties, etc.). In this example, the type is specified as ADDED and the Property as STATUS, which indicates that the notification should be sent only when a managed object is added and for a specific property change.
MO_PROP_TEST Represents the managed object properties, viz., name, isNode, discoverystatus, and the corresponding values for which the notification is to be sent.
USERCLASS Represents the user class, which gets invoked when the criteria specified in the XML file matches with that of the incoming managed object. 
MO_PROPS  The list of managed object properties which can be specified, to get the values at runtime.  These properties are used in the user class to test for the specific criteria based on the change in the values (made at run time)
ARGUMENTS The required arguments to be passed to the user class. 
CRITERIA The criteria can be specified as AND or OR. Based on this criteria, the arguments are taken. For e.g. if two arguments are specified and both the criteria have to be considered for filtering the notification, AND is given as the value for CRITERIA. On the other hand if it is sufficient that one argument can be considered, OR is given as the value for the CRITERIA.
In the above XML file, the criteria value is given as AND, hence Notification is sent only when the discovered object is a node and for all status of discovery.

Brief Note on the Files Bundled with this Example

Making it Work

You can either modify the source code of NetDiscoveryStatusListener.java or write your own user class to suit specific requirements. Please follow the steps given below, to integrate this example with Web NMS.

Classpath Settings

     Set classpath=.;<Web NMS Home>\classes;
     <Web NMS Home>\classes\xalan.jar;
     <Web NMS Home>\classes\AdventNetSnmp.jar;
     <Web NMS Home>\AdventNetSNMPv3\classes

Compiling the Example

Invoke the batch file compileTopoNotificationExample.bat/.sh to compile the java files NetDiscoveryStatusListener.java and NetDiscoveryStatusHandler.java

Invoking the Example

You can invoke this example using the TopoNotificationRegistryIfc interface or using Topo API reference.

Invoking using TopoNotificationRegistryIfc interface - Before invoking this example using TopoNotificationRegistryIfc interface from same or different JVM, uncomment the following entries in NmsProcessesBE.conf file.

     #PROCESS com.adventnet.nms.topodb.TopoNotificationRegistry
     #ARGS     NULL

From same JVM - To invoke or execute this example using TopoNotificationRegistryIfc interface from same JVM, include the following entry in
NmsProcessesBE.conf file and execute the startTopoNotificationExample.bat/.sh file in <Web NMS Home>/examples/topo_notification_registry directory.

         PROCESS       NetDiscoveryStatusHandler
         ARGS              NULL

From different JVM - To invoke this example using TopoNotificationRegistryIfc interface from different JVM, execute the
startTopoNotificationExample.bat/.sh file in <Web NMS Home>/examples/topo_notification_registry directory.

Invoking using TopoAPI - To invoke this example using TopoAPI, comment the following entry in NmsProcessesBE.conf file and execute the startTopoNotificationExample.bat/.sh file in <Web NMS Home>/examples/topo_notification_registry directory.

     #PROCESS com.adventnet.nms.topodb.TopoNotificationRegistry
     #ARGS     NULL

Note : To uninstall this example from Web NMS, comment the entries specified in NmsProcessesBE.conf file.
Copyright © 1996-2004, AdventNet Inc. All Rights Reserved.