AdventNet Web NMS 4 API Specification

This class is for internal purpose only and is subjected to change. Developers are recommended not to use this API


com.adventnet.nms.eventdb
Class EventAPIImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.adventnet.nms.eventdb.EventAPIImpl
All Implemented Interfaces:
CommonAPI, CommonModuleAPI, EventAPI, java.rmi.Remote, java.io.Serializable

public class EventAPIImpl
extends java.rmi.server.UnicastRemoteObject
implements EventAPI

This API is for accessing and managing Event objects in the Event Database. This API is accessible either through RMI or directly from the same JVM. 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 on the server.

 Code Snippet:
 The following code exhibits the method to get the EventAPI handle via RMI, if executed in seperate JVM or 
 from the static variable com.adventnet.nms.eventdb.EventMgr.eventapi. 
 If executed in same JVM, it will get the EventAPI handle using the static variable.This method will also get the number of Events matching the given source for both the cases. 

 
  
 import com.adventnet.nms.eventdb.EventAPI;
 import com.adventnet.nms.eventdb.InputEvent;
 import java.rmi.Naming;
 .
 .
 .
 try
 {
      EventAPI eventAPI;
      String apiString = "//hostName/EventAPI";  // hostName specifies name of the host 
//No Internationalisation
                                            // in which NMS Server is running.
      //This can be used when user wants to gets the handle through RMI lookup
      eventAPI = (EventAPI) Naming.lookup(apiString); 
      //This can be used for the Same JVM as of WebNMS server 
      eventAPI = com.adventnet.nms.eventdb.EventMgr.eventapi;
      InputEvent event = new InputEvent();
      event.setSource("web-server.adventnet.com"); //setting the source
//No Internationalisation
      Vector matchedEvents = eventAPI.getEvents(event); //fetches the events
                                                        //matching the source "web-server.adventnet.com" 
//No Internationalisation
      if(matchedEvents.size() == 0)
          System.out.println("No Events with source web-server.adventnet.com present"); 
//No Internationalisation
 }
 catch(Exception e)
 {
 } 
 
 

As specified above, code within the same JVM as that of the Web NMS server can simply use the EventAPI handle provided by the static variable com.adventnet.nms.eventdb.EventMgr.eventapi to access the Event API methods.

See Also:
EventAPIProxyImpl, Serialized Form

Fields inherited from class java.rmi.server.RemoteObject
ref
 
