|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--com.adventnet.nms.eventdb.EventAPIImpl
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.
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 |
public void addEvent(InputEvent event)
throws java.rmi.RemoteException,
NmsStorageException,
FaultException
addEvent in interface EventAPIevent - The InputEvent object which is filled with the relevant event fields.java.rmi.RemoteException - addEvent(Event)
public void addEvent(Event event)
throws java.rmi.RemoteException,
NmsStorageException,
FaultException
addEvent in interface EventAPIevent - The Event object which is filled with the relevant fields for example entity,source,message,category
time and severityjava.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.
public void purgeEventDB()
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
purgeEventDB in interface EventAPIjava.rmi.RemoteException -
public boolean register(TrapObserver obs)
throws java.rmi.RemoteException
register in interface EventAPIobs - The TrapObserver interface implementor class which has to
be notified about traps.java.rmi.RemoteException -
public boolean deregister(TrapObserver obs)
throws java.rmi.RemoteException
deregister in interface EventAPIobs - The TrapObserver that has been registered.java.rmi.RemoteException -
public boolean registerForEvents(EventObserver obs)
throws java.rmi.RemoteException
registerForEvents in interface EventAPIobs - The EventOBbserver interface implementor class
which has to be notified about events.java.rmi.RemoteException -
public boolean deregisterForEvents(EventObserver obs)
throws java.rmi.RemoteException
deregisterForEvents in interface EventAPIobs - The EventObserver that has been registered.java.rmi.RemoteException -
public java.util.Vector getEvents(InputEvent event)
throws java.rmi.RemoteException,
FaultException
getEvents in interface EventAPIevent - The InputEvent object whose properties are used for
filtering events.java.rmi.RemoteException - getCompleteList()
public java.util.Vector getEvents(InputEvent event1,
InputEvent event2)
throws java.rmi.RemoteException,
FaultException
getEvents in interface EventAPIevent1 - 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.java.rmi.RemoteException -
public java.util.Vector getEvents(InputEvent event,
long endTime)
throws java.rmi.RemoteException,
FaultException
getEvents in interface EventAPIevent - 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.java.rmi.RemoteException -
public Event getEventByID(int id)
throws java.rmi.RemoteException,
FaultException
getEventByID in interface EventAPIid - The id of the event object.java.rmi.RemoteException -
public void pickUpAlert(Alert alert,
java.lang.String who)
throws java.rmi.RemoteException
pickUpAlert in interface EventAPIalert - The Alert Object to be picked up.who - The user name to be assigned to the Alert.who fieldjava.rmi.RemoteException -
public Alert getAlert(java.lang.String entity)
throws java.rmi.RemoteException
getAlert in interface EventAPIentity - The unique entity name of the Alert.java.rmi.RemoteException -
public java.util.Vector getAlerts(Alert alert)
throws java.rmi.RemoteException
getAlerts in interface EventAPIalert - The alert object whose properties are used for filtering alerts.java.rmi.RemoteException -
public java.util.Vector getAlerts(Alert alert1,
Alert alert2)
throws java.rmi.RemoteException
getAlerts in interface EventAPIalert1 - 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.java.rmi.RemoteException -
public void deleteAlert(Alert alert)
throws java.rmi.RemoteException
deleteAlert in interface EventAPIalert - The Alert object to be deletedjava.rmi.RemoteException -
public void clearAlert(Alert alert)
throws java.rmi.RemoteException
clearAlert in interface EventAPIalert - The Alert Object whose status is to be cleared.java.rmi.RemoteException -
public void updateNotes(Alert alert,
java.lang.String notes)
throws java.rmi.RemoteException
updateNotes in interface EventAPIalert - The Alert object to which annotation has to be done.notes - The text which will is used for annotation.java.rmi.RemoteException -
public int getMaxSeverityofAlerts()
throws java.rmi.RemoteException
getMaxSeverityofAlerts in interface EventAPIjava.rmi.RemoteException - AlertAPI.getMaxSeverityofAlerts()
public int getCriticalAlertsCount()
throws java.rmi.RemoteException
getCriticalAlertsCount in interface EventAPIjava.rmi.RemoteException - AlertAPI.getAlertsCount(int)
public int getMajorAlertsCount()
throws java.rmi.RemoteException
getMajorAlertsCount in interface EventAPIjava.rmi.RemoteException - AlertAPI.getAlertsCount(int)
public int getMinorAlertsCount()
throws java.rmi.RemoteException
getMinorAlertsCount in interface EventAPIjava.rmi.RemoteException - AlertAPI.getAlertsCount(int)
public int getWarningAlertsCount()
throws java.rmi.RemoteException
getWarningAlertsCount in interface EventAPIjava.rmi.RemoteException - AlertAPI.getAlertsCount(int)
public int getClearAlertsCount()
throws java.rmi.RemoteException
getClearAlertsCount in interface EventAPIjava.rmi.RemoteException - AlertAPI.getAlertsCount(int),
AlertAPI.getClearAlertsCount()
public java.util.Properties getPropertiesOfObject(java.lang.String idstring)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
getPropertiesOfObject in interface CommonAPIidstring - the unique identifier of the Event object.java.rmi.RemoteException -
public java.util.Vector getObjectNamesWithProps(java.util.Properties p)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
getObjectNamesWithProps in interface CommonAPIp - The properties with which to filter objectsjava.rmi.RemoteException -
public java.util.Vector getCompleteList()
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
getCompleteList in interface CommonAPIjava.rmi.RemoteException -
public void saveEventState()
throws java.rmi.RemoteException
saveEventState in interface EventAPIjava.rmi.RemoteException -
public void saveAlertState()
throws java.rmi.RemoteException
saveAlertState in interface EventAPIjava.rmi.RemoteException -
public java.util.Vector getObjects(java.lang.String classname,
java.util.Properties match)
throws java.rmi.RemoteException,
FaultException
getObjects in interface EventAPIclassname - Name of the class to which the objects belong tomatch - The matching criteria in the form of Propertiesjava.rmi.RemoteException -
public boolean setAutoCommit(boolean b)
throws java.rmi.RemoteException,
java.sql.SQLException
setAutoCommit in interface EventAPIb - Decides the auto-commit modejava.rmi.RemoteException - SQLException - When problem occurs dealing with DB
public int getTotalEventCount()
throws java.rmi.RemoteException
getTotalEventCount in interface EventAPIjava.rmi.RemoteException -
public int getEventQueueSize()
throws java.rmi.RemoteException
getEventQueueSize in interface EventAPIjava.rmi.RemoteException -
public void setCleanEventInterval(int CLEAN_EVENT_INTERVAL)
throws java.rmi.RemoteException,
FaultException
setCleanEventInterval in interface EventAPICLEAN_EVENT_INTERVAL - the CLEAN_EVENT_INTERVAL parameterjava.rmi.RemoteException -
public int getCleanEventInterval()
throws java.rmi.RemoteException
getCleanEventInterval in interface EventAPIjava.rmi.RemoteException -
public int[] getTrapPort()
throws java.rmi.RemoteException
getTrapPort in interface EventAPIjava.rmi.RemoteException -
public boolean is_inQ_SizeBeyondLimit()
throws java.rmi.RemoteException
is_inQ_SizeBeyondLimit in interface EventAPIjava.rmi.RemoteException -
public int getEventWindowSize()
throws java.rmi.RemoteException,
NmsStorageException
getEventWindowSize in interface EventAPIjava.rmi.RemoteException - NmsStorageException - When problems in getting EventWindowSize
public void setEventModuleParams(java.util.Properties prop)
throws java.rmi.RemoteException,
com.adventnet.nms.admin.InvalidParameterException
EventAPI
| 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 |
setEventModuleParams in interface EventAPIcom.adventnet.nms.eventdb.EventAPIprop - java.util.Properties object in which Event Module Parameters and their
values are storedjava.rmi.RemoteException - if request fails in remote machinecom.adventnet.nms.admin.InvalidParameterException - if invalid value is given
for any of the Event Module Parameter.
public java.util.Properties getEventModuleParams()
throws java.rmi.RemoteException
EventAPIThe 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 |
getEventModuleParams in interface EventAPIcom.adventnet.nms.eventdb.EventAPIjava.rmi.RemoteException - if request fails in remote machine
public void resumeFilterAction(java.lang.String[] runnableClassName)
throws java.rmi.RemoteException
EventAPIresumeFilterAction in interface EventAPIcom.adventnet.nms.eventdb.EventAPIrunnableClassName - The classname with the package structure of the runnable class to be resumed.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.
public void pauseFilterAction(java.lang.String[] runnableClassName)
throws java.rmi.RemoteException
EventAPIpauseFilterAction in interface EventAPIcom.adventnet.nms.eventdb.EventAPIrunnableClassName - The classname with the package structure of the runnable class to be resumed.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 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||