"WEBNMS_5 API Docs"

com.adventnet.nms.alertdb
Interface AlertFilterAPI

All Superinterfaces:
CommonFilterAPI, CommonModuleAPI, java.rmi.Remote

public interface AlertFilterAPI
extends CommonFilterAPI, CommonModuleAPI

This API is for creating and manipulating AlertFilter. This interface has necessary methods to enable and disable AlertFilters. AlertFilters can be manipulated using the various API's present in its parent. CommonFilterAPI.setFilters(FilterObject[] array) can be used to add AlertFilters. FilterActions can be appended or updated in the existing AlertFilters using CommonFilterAPI.setFilterActions(String filterName,FilterAction[] actionArray, boolean deleteOldActions) method.

This API also has necessary methods to delete AlertFilters and FilterActions like CommonFilterAPI.deleteFilters(String[] filterNames) and CommonFilterAPI.deleteFilterActions(String filterName,String[] actionNames).

This API is accessible either through RMI or directly from the same JVM. When RMI is enabled, i.e. by running RMI registry before starting NMS server, AlertFilterAPI can be accessed remotely via RMI.

The following code snippet can be used to get AlertFilterAPI handle in secured and authenticated mode through RMI. In this mode, NMS needs userName and password to provide AlertFilterAPI handle.

 
 try
 {
    RMIAccessAPI rmiapi = (RMIAccessAPI)Naming.lookup("//hostName/RMIAccessAPI");
    AlertFilterAPI api = (AlertFilterAPI)rmiapi.getAPI("userName","password","AlertFilterAPI");
 }
 catch(Exception ee)
 {
     System.out.println("Error while getting AlertFilterAPI handle");
     ee.printStackTrace();
 }
 
 

The following code snippet can be used to get AlertFilterAPI handle through RMI, when RMI security mechanism of NMS is disabled.

 
 try
 {
     AlertFilterAPI api = (AlertFilterAPI)Naming.lookup("//hostName/AlertFilterAPI");
 }
 catch(Exception ee)
 {
    System.out.println("Error in getting AlertFilterAPI handle");
    ee.printStackTrace();
 }
 
 

For the same JVM as that of WebNMS server, com.adventnet.nms.util.NmsUtil#getAPI(AlertFilterAPI) can be used to get AlertFilterAPI handle.


Method Summary
 void enableFilters(java.lang.String[] filterNames, boolean bool)
          To enable or disable Alert Filters specified by the parameter 'filterNames'.
 
Methods inherited from interface com.adventnet.nms.server.CommonFilterAPI
deleteFilterActions, deleteFilters, getCompleteList, getFilters, getFiltersFromFile, saveFiltersToFile, setFilterActions, setFilters
 

Method Detail

enableFilters

void enableFilters(java.lang.String[] filterNames,
                   boolean bool)
                   throws java.rmi.RemoteException,
                          NmsStorageException,
                          FaultException
To enable or disable Alert Filters specified by the parameter 'filterNames'.

Parameters:
filterNames - - String [] containing AlertFilter names.
bool - - boolean 'true' sets the AlertFilters enabled and 'false' sets disabled.
Throws:
java.rmi.RemoteException
NmsStorageException - when problems in enabling Filters
FaultException - if there is any exception while enabling to the filter

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.