Method Summary
 void addEvent(Event event)
          To add an event into the system.
 void addEvent(InputEvent event)
          To add an event into the system.
 void clearAlert(Alert alert)
          Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the clearAlertAPI call in the AlertAPI.
 void deleteAlert(Alert alert)
          Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the deleteAlert() API call in AlertAPI.
 boolean deregister(TrapObserver obs)
          To deregister the TrapObserver that has been already registered.
 boolean deregisterForEvents(EventObserver obs)
          To deregister the EventObserver that has been already registered.
 Alert getAlert(java.lang.String entity)
          Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlert API call in the AlertAPI.
 java.util.Vector getAlerts(Alert alert)
          Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlerts API call in AlertAPI.
 java.util.Vector getAlerts(Alert alert1, Alert alert2)
          Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlerts API call in the AlertAPI.
 int getCleanEventInterval()
          This method gets the CLEAN_EVENT_INTERVAL value in days
 int getClearAlertsCount()
          Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlertsCount(int) method in the AlertAPI.
 java.util.Vector getCompleteList()
          Returns a vector of all the Event Object IDs in the System.
 int getCriticalAlertsCount()
          Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlertsCount(int) method in the AlertAPI.
 Event getEventByID(int id)
          Gets 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()
          When traps occur as a burst, a lot of events might be generated.
 java.util.Vector getEvents(InputEvent event)
          This can be used to retrieve Events matching some specific criteria from the database.
 java.util.Vector getEvents(InputEvent event1, InputEvent event2)
          This can be used to retrieve Events matching some specific criteria from the database.
 java.util.Vector getEvents(InputEvent event, long endTime)
          This can be used to retrieve Events matching some specific criteria from the database.
 int getEventWindowSize()
          To get the Event Window size configured in WebNMS.
 int getMajorAlertsCount()
          Deprecated. This method has been deprecated as of WebNMS2.0. Usrs are suggested to Use the getAlertsCount(int) method in the AlertAPI.
 int getMaxSeverityofAlerts()
          Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getMaxSeverityofAlerts() method in the AlertAPI.
 int getMinorAlertsCount()
          Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to Use the getAlertsCount(int) method in the AlertAPI.
 java.util.Vector getObjectNamesWithProps(java.util.Properties p)
          Returns a Vector of all the Event Object IDs matching the properties given in the argument.
 java.util.Vector getObjects(java.lang.String classname, java.util.Properties match)
          Gets the Vector of objects matching the given properties.
 java.util.Properties getPropertiesOfObject(java.lang.String idstring)
          Returns the Properties of the Event Object identified by the argument.
 int getTotalEventCount()
          Returns the total number of Events in the WebNMS system.
 int[] getTrapPort()
          Returns the port number on which EventMgr is listening for traps.
 int getWarningAlertsCount()
          Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlertsCount(int) method in the AlertAPI.
 boolean is_inQ_SizeBeyondLimit()
          Returns whether the EventMgr's event queue size has exceeded the size limit configured for it using the MAX_EVENT_PROCESS_QUEUE commnad line option of EventMgr.
 void pauseFilterAction(java.lang.String[] runnableClassName)
          This method can be used to pause the filter action thread at runtime which is running.
 void pickUpAlert(Alert alert, java.lang.String who)
          Deprecated. This method has been deprecated as of WebNMS2.0, Users are suggested to use the pickUpAlert API call in the AlertAPI.
 void purgeEventDB()
          Deletes all events from the Database.
 boolean register(TrapObserver obs)
          To register for notification of traps.
 boolean registerForEvents(EventObserver obs)
          To register for notifications for all the events created.
 void resumeFilterAction(java.lang.String[] runnableClassName)
          This method can be used to resume the filter action thread at runtime which has been paused.
 void saveAlertState()
          Deprecated. This method has been deprecated as of WebNMS2.0.
 void saveEventState()
          Deprecated. This method has been deprecated as of WebNMS2.3
 boolean setAutoCommit(boolean b)
          WebNMS Event module has a connection to the database.
 void setCleanEventInterval(int CLEAN_EVENT_INTERVAL)
          This method sets the CLEAN_EVENT_INTERVAL value
 void setEventModuleParams(java.util.Properties prop)
          Sets the Event Module Parameters.
 void updateNotes(Alert alert, java.lang.String notes)
          Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the updateNotes() API call in the AlertAPI.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

addEvent

public void addEvent(InputEvent event)
              throws java.rmi.RemoteException,
                     NmsStorageException,
                     FaultException
To add an event into the system. The InputEvent object has to be filled with the relevant data for the event.
Specified by:
addEvent in interface EventAPI
Parameters:
event - The InputEvent object which is filled with the relevant event fields.
Throws:
java.rmi.RemoteException -  
See Also:
addEvent(Event)

addEvent

public 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 .
Specified by:
addEvent in interface EventAPI
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 -  
NmsStorageException - When EventMgr's event queue size has exceeded the size limit configured for it using the * MAX_EVENT_PROCESS_QUEUE commnad line option of EventMgr, when null is added or when user tries to add events while server is shutting down.

purgeEventDB

public void purgeEventDB()
                  throws java.rmi.RemoteException,
                         NmsStorageException,
                         UserTransactionException
Deletes all events from the Database.
Specified by:
purgeEventDB in interface EventAPI
Throws:
java.rmi.RemoteException -  

register

public boolean register(TrapObserver obs)
                 throws java.rmi.RemoteException
To register for notification of traps. When a trap is received, it is first passed through trap filters ( if any ). Trap filters can return either a modified trap PDU or an Event object or drop the trap. If Event Object is returned, the event is directly passed onto the event module for processing and the trap observers are not notified. Also if the trap is dropped, the trap observers are not notified. Only when a PDU is returned, the trap observers are notified of the trap. If there are no trap filters, the trap observers are notified of all the traps. The listener should implement the TrapObserver interface and register with the EventAPI using this call.
Specified by:
register in interface EventAPI
Parameters:
obs - The TrapObserver interface implementor class which has to be notified about traps.
Returns:
Success of the request.
Throws:
java.rmi.RemoteException -  

deregister

