"WEBNMS_5 API Docs"

com.adventnet.nms.eventdb
Interface EventAPI

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

public interface EventAPI
extends CommonAPI

This API is for accessing and managing Event objects in the Event Database. This API interface also provides various utility methods built around the Event operations, that significantly enhances the usability of the API. Methods are provided to add Events, register external applications for Trap and Event notifications, purge the Events in the server etc.

This API is accessible either through RMI or directly from the same JVM where the server is running. When RMI is enabled, i.e. by runninng RMI registry before the NMS server is started, the EventAPI can be accessed remotely via RMI. It is published with RMI handle EventAPI in the server.

 Code Snippet:

 Code within the same JVM as the NMS server can use the NmsUtil.getAPI(String)
 method to get the EventAPI handle. 

// Accessing EventAPI from the same JVM EventAPI eventAPI = (EventAPI) NmsUtil.getAPI ("EventAPI"); int count = eventAPI.getTotalEventCount(); The following code exhibits the method to get the EventAPI handle via RMI if executed in seperate JVM. import com.adventnet.nms.eventdb.EventAPI; import com.adventnet.nms.eventdb.InputEvent; import java.rmi.Naming; . . . try { EventAPI eventAPI; String hostName = "localhost"; String apiString = "//" + hostName + "/EventAPI"; // hostName specifies name of the host //This can be used when user wants to gets the handle through RMI lookup eventAPI = (EventAPI) Naming.lookup(apiString); InputEvent event = new InputEvent(); event.setSource("web-server.adventnet.com"); //setting the source Vector matchedEvents = eventAPI.getEvents(event); //fetches the events //matching the source "web-server.adventnet.com" if(matchedEvents.size() == 0) System.out.println("No Events with source web-server.adventnet.com present"); } catch{Exception e} { e.printStackTrace(); } // Accessing EventAPI via RMIAccessAPI in the NMS RMI secure mode try { String hostName = "localhost"; // can be replaced with the host where the NMS server is running RMIAccessAPI rmiApi = (RMIAccessAPI) Naming.lookup ("//" + hostName + "/RMIAccessAPI"); EventAPI eventAPI = (EventAPI) rmiApi.getAPI ("username", "password", "EventAPI"); // delete all the Events from the server eventAPI.purgeEventDB(); } catch (Exception remoteException) { System.out.println ( "Error in getting the handle for TopoAPI"); }


Method Summary
 void addEvent(Event event)
          To add an event into the system.
 void addEvent(InputEvent event)
          Deprecated. as of WebNMS 5. Instead use addEvent(Event)
 boolean deregister(TrapObserver obs)
          To deregister the User application that got registered as Trap observer.
 boolean deregisterForEvents(EventObserver obs)
          To deregister the User application that got registered as Event observer.
 int getCleanEventInterval()
          This method returns the Event delete interval value (in days).
 Event getEventByID(int id)
          Returns the event whose id matches the argument.
 java.util.Properties getEventModuleParams()
          Gets the Event Module parameters and their values in java.util.Properties object.
 int getEventQueueSize()
          This method returns the number of events which are in the Event queue and are still to be processed.
 java.util.Vector getEvents(InputEvent event)
          This method can be used to retrieve Events matching some specific criteria from Web NMS.
 java.util.Vector getEvents(InputEvent event1, InputEvent event2)
          This method is used to retrieve Events matching some specific criteria from Web NMS and which got generated between specified interval of time.
 java.util.Vector getEvents(InputEvent event, long endTime)
          This method is used to retrieve Events matching some specific criteria from Web NMS and which got generated between specified interval of time.
 int getEventWindowSize()
          To get the Event Window size configured in WebNMS.
 java.util.Vector getObjectPropsWithProps(java.lang.String classname, java.lang.String[] fetchProperties, java.util.Properties criteria, boolean returnAsProps)
          Gets a Vector containing selective properties of objects matching the given criteria.
 java.util.Vector getObjects(java.lang.String classname, java.util.Properties match)
          Gets the Vector of objects matching the given properties.
 int getTotalEventCount()
          Returns the total number of Events accessible through WebNMS system.
 int[] getTrapPort()
          Returns the port numbers on which EventMgr is listening for traps.
 boolean is_inQ_SizeBeyondLimit()
          Returns whether the Event module's event queue size has exceeded the size limit configured.
 void pauseFilterAction(java.lang.String[] runnableClassName)
          This method can be used to pause the filter action thread at runtime which is running.
 void purgeEventDB()
          Deletes all the events from the NMS system.
 boolean register(TrapObserver obs)
          To register user applications for notification of traps.
 boolean registerForEvents(EventObserver obs)
          To register for notifications of events.
 void resumeFilterAction(java.lang.String[] runnableClassName)
          This method can be used to resume the filter action thread at runtime which has been paused.
 boolean setAutoCommit(boolean b)
          This method sets the Event module Database connection's auto-commit mode.
 void setCleanEventInterval(int CLEAN_EVENT_INTERVAL)
          This method dynamically sets the Event delete interval (value in days).
 void setEventModuleParams(java.util.Properties prop)
          Sets the Event Module Parameters.
 
