In VMware Smart Assurance NOTIF, you can write Java classes which can be called during event processing to:
-
Modify the various parameters that are set prior to the notification being created.
or
-
Instruct VMware Smart Assurance NOTIF to discard the event it is processing.
To use a custom Java class in the VMware Smart Assurance NOTIF processor:
-
Write and compile one or more Java classes that implement the notifEventProcessor interface with the following requirements:
-
Your class must have a default constructor (one that takes no arguments).
-
The VMware Smart Assurance NOTIF .jar file must be available to your Java compiler when building your class. The .jar file is BASEDIR/smarts/classes/notif.jar.
-
Package your class or classes in a .jar file.
-
Install your .jar file into the BASEDIR/smarts/local/classes directory.
-
Update the Notif-init.asl script to include your .jar file in the CLASSPATH:
-
Locate the Notif-init.asl file in the BASEDIR/smarts/rules/ics directory.
-
Use the sm_edit utility to edit the script (or manually copy it to the BASEDIR/smarts/local/rules/ics directory and edit it there).
Note:The VMware Smart Assurance System Administration Guide provides information on how to use the sm_edit utility.
-
Locate the lines that use add_archive to add the .jar file to the CLASSPATH.
-
Duplicate one of those lines and replace the name of the .jar file with your own .jar file. Do not specify a path for the .jar file. The VMware Smart Assurance NOTIF/SAM Java class loader is designed to look in local/classes for your .jar file.
-
Save the file.
-
Restart the SAM/Adapter Platform server to pick up the changed CLASSPATH.
-
Add your class name to an ECI in the VMware Smart Assurance NOTIF Editor (the Java field in the Event Options tab as shown in Writing a Java class for use with VMware Smart Assurance NOTIF event processing and save and deploy the new .ncf file.
-