public boolean deregister(TrapObserver obs)
                   throws java.rmi.RemoteException
To deregister the TrapObserver that has been already registered.
Specified by:
deregister in interface EventAPI
Parameters:
obs - The TrapObserver that has been registered.
Returns:
Whether TrapObserver is successfully deregistered or not
Throws:
java.rmi.RemoteException -  

registerForEvents

public boolean registerForEvents(EventObserver obs)
                          throws java.rmi.RemoteException
To register for notifications for all the events created. The listener for events should implement the EventObserver interface and register that object with the EventAPI.
Specified by:
registerForEvents in interface EventAPI
Parameters:
obs - The EventOBbserver interface implementor class which has to be notified about events.
Returns:
Whether EventObserver is successfully registered or not
Throws:
java.rmi.RemoteException -  

deregisterForEvents

public boolean deregisterForEvents(EventObserver obs)
                            throws java.rmi.RemoteException
To deregister the EventObserver that has been already registered.
Specified by:
deregisterForEvents in interface EventAPI
Parameters:
obs - The EventObserver that has been registered.
Returns:
Whether EventObserver is successfully deregistered or not
Throws:
java.rmi.RemoteException -  

getEvents

public java.util.Vector getEvents(InputEvent event)
                           throws java.rmi.RemoteException,
                                  FaultException
This can be used to retrieve Events matching some specific criteria from the database. These matching criteria are fed to an InputEvent object and the object is given to this call.
Specified by:
getEvents in interface EventAPI
Parameters:
event - The InputEvent object whose properties are used for filtering events.
Returns:
Returns a vector of Event objects.
Throws:
java.rmi.RemoteException -  
See Also:
getCompleteList()

getEvents

public java.util.Vector getEvents(InputEvent event1,
                                  InputEvent event2)
                           throws java.rmi.RemoteException,
                                  FaultException
This can be used to retrieve Events matching some specific criteria from the database. These matching criteria are fed to an InputEvent object. If the filtering is also time-based i.e. all the events that occurred between two points of time ( let these be called starting-time and end-time ) have to be filtered, the starting-time is fed to the first InputEvent and the end-time is fed to the second InputEvent.
Specified by:
getEvents in interface EventAPI
Parameters:
event1 - The first InputEvent object whose properties are used for filtering events. The time field corresponds to the starting-time as described above.
event2 - The second InputEvent object whose time field specifies the end-time.
Returns:
Returns a vector of Event objects.
Throws:
java.rmi.RemoteException -  

getEvents

public java.util.Vector getEvents(InputEvent event,
                                  long endTime)
                           throws java.rmi.RemoteException,
                                  FaultException
This can be used to retrieve Events matching some specific criteria from the database. These matching criteria are fed to an InputEvent object. If the filtering is also time-based i.e. all the events that occurred between two points of time ( let these be called starting-time and end-time ) have to be filtered, the starting-time is fed to the first InputEvent and the end-time is specified by the long value.
Specified by:
getEvents in interface EventAPI
Parameters:
event - The first InputEvent object whose properties are used for filtering events. The time field corresponds to the starting-time as described above.
endTime - The long value which specifies the endTime.
Returns:
Returns a vector of Event objects.
Throws:
java.rmi.RemoteException -  

getEventByID

public Event getEventByID(int id)
                   throws java.rmi.RemoteException,
                          FaultException
Gets the event whose id matches the argument.
Specified by:
getEventByID in interface EventAPI
Parameters:
id - The id of the event object.
Returns:
The Event object with the specified id
Throws:
java.rmi.RemoteException -  

pickUpAlert

public void pickUpAlert(Alert alert,
                        java.lang.String who)
                 throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0, Users are suggested to use the pickUpAlert API call in the AlertAPI.

Picks up an alert. The owner of the alert object is changed to the name specified in the second argument.
Specified by:
pickUpAlert in interface EventAPI
Parameters:
alert - The Alert Object to be picked up.
who - The user name to be assigned to the Alert.who field
Throws:
java.rmi.RemoteException -  

getAlert

public Alert getAlert(java.lang.String entity)
               throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlert API call in the AlertAPI.

Gets the alert corresponding to the entity given
Specified by:
getAlert in interface EventAPI
Parameters:
entity - The unique entity name of the Alert.
Returns:
The Alert object with the specified entity
Throws:
java.rmi.RemoteException -  