Methods inherited from interface com.adventnet.nms.util.CommonAPI
getCompleteList, getObjectNamesWithProps, getPropertiesOfObject
 

Method Detail

addEvent

void addEvent(Event event)
              throws java.rmi.RemoteException,
                     NmsStorageException,
                     FaultException
To add an event into the system. The Event object has to be filled with the relevant data . When an Event is added through this API method, the Event will be put in the Event queue which needs to be processed further. If the user keeps on adding Events to the queue, then the queue size may grow beyond manageable limits.

Objects that extend com.adventnet.nms.eventdb.Event or it derived class can be added using this method.

When Event is added using this method, and if the size of the Event queue has exceeded the size limit configured, will throw NmsStorageException. Hence users are suggested to check the Event queue size before adding Events through the method EventAPI.is_inQ_SizeBeyondLimit() which will return 'true' if the event queue size has exceeded the size limit configured.

Parameters:
event - The Event object which is filled with the relevant fields for example entity,source,message,category time and severity
Throws:
java.rmi.RemoteException - if a problem occurs when accessing through RMI.
NmsStorageException - When EventMgr's event queue size has exceeded the size limit configured for MAX_EVENT_PROCESS_QUEUE command line option of EventMgr Process,when null is added or when user tries to add events while server is shutting down.
FaultException - if there is any other Runtime Exception while adding the event
See Also:
is_inQ_SizeBeyondLimit(), Event

addEvent

void addEvent(InputEvent event)
              throws java.rmi.RemoteException,
                     NmsStorageException,
                     FaultException
Deprecated. as of WebNMS 5. Instead use addEvent(Event)

To add an event into the system. The InputEvent object has to be filled with the relevant data for the event. When an Event is added through this API method, the Event will be put in the Event queue which needs to be processed further. If the user keeps on adding Events to the queue, then the queue size may grow beyond manageable limits.

Hence users are suggested to check the Event queue size before adding events through the EventAPI.is_inQ_SizeBeyondLimit() which will return 'true' if the event queue size has exceeded the size limit configured.

Parameters:
event - The InputEvent object which is filled with the relevant event fields like entity, source, message, category, severity etc.
Throws:
java.rmi.RemoteException - if a problem occurs when accessing through RMI.
NmsStorageException - if there is any exception while adding to the event in memory or When EventMgr's event queue size has exceeded the size limit configured for MAX_EVENT_PROCESS_QUEUE command line option of EventMgr Process,when null is added or when user tries to add events while server is shutting down using the
FaultException - if there is any Runtime exception while adding to the event
See Also:
addEvent(Event), is_inQ_SizeBeyondLimit(), InputEvent

register

boolean register(TrapObserver obs)
                 throws java.rmi.RemoteException
To register user applications for notification of traps. Using this method external application can register for traps notifications in ports where NMS is listening.

When a trap is received by NMS, it is first matched against Trap filters (which are user defined classes) if configured any. Trap filters can return either a modified trap PDU or an Event object or drop the trap by returning 'null'. If the an Event Object or SnmpPDU is returned from trap filter, the trap observers will be notified. If the trap is dropped, the trap observers are not notified. If the trap does not match with trap filters, the trap observers are notified of all the traps.

The Trap observer should implement the com.adventnet.nms.eventdb.TrapObserver interface and register with the EventAPI using this method call.

If the user application needs to be notified for all the traps received in some ports irrespective of whether NMS drops traps, or needs to be notified for ports other than where NMS is listening for traps can implement the com.adventnet.nms.trap.SocketLister interface and register using TrapAPI.registerForTraps(int [] portArray, SocketListener trapListener).

Parameters:
obs - The TrapObserver interface implementor class which needs to be notified about traps.
Returns:
Will return 'true' if successfully registered as TrapObserver and 'false' otherwise.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.

See Also:
deregister(TrapObserver), TrapAPI, TrapObserver, com.adventnet.nms.trap.SocketLister

deregister

boolean deregister(TrapObserver obs)
                   throws java.rmi.RemoteException
To deregister the User application that got registered as Trap observer. The same reference of the application that is used to register as Trap observer should be passed to deregister, without which the deregistration may not happen for the desired Observer. The Observer will be deregistered based on the reference passed in this method call.

Parameters:
obs - The User application implementing com.adventnet.nms.eventdb.TrapObserver that needs to be deregistered from trap notification.
Returns:
'true' when successfully deregistered and 'false' otherwise.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
See Also:
register(TrapObserver)

registerForEvents

boolean registerForEvents(EventObserver obs)
                          throws java.rmi.RemoteException
To register for notifications of events. Using this method external application can register for notification of events generated in WebNMS. When an Event is generated / added, will be processed through Event parsers and Event filters (if configured any). Events could be dropped from the system in Event filters by returning 'null'. If Events are not dropped at Event filters will be added into backend storage for persistence. After storing Events user applications registered as Event observers will be notified in the order of registration.

The listener for events should implement the com.adventnet.nms.eventdb.EventObserver interface and register that object as an Event observer with this method.

Parameters:
obs - The User application implementing EventObserver interface that has registered for Event notification.
Returns:
'true' when successfully registered as Event Observer and 'false' otherwise.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
See Also:
deregisterForEvents(EventObserver), EventObserver

deregisterForEvents

boolean deregisterForEvents(EventObserver obs)
                            throws java.rmi.RemoteException
To deregister the User application that got registered as Event observer. The same reference of the application that is used to register as Event observer should be passed to deregister, without which the deregistration may not happen for the desired Event Observer. The Observer will be deregistered based on the reference passed in this method call.

Parameters:
obs - The User application implementing com.adventnet.nms.eventdb.EventObserver that needs to be deregistered from Event notification.
Returns:
'true' when successfully deregistered and 'false' otherwise.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
See Also:
registerForEvents(EventObserver)

getEvents

java.util.Vector getEvents(InputEvent event)
                           throws java.rmi.RemoteException,
                                  FaultException
This method can be used to retrieve Events matching some specific criteria from Web NMS. These matching criteria are fed to an InputEvent object and the InputEvent object is given as a parameter to this method call. Match criteria can also include the user properties of the Events.

The values set for the String based properties in parameter InputEvent can take wildCard character * which stands for matching zero or more characters. The String based properties can also accept values that starts with character ! which stands for negation operation while matching. Values can also accept ,(comma) seperated values which can match any one of the values seperated by comma.

 Example criteria for String based properties:

 1. WebNMS*  - matches values startswith WebNMS
 2. *WebNMS  - matches values endswith WebNMS
 3. !WebNMS  - matches values that does not start with WebNMS
 4. Node,Interface,Snmp  - matches any value that startwith any of the mentioned string
 
The values set for numeric properties can only match the exact value given for the property in InputEvent object passed.

Parameters:
event - InputEvent which wraps the matching criteria
Returns:
Returns a vector of Event objects matching the specified criteria.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
FaultException - if there is any exception while getting the event
See Also:
CommonAPI.getObjectNamesWithProps(Properties ), getEvents(InputEvent, long )

getEvents

java.util.Vector getEvents(InputEvent event1,
                           InputEvent event2)
                           throws java.rmi.RemoteException,
                                  FaultException
This method is used to retrieve Events matching some specific criteria from Web NMS and which got generated between specified interval of time. These matching criteria are fed to an InputEvent object and the InputEvent object is given as the first parameter to this method call. Match criteria can also include the user properties of the Events.

All the Events matching the criteria specified in the first InputEvent object and got created between the 'time' interval set for the first InputEvent parameter and second InputEvent parameter will be returned. Assume the 'time' field specified for the first InputEvent is 'startTime' and the 'time' field set for the second InputEvent is 'endTime'. Then when this method is called, all the Events matching the criteria specified in the first InputEvent and generated between 'startTime' and 'endTime' will be returned.

The values set for the String based properties in parameter InputEvent can take wildCard character * which stands for matching zero or more characters. The String based properties can also accept values that starts with character ! which stands for negation operation while matching. Values can also accept ,(comma) seperated values which can match any one of the values seperated by comma.

 Example criteria for String based properties:

 1. WebNMS*  - matches values startswith WebNMS
 2. *WebNMS  - matches values endswith WebNMS
 3. !WebNMS  - matches values that does not start with WebNMS
 4. Node,Interface,Snmp  - matches any value that startwith any of the mentioned string
 
The values set for numeric properties can only match the exact value given for the property in InputEvent object passed.

Parameters:
event1 - The first InputEvent object whose properties are used for filtering events. The time field corresponds to the startTime as described above.
event2 - The second InputEvent object whose time field specifies the endTime.
Returns:
Returns a vector of Event objects matching the criteria specified and generated between the time interval specified.
Throws:
java.rmi.RemoteException - if problem occured when accessing method this through RMI.
FaultException - if there is any exception while getting to the event
See Also:
CommonAPI.getObjectNamesWithProps(Properties ), getEvents(InputEvent, long)

getEvents

java.util.Vector getEvents(InputEvent event,
                           long endTime)
                           throws java.rmi.RemoteException,
                                  FaultException
This method is used to retrieve Events matching some specific criteria from Web NMS and which got generated between specified interval of time. These matching criteria are fed to an InputEvent object and the InputEvent object is given as the first parameter to this method call. Match criteria can also include the user properties of the Events.

All the Events matching the criteria specified in the first InputEvent object and got created between the 'time' interval set for the first InputEvent parameter and long value specified as second parameter will be returned. Assume the 'time' field specified for the first InputEvent is 'startTime' and the long value specified for second parameter is 'endTime'. Then when this method is called, all the Events matching the criteria specified in the first InputEvent and generated between 'startTime' and 'endTime' will be returned.

The values set for the String based properties in parameter InputEvent can take wildCard character * which stands for matching zero or more characters. The String based properties can also accept values that starts with character ! which stands for negation operation while matching. Values can also accept ,(comma) seperated values which can match any one of the values seperated by comma.

 Example criteria for String based properties:

 1. WebNMS*  - matches values startswith WebNMS
 2. *WebNMS  - matches values endswith WebNMS
 3. !WebNMS  - matches values that does not start with WebNMS
 4. Node,Interface,Snmp  - matches any value that startwith any of the mentioned string
 
The values set for numeric properties can only match the exact value given for the property in InputEvent object passed.

Parameters:
event - The first InputEvent object whose properties are used for filtering events. The time field corresponds to the startTime as described above.
endTime - The long value which specifies the endTime.
Returns:
Returns a vector of Event objects matching the criteria specified and generated between the time interval specified.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
FaultException - if there is any exception while getting to the events
See Also:
CommonAPI.getObjectNamesWithProps(Properties )

getEventByID

Event getEventByID(int id)
                   throws java.rmi.RemoteException,
                          FaultException
Returns the event whose id matches the argument. The method will return the Event object whose id field corresponds to the value passed in the method call. Event Object will be returned only if the parameter, id is non-negative and the lies in the range of NMS. The total number of Events managed by NMS is based on the parameter EVENT_WINDOW_SIZE specified against EventMgr process in NmsProcessesBE.conf configuration file.

When the total number of events exceeds the value set for EVENT_WINDOW_SIZE param, then NMS can manage only the latest EVENT_WINDOW_SIZE events. Hence the parameter passed to the method should lie in the range of latest EVENT_WINDOW_SIZE events. If not this method call will return 'null'.

Parameters:
id - The id of the event object.
Returns:
The Event object which is matched by the given id or 'null' if the id is outside the range of NMS.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
FaultException - if there is any exception while getting the event

getObjects

java.util.Vector getObjects(java.lang.String classname,
                            java.util.Properties match)
                            throws java.rmi.RemoteException,
                                   FaultException
Gets the Vector of objects matching the given properties. The classname is the name of the class to which the objects belong.

Parameters:
classname - Name of the class to which the objects belong to
match - The matching criteria in the form of Properties
Returns:
Vector of objects matching the given properties
Throws:
java.rmi.RemoteException - if error occurs in remote machine
FaultException - if there is any exception while getting the Object for specific criteria

setAutoCommit

boolean setAutoCommit(boolean b)
                      throws java.rmi.RemoteException,
                             java.sql.SQLException
This method sets the Event module Database connection's auto-commit mode. By default auto-commit mode is true. Since the concept of modular connection has been removed, as of now the method call is obsolete.

Parameters:
b - Decides the auto-commit mode
Returns:
true on Transaction is successful
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
SQLException - When problem occurs dealing with DB

getTotalEventCount

int getTotalEventCount()
                       throws java.rmi.RemoteException
Returns the total number of Events accessible through WebNMS system. The total number of events can vary with time because events older than specified time will be deleted. This is set as a parameter "CLEAN_EVENTS_INTERVAL" to EventMgr in NmsProcessesBE.conf. It is to be noted that the total number of events accessible through NMS has a higher limit which is configurable. This is set as a parameter "EVENT_WINDOW_SIZE" to EventMgr process. Once the number of events exceeds this limit, the older events will not be accessible by NMS. So, although the total number of events may be greater than the value specified for EVENT_WINDOW_SIZE, this method will return the number of Events accessible by NMS.

Returns:
int - total Number of Events accessible by NMS.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
See Also:
getEventWindowSize()

getEventQueueSize

int getEventQueueSize()
                      throws java.rmi.RemoteException
This method returns the number of events which are in the Event queue and are still to be processed. When traps are received as a burst or Events are added in a rapid rate, then event processing could lag behind the rate at which Events are added into the queue. This could lead to the number of events to be processed might keep on increasing which could affect the server processing. When Event queue size grows beyond the configured limit, the trap processing / Event receiving should be suspended till the queue size comes down.

The maximum number of events that can be in the queue is configurable and is set as a parameter "MAX_EVENT_PROCESS_QUEUE" to EventMgr from NmsProcessesBE.conf file. At any point of time the number of events pending to be processed should not exceed MAX_EVENT_PROCESS_QUEUE limit.

Please note that through API, before adding events, the user should check for queue size with this method or if the queue size has exceeded the configured limit through EventAPI.is_inQ_SizeBeyondLimit(). The default value for Event queue size is 500.

Returns:
The number of events still to be processed in the Event queue.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
See Also:
is_inQ_SizeBeyondLimit()

getTrapPort

int[] getTrapPort()
                  throws java.rmi.RemoteException
Returns the port numbers on which EventMgr is listening for traps. Web NMS can listen for traps on multiple ports. Trap ports can be configured in the trapport.conf configuration file. Trap ports for NMS can also be dynamically registered or deregistered using TrapAPI.registerForTraps(int []) and TrapAPI.deregisterForTraps(int []) methods.

Returns:
int array of Trap Ports in which NMS is listening for traps.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.

is_inQ_SizeBeyondLimit

boolean is_inQ_SizeBeyondLimit()
                               throws java.rmi.RemoteException
Returns whether the Event module's event queue size has exceeded the size limit configured. The Event queue size is configured using the MAX_EVENT_PROCESS_QUEUE parameter against EventMgr process in NmsProcessesBE.conf configuration file. Whenever Traps are converted into Events, this method will be called internally by NMS to check whether the Event queue size has exceeded the configured limit. If the size has exceeded, then the Event will not be added into the NMS system till the queue size comes below the configured limit. Events added through EventAPI should also check the Event queue size before adding Events.

Returns:
'true' - when the Event queue size is greater the configured limit, 'false' otherwise.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
See Also:
getEventQueueSize()

getCleanEventInterval

int getCleanEventInterval()
                          throws java.rmi.RemoteException
This method returns the Event delete interval value (in days). Events will be deleted by NMS based on the value set for the parameter CLEAN_EVENT_INTERVAL (taken in days) against EventMgr process in NmsProcessesBE.conf configuration file.

The Event delete interval can be set dynamically using the setCleanEventInterval(int) method. This method will dynamically return the value set for Event delete interval.

Returns:
int Event delete interval value (in days).
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.

setCleanEventInterval

void setCleanEventInterval(int CLEAN_EVENT_INTERVAL)
                           throws java.rmi.RemoteException,
                                  FaultException
This method dynamically sets the Event delete interval (value in days). Events are management information in the network and users are not supposed to delete Events. Events will be deleted by NMS based on the value set for the parameter CLEAN_EVENT_INTERVAL (taken in days) against EventMgr process in NmsProcessesBE.conf configuration file.

Events older than the value set for CLEAN_EVENT_INTERVAL days will be deleted by NMS. In order to control the total number of Events in the system, this method could be used to set the Event delete interval dynamically.

Invoking this method with zero or negative value will have no impact.

Parameters:
CLEAN_EVENT_INTERVAL - the Event delete interval value (in days).
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
FaultException - if there is any exception while setting to the clean evenet interval
See Also:
getCleanEventInterval()

purgeEventDB

void purgeEventDB()
                  throws java.rmi.RemoteException,
                         NmsStorageException,
                         UserTransactionException
Deletes all the events from the NMS system. When the user wishes to purge all the Events in the system, could use this API method call to delete all the Events from the Server. When this method is called, the value specified for the CLEAN_EVENT_INTERVAL and EVENT_WINDOW_SIZE will be overlooked and all the Events in the system will be deleted.

Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
NmsStorageException - if error occurs while deleting Events
UserTransactionException - if there is any exception while making the transaction

getEventWindowSize

int getEventWindowSize()
                       throws java.rmi.RemoteException,
                              NmsStorageException
To get the Event Window size configured in WebNMS. It represents the maximum number of Events managed by NMS. The number of Events managed by NMS is configurable and can be specified for the parameter EVENT_WINDOW_SIZE against EventMgr process in NmsProcessesBE.conf configuration file. When the total number of Events in the system, exceeds the value specified for EVENT_WINDOW_SIZE parameter, then NMS will manage only the latest EVENT_WINDOW_SIZE events. Though Events outside the range of NMS will be stored in the back end, but will not be accessible through NMS.

Returns:
int - The Event Window size configured in WebNMS.
Throws:
java.rmi.RemoteException - if problem occured when accessing this method through RMI.
NmsStorageException - when problem occured in getting EventWindowSize

setEventModuleParams

void setEventModuleParams(java.util.Properties prop)
                          throws java.rmi.RemoteException,
                                 InvalidParameterException
Sets the Event Module Parameters. Event Module parameters and their allowable values are tabulated as below. If the given value for any of the parameter is invalid, WebNMS takes all the remaining valid values and throws Invalid Parameter Exception for that particular invalid value.

Event Module Parameters Possible Values
SAVE_DIR name of the directory
PRINT_COMMAND print command
CLEAN_EVENT_INTERVAL int > 0 (no of days)
MAX_EVENT_PROCESS_QUEUE int > 0
TRANSIENT_TRAP_PDU_IN_EVENT true,false
DROP_TRAP_WHILE_UNMANAGED true,false
GRACEFUL_SHUT_DOWN true,false
V3_AUTH true,false
NEED_INFORM_ACK true,false
AUTHORIZATION true,false

Parameters:
prop - java.util.Properties object in which Event Module Parameters and their values are stored
Throws:
java.rmi.RemoteException - if request fails in remote machine
InvalidParameterException - if invalid value is given for any of the Event Module Parameter.

getEventModuleParams

java.util.Properties getEventModuleParams()
                                          throws java.rmi.RemoteException
Gets the Event Module parameters and their values in java.util.Properties object. int, boolean values are also converted as String objects and stored in java.util.Properties object.

The following parameters and their values will be put in the java.util.Properties object and returned.

Event Module Parameters Possible Values
SAVE_DIR name of the directory
PRINT_COMMAND print command
CLEAN_EVENT_INTERVAL int > 0 (no of days)
MAX_EVENT_PROCESS_QUEUE int > 0
TRANSIENT_TRAP_PDU_IN_EVENT true,false
DROP_TRAP_WHILE_UNMANAGED true,false
GRACEFUL_SHUT_DOWN true,false
V3_AUTH true,false
NEED_INFORM_ACK true,false
AUTHORIZATION true,false
EVENT_OBJECTS_IN_MEMORY int >= 0
EVENT_WINDOW_SIZE int > 0

Returns:
Event Module Parameters stored in java.util.Properties object
Throws:
java.rmi.RemoteException - if request fails in remote machine

getObjectPropsWithProps

java.util.Vector getObjectPropsWithProps(java.lang.String classname,
                                         java.lang.String[] fetchProperties,
                                         java.util.Properties criteria,
                                         boolean returnAsProps)
                                         throws java.rmi.RemoteException,
                                                FaultException
Gets a Vector containing selective properties of objects matching the given criteria. The criteria can be a list of properties taken from properties of Event or its derived objects. The objects will be selected if they match with any or all the properties given in the match criteria, ie., it uses the both AND or OR operator while querying the tables with the match criteria to obtain the required result. The user properties cannot be used in the match criteria or in the required properties. The classname signifies, the tables that must be considered for the selection of objects. Not all the properties of the match objects are returned. The required properties passed in the fetchProperties array will be retured as Properties object of key and value. The vector will have Properties for every match object of requested Properties alone. This will be enable shallow fetch of objects properties based on criteria.

For example, to fetch few properties say enity and source of all the events with severity 5 from the Event Database, the following code snippet can be used.

 Properties criteria = new Properties();
 criteria.put("severity","5");
 String fetchProperties = {"entity","source"};
 Vector Events  =  eventAPI.getObjectPropsWithProps("Event",fetchProperties,criteria,true,false);
 
Now the Events will Properties object for all objects match the criteria. The Properties will have 2 elements of entity and source for all the Events. This will be fetched from the tables which are associated with the object hierarchy of Event. ie., it will fetch data from the table Event or the extended object's tables.

This method returns only those objects whose classname property is the one passed to this method. If the given classname is incorrect, i.e., any of the property name given in the match criteria is not found in the properties of objects associated with the given classname, then this method will return null.

Parameters:
classname - the classname for the objects that are selected.
fetchProperties - the properties that needs to be fetched.
match - the criteria based on which the objects to be selected from the database.
returnAsProps - if true, returns a Vector of Properties objects else List of properties in order specified in fetchProperties
Returns:
a Vector of Properties object with selected properties of objects matching the given criteria. Returns 'null' when the classname is null or no matching objects found in the database.
Throws:
java.rmi.RemoteException - if a problem occurs when accessing through RMI.
FaultException - if there is any exception while getting the Object for specific criteria

resumeFilterAction

void resumeFilterAction(java.lang.String[] runnableClassName)
                        throws java.rmi.RemoteException
This method can be used to resume the filter action thread at runtime which has been paused. This is applicable when the Event Filter Action has been configured to run in separate thread on server startup. The functionality of running the event filter action in a separate thread cannot be configured and started using this method. Only already configured and running event filter action thread which has been paused can be resumed. The default runnable(implementation) class is available to execute the SendEmail,SendTrap, and FilterCommand Action in separate thread.

Parameters:
runnableClassName - The classname with the package structure of the runnable class to be resumed.
Throws:
java.rmi.RemoteException - if a problem occurs when accessing through RMI. For eg, runnableClassName[0]="com.adventnet.nms.eventdb.SendEmailEventAction" runnableClassName[1]="com.adventnet.nms.eventdb.SendTrapEventAction" Note: The "FILTERACTION_FOR_EVENT_IN_THREAD" argument in EventMgr process must be set to true in NmsProcessBE.conf file to use this method.

pauseFilterAction

void pauseFilterAction(java.lang.String[] runnableClassName)
                       throws java.rmi.RemoteException
This method can be used to pause the filter action thread at runtime which is running. This is applicable when the Event Filter Action has been configured to run in separate thread on server startup. The functionality of running the event filter action in a separate thread cannot be configured and started using this method. The default runnable(implementation) class is available to execute the SendEmail,SendTrap, and FilterCommand Action in separate thread.

Parameters:
runnableClassName - The classname with the package structure of the runnable class to be resumed.
Throws:
java.rmi.RemoteException - if a problem occurs when accessing through RMI. For eg, runnableClassName[0]="com.adventnet.nms.eventdb.SendEmailEventAction" runnableClassName[1]="com.adventnet.nms.eventdb.SendTrapEventAction" Note: The "FILTERACTION_FOR_EVENT_IN_THREAD" argument in EventMgr process must be set to true in NmsProcessBE.conf file to use this method.

"WEBNMS_5 API Docs"

Copyright © 2013 ZOHO Corp., All Rights Reserved.