getAlerts

public java.util.Vector getAlerts(Alert alert)
                           throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlerts API call in AlertAPI.

Gets all alerts matching filter. Returns all alerts if input alert is null
Specified by:
getAlerts in interface EventAPI
Parameters:
alert - The alert object whose properties are used for filtering alerts.
Returns:
Vector of matched Alert objects
Throws:
java.rmi.RemoteException -  

getAlerts

public java.util.Vector getAlerts(Alert alert1,
                                  Alert alert2)
                           throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlerts API call in the AlertAPI.

This will get all alerts matching the properties in the first argument of Alert object and between the dates specifed in the first and second argument of Alert object
Specified by:
getAlerts in interface EventAPI
Parameters:
alert1 - The Alert object whose properties are used for filtering events. The time field indicates filtering all Alerts whose time is after the time indicated in this Alert.
alert2 - The time field indicates filtering all alerts whose time is before the time indicated in this Alert.
Returns:
A Vector of Alerts matching the given critieria. Returns all the alerts if alert1 is null
Throws:
java.rmi.RemoteException -  

deleteAlert

public void deleteAlert(Alert alert)
                 throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the deleteAlert() API call in AlertAPI.

Deletes the alert from the system
Specified by:
deleteAlert in interface EventAPI
Parameters:
alert - The Alert object to be deleted
Throws:
java.rmi.RemoteException -  

clearAlert

public void clearAlert(Alert alert)
                throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the clearAlertAPI call in the AlertAPI.

Clears the alert i.e, Changes the severity of the alert to clear.
Specified by:
clearAlert in interface EventAPI
Parameters:
alert - The Alert Object whose status is to be cleared.
Throws:
java.rmi.RemoteException -  

updateNotes

public void updateNotes(Alert alert,
                        java.lang.String notes)
                 throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the updateNotes() API call in the AlertAPI.

To add annotation notes to to the Alert.
Specified by:
updateNotes in interface EventAPI
Parameters:
alert - The Alert object to which annotation has to be done.
notes - The text which will is used for annotation.
Throws:
java.rmi.RemoteException -  

getMaxSeverityofAlerts

public int getMaxSeverityofAlerts()
                           throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getMaxSeverityofAlerts() method in the AlertAPI.

Returns the Maximum severity among all the Alerts in the WebNMS System
Specified by:
getMaxSeverityofAlerts in interface EventAPI
Returns:
The higher most severity of Alerts
Throws:
java.rmi.RemoteException -  
See Also:
AlertAPI.getMaxSeverityofAlerts()

getCriticalAlertsCount

public int getCriticalAlertsCount()
                           throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlertsCount(int) method in the AlertAPI.

Returns the number of alerts with critical severity in the WebNMS System.
Specified by:
getCriticalAlertsCount in interface EventAPI
Returns:
Number of Critical Alerts
Throws:
java.rmi.RemoteException -  
See Also:
AlertAPI.getAlertsCount(int)

getMajorAlertsCount

public int getMajorAlertsCount()
                        throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Usrs are suggested to Use the getAlertsCount(int) method in the AlertAPI.

Returns the number of alerts with Major severity in the WebNMS System.
Specified by:
getMajorAlertsCount in interface EventAPI
Returns:
Number of Major Alerts
Throws:
java.rmi.RemoteException -  
See Also:
AlertAPI.getAlertsCount(int)

getMinorAlertsCount

public int getMinorAlertsCount()
                        throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to Use the getAlertsCount(int) method in the AlertAPI.

Returns the number of alerts with Minor severity in the WebNMS System.
Specified by:
getMinorAlertsCount in interface EventAPI
Returns:
Number of Minor Alerts
Throws:
java.rmi.RemoteException -  
See Also:
AlertAPI.getAlertsCount(int)

getWarningAlertsCount

public int getWarningAlertsCount()
                          throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlertsCount(int) method in the AlertAPI.

Returns the number of alerts with Warning severity in the WebNMS System.
Specified by:
getWarningAlertsCount in interface EventAPI
Returns:
Number of Warning Alerts
Throws:
java.rmi.RemoteException -  
See Also:
AlertAPI.getAlertsCount(int)

getClearAlertsCount

public int getClearAlertsCount()
                        throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0. Users are suggested to use the getAlertsCount(int) method in the AlertAPI.

Returns the number of alerts with Clear severity in the WebNMS System.
Specified by:
getClearAlertsCount in interface EventAPI
Returns:
Number of Clear Alerts
Throws:
java.rmi.RemoteException -  
See Also:
AlertAPI.getAlertsCount(int), AlertAPI.getClearAlertsCount()

getPropertiesOfObject

public java.util.Properties getPropertiesOfObject(java.lang.String idstring)
                                           throws java.rmi.RemoteException,
                                                  NmsStorageException,
                                                  UserTransactionException
Returns the Properties of the Event Object identified by the argument.
Specified by:
getPropertiesOfObject in interface CommonAPI
Parameters:
idstring - the unique identifier of the Event object.
Returns:
The properties of the identified object
Throws:
java.rmi.RemoteException -  

getObjectNamesWithProps

public java.util.Vector getObjectNamesWithProps(java.util.Properties p)
                                         throws java.rmi.RemoteException,
                                                NmsStorageException,
                                                UserTransactionException
Returns a Vector of all the Event Object IDs matching the properties given in the argument.
Specified by:
getObjectNamesWithProps in interface CommonAPI
Parameters:
p - The properties with which to filter objects
Returns:
The Vector of Object IDs matching the Properties.
Throws:
java.rmi.RemoteException -  

getCompleteList

public java.util.Vector getCompleteList()
                                 throws java.rmi.RemoteException,
                                        NmsStorageException,
                                        UserTransactionException
Returns a vector of all the Event Object IDs in the System. The number of event ids returned is less within the EVENT_WINDOW_SIZE of the WebNMS System.
Specified by:
getCompleteList in interface CommonAPI
Returns:
Vector of all the Event objects IDs
Throws:
java.rmi.RemoteException -  

saveEventState

public void saveEventState()
                    throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.3

This method saves the state of the Event Manager in a state file EventMgr.state. The file will include the list of trap parsers, event parsers and event filters configured and applied by the Event Manager during the time of this method call.
Specified by:
saveEventState in interface EventAPI
Throws:
java.rmi.RemoteException -  

saveAlertState

public void saveAlertState()
                    throws java.rmi.RemoteException
Deprecated. This method has been deprecated as of WebNMS2.0.

Saves the state of the FaultMgr
Specified by:
saveAlertState in interface EventAPI
Throws:
java.rmi.RemoteException -  

getObjects

public 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. This call can be used only if the object's properties are stored in an RDBMS. It is also assumed that one object is stored in only one table. If one object is stored in multiple tables, then only partial object will be returned.
Specified by:
getObjects in interface EventAPI
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 -  

setAutoCommit

public boolean setAutoCommit(boolean b)
                      throws java.rmi.RemoteException,
                             java.sql.SQLException
WebNMS Event module has a connection to the database. This method sets the connection's auto-commit mode to true or false. By default auto-commit mode is true.
Specified by:
setAutoCommit in interface EventAPI
Parameters:
b - Decides the auto-commit mode
Returns:
true on Transaction is successful
Throws:
java.rmi.RemoteException -  
SQLException - When problem occurs dealing with DB

getTotalEventCount

public int getTotalEventCount()
                       throws java.rmi.RemoteException
Returns the total number of Events in the WebNMS system. The total number of events can vary with time because events older than a specified time are deleted. This is set as a parameter "CLEAN_EVENTS_INTERVAL" to EventMgr in //No Internationalisation processSmall_begin.conf_SERIALIZE_BE/processSmall_begin.conf_RDBMS_BE. It is to be noted that the total number of events has a higher limit which is configurable. This is set as a parameter "EVENT_WINDOW_SIZE" //No Internationalisation to EventMgr. Once the number of events exceeds this limit, the old events are deleted. So, although the total number of events may not change because of this, the events in the WebNMS system change.
Specified by:
getTotalEventCount in interface EventAPI
Returns:
Total Number of Events
Throws:
java.rmi.RemoteException -  

getEventQueueSize

public int getEventQueueSize()
                      throws java.rmi.RemoteException
When traps occur as a burst, a lot of events might be generated. If the event processing lags behind the rate at which traps are converted into events, the number of events to be processed might keep on increasing. This returns the number of events which are in the queue and are still to be processed by the event module. When this queue size grows beyond a maximum limit, the trap processing is suspended till it comes down. ( It is to be noted that processing of traps is entirely a different process from receiving of traps. ) 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 //No Internationalisation processSmall_begin.conf_SERIALIZE_BE/processSmall_begin.cong_RDBMS_BE. The default value for this parameter is 250 i.e. at any point of time the number of events pending cannot exceed 250. Please note that through API, events can be added even though the queue size exceeds this limit.
Specified by:
getEventQueueSize in interface EventAPI
Returns:
The number of events still to be processed.
Throws:
java.rmi.RemoteException -  

setCleanEventInterval

public void setCleanEventInterval(int CLEAN_EVENT_INTERVAL)
                           throws java.rmi.RemoteException,
                                  FaultException
This method sets the CLEAN_EVENT_INTERVAL value
Specified by:
setCleanEventInterval in interface EventAPI
Parameters:
CLEAN_EVENT_INTERVAL - the CLEAN_EVENT_INTERVAL parameter
Throws:
java.rmi.RemoteException -  

getCleanEventInterval

public int getCleanEventInterval()
                          throws java.rmi.RemoteException
This method gets the CLEAN_EVENT_INTERVAL value in days
Specified by:
getCleanEventInterval in interface EventAPI
Returns:
CLEAN_EVENT_INTERVAL value
Throws:
java.rmi.RemoteException -  

getTrapPort

public int[] getTrapPort()
                  throws java.rmi.RemoteException
Returns the port number on which EventMgr is listening for traps.
Specified by:
getTrapPort in interface EventAPI
Returns:
int array of Trap Ports
Throws:
java.rmi.RemoteException -  

is_inQ_SizeBeyondLimit

public boolean is_inQ_SizeBeyondLimit()
                               throws java.rmi.RemoteException
Returns whether the EventMgr's event queue size has exceeded the size limit configured for it using the MAX_EVENT_PROCESS_QUEUE commnad line option of EventMgr.
Specified by:
is_inQ_SizeBeyondLimit in interface EventAPI
Returns:
Whether event queue size has exceeded the MAX_EVENT_PROCESS_QUEUE or not
Throws:
java.rmi.RemoteException -  

getEventWindowSize

public int getEventWindowSize()
                       throws java.rmi.RemoteException,
                              NmsStorageException
To get the Event Window size configured in WebNMS.
Specified by:
getEventWindowSize in interface EventAPI
Returns:
int - The Event Window size configured in WebNMS.
Throws:
java.rmi.RemoteException -  
NmsStorageException - When problems in getting EventWindowSize

setEventModuleParams

public void setEventModuleParams(java.util.Properties prop)
                          throws java.rmi.RemoteException,
                                 com.adventnet.nms.admin.InvalidParameterException
Description copied from interface: EventAPI
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

Specified by:
setEventModuleParams in interface EventAPI
Following copied from interface: com.adventnet.nms.eventdb.EventAPI
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
com.adventnet.nms.admin.InvalidParameterException - if invalid value is given for any of the Event Module Parameter.

getEventModuleParams

public java.util.Properties getEventModuleParams()
                                          throws java.rmi.RemoteException
Description copied from interface: EventAPI
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

Specified by:
getEventModuleParams in interface EventAPI
Following copied from interface: com.adventnet.nms.eventdb.EventAPI
Returns:
Event Module Parameters stored in java.util.Properties object
Throws:
java.rmi.RemoteException - if request fails in remote machine

resumeFilterAction

public void resumeFilterAction(java.lang.String[] runnableClassName)
                        throws java.rmi.RemoteException
Description copied from interface: EventAPI
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.
Specified by:
resumeFilterAction in interface EventAPI
Following copied from interface: com.adventnet.nms.eventdb.EventAPI
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

public void pauseFilterAction(java.lang.String[] runnableClassName)
                       throws java.rmi.RemoteException
Description copied from interface: EventAPI
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.
Specified by:
pauseFilterAction in interface EventAPI
Following copied from interface: com.adventnet.nms.eventdb.EventAPI
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.

AdventNet Web NMS 4 API Specification