|
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.fe.alert.AlertAPIProxyImpl
This API is a proxy implementation of AlertAPI published by the Back End Server. 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 FE server is started, the AlertAPI can be accessed remotely via RMI. It is published with RMI handle /AlertAPI on the FE server.
Code Snippet:
The following code exhibits the method to get the AlertAPI handle via RMI if executed in seperate JVM or
from the static method com.adventnet.nms.fe.alert.AlertFE.getAlertAPI()
if executed from the same JVM, and use it to get the no of crtical Alerts pending in NMS.
import com.adventnet.nms.alertdb.AlertAPI;
import java.rmi.Naming;
.
.
.
try
{
AlerAPI alertAPI
String apiString = "//hostName/AlertAPI"; // hostName specifies name of the host name
// in which Web NMS Front End (FE) Server is running. The host name
// in which Web NMS Back End (BE) server is running can also
// given in this place.
if(!com.adventnet.nms.util.PureServerUtils.smallNet)
{
//com.adventnet.nms.util.PureServerUtils.smallNet will be set false for different JVM
alertAPI = (AlertAPI) Naming.lookup(apiString); //RMI lookup
//This fetches the AlertAPI handle
}
else
{
//com.adventnet.nms.util.PureServerUtils.smallNet will be set true for same JVM
alertAPI = com.adventnet.nms.fe.alert.AlertFE.getAlertAPI(); //Same JVM as of the NMS Front End server
}
if(alertAPI != null)
{
System.out.println("No of Critical alerts pending: " + alertAPI.getCriticalAlertsCount());
}
}
catch(Exception e)
{}
As specified above, code within the same JVM as that of the Web NMS FE server can simply use the AlertAPI handle provided by the static method com.adventnet.nms.fe.alert.AlertFE.getAlertAPI() to access the Alert API methods.
AlertAPIImpl, Serialized Form| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Constructor Summary | |
AlertAPIProxyImpl()
|
|
| Method Summary | |
boolean |
addAlertListener(AlertListener obs)
To receive notification when bulk delete of Alert occurs, the user has to implement the AlertListener interface and register to the AlertAPI by addAlertListener method. |
void |
addAnnotation(AlertAnnotation altan)
To add AlertAnnotation object to the permanent storage. |
Alert |
checkOut(java.lang.String entity,
int timeOut)
This method checks out the Alert with the given name from the database for writing, with a write lock. |
Alert |
checkOutIfAvailable(java.lang.String entity)
This method checks out the Alert with the given name from the database for writing, with a write lock. |
boolean |
checkWritePermission(Alert obj)
Check whether this instance of the AlertObject can be written to the database. |
void |
clearAlert(Alert alert)
Deprecated. as of WebNMS2.2 |
void |
clearAlert(Alert alert,
boolean dealWithLock)
Clears the alert i.e, Changes the severity of the alert to clear To clear the Alert by locking.The user has to get the locked alert object by checkOutIfAvailable(String entity) method and then set the value of dealWithLock as true. |
void |
clearAlert(java.lang.String entity)
Clears the alert i.e, Changes the severity of the alert to clear. |
void |
clearLockForObject(java.lang.String entity,
int lockType)
Release the specified lock type unconditionally for the AlertObject with the given name. |
void |
deleteAlert(Alert alert)
Deprecated. as of WebNMS2.2 |
void |
deleteAlert(Alert alert,
boolean dealWithLock)
Deletes the alert from the system To delete the Alert after locking the Alert object.The user has to get the locked alert object by checkOutIfAvailable(String entity) method and then set the value of dealWithLock as true. |
void |
deleteAlert(java.lang.String entity)
Deletes the alert from the system |
void |
deleteAlertAnnotation(java.lang.String entity)
To delete Alert Annotation for an Alert Object whose 'entity' matches with the input parameter. |
void |
deleteAlertHistory(java.lang.String entity)
To delete Alert History for an Alert Object whose 'entity' matches with the input parameter. |
boolean |
deregisterForAlerts(AlertObserver obs)
To deregister the AlertObserver that has been already registered. |
Alert |
getAlert(java.lang.String entity)
This method gets the Alert Object whose entity field matches the parameter entity. |
int |
getAlertCount(java.lang.String[] category,
int severity)
Returns the number of alerts for the specified array of categories and severity |
int |
getAlertCount(java.lang.String category,
int severity)
Returns the number of alerts with given category and severity |
java.util.Properties |
getAlertModuleParams()
Gets the Alert Module parameters and their values in java.util.Properties object. |
int |
getAlertQueueSize()
The events processed by the event module are sent to the alert module for processing into alerts. |
java.util.Vector |
getAlerts(Alert alert)
Get all alerts matching the criteria specified in the parameter alert Values can also be set to the user properties of the Alert for which matching should be done in the parameter alert. |
java.util.Vector |
getAlerts(Alert alert1,
Alert alert2)
This will get all alerts matching the properties in the first parameter alert1 Alert object and between the time specified in the first and second parameter alert2 Alert object. |
java.util.Vector |
getAlertsBasedOnGroupViewMode()
For internal use only. |
int |
getAlertsCount(int severity)
Returns the number of alerts with given severity in the WebNMS System. |
java.util.Vector |
getAnnotation(java.lang.String entity)
Get the Complete set of AlertAnnotation Objects in a Vector for a particular Alert. |
java.lang.String |
getAnnotationNotes(java.lang.String entity)
Deprecated. as of WebNMS2.2. Use getAnnotation() and getHistory() which will return Vector of AlertAnnotation and AlertHistory respectively. |
int |
getClearAlertsCount()
Returns the number of alerts with Clear severity in the WebNMS System. |
java.util.Vector |
getCompleteList()
This method returns a vector of all Persistent Object keys in the database. |
int |
getCriticalAlertsCount()
Returns the number of alerts with Critical severity in the WebNMS System. |
int |
getCurrentLockType(Alert obj)
Get the lock type currently held by the specified instance of the AlertObject. |
java.lang.String |
getGroupViewMode()
Alert objects can be grouped based on the "groupName" property of the Alert. |
java.util.Vector |
getHistory(java.lang.String entity)
Get the Complete set of AlertHistory Objects in a Vector for a particular Alert. |
int |
getMajorAlertsCount()
Returns the number of alerts with Major severity in the WebNMS System. |
int |
getMaxSeverityofAlerts()
The method returns the associated integer value of the maximum severity alert that is pending(or present) in the Web NMS system. |
int |
getMinorAlertsCount()
Returns the number of alerts with Minor severity in the WebNMS System. |
java.util.Vector |
getNextAlertBasedOnGroupViewMode(java.lang.String groupName)
For internal use only. |
Alert |
getNextAlertBasedOnModtime(java.lang.String entity)
This method returns the Alert generated or modified next to the Alert whose 'entity' field is passed as parameter. |
java.util.Vector |
getObjectNamesWithProps(java.util.Properties p)
Returns a Vector of all the Persistent Object IDs matching the properties given in the argument. |
java.util.Vector |
getObjects(java.lang.String classname,
java.util.Properties match)
Returns a vector of alert objects that belong to the specified classname. |
Alert |
getOldestModifiedAlert()
To return the Oldest Modified Alert. |
java.util.Properties |
getPropertiesOfObject(java.lang.String objectname)
Returns the Properties of the Persistent Object identified by the argument. |
int |
getTotalAlertCount()
Returns Total number of Alerts in the WebNMS system. |
int |
getTotalAlertCount(java.lang.String category)
Returns the total number of alerts for the specified category |
int |
getTotalAlertCount(java.lang.String[] category)
Returns the total number of alerts for the specified array of categories |
int |
getWarningAlertsCount()
Returns the number of alerts with Warning severity in the WebNMS System. |
boolean |
isDatabaseMode()
Returns true, if Alert module is run in Database mode. |
void |
listenAlert(AlertActionInformer action)
This method will be invoked by WebNMS, whenever an Alert related operation is performed. |
Alert |
lock(Alert obj,
int lock_type,
int timeout)
This method will lock the specified Alert, by applying the given type of lock, which will actually define access levels for the object. |
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. as of WebNMS2.2 instead use the method pickUpAlert(String entity,String who) |
void |
pickUpAlert(Alert alert,
java.lang.String who,
boolean dealWithLock)
Picks up an alert. |
void |
pickUpAlert(java.lang.String entity,
java.lang.String who)
Picks up an alert. |
void |
postBEFailOverNotification(BEFailOverEvent beEvent)
Indicates that the FE server has successfully switched over its connection to the current primary BE server. |
void |
preBEFailOverNotification(BEFailOverEvent event)
Indicates that the BE server, to which the FE server is connected, has failed and the FE server is going to try to connect to the standby BE server. |
void |
purgeAlertDB()
Deletes all the alerts in the WebNMS. |
boolean |
registerForAlerts(AlertObserver obs)
This method registers the given AlertObserver for notifications of various Alert related operations. |
boolean |
removeAlertListener(AlertListener obs)
To deregister the AlertListener that has been already added by addAlertListener method |
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()
Saves the state of the FaultMgr. |
void |
setAlertModuleParams(java.util.Properties prop)
Sets the Alert Module Parameters. |
boolean |
setAutoCommit(boolean b)
This method sets the data base connection's auto-commit mode to true or false. |
void |
shutDown()
Gets called whenever Web NMS Server shuts down. |
void |
unlock(Alert obj)
Unlock the specified AlertObject. |
void |
unPickAlert(Alert alert,
java.lang.String who,
boolean dealWithLock)
This method unpicks the alert, if it is already picked up by an user. |
void |
unPickAlert(java.lang.String entity,
java.lang.String who)
This method unpicks the alert, whose entity field matches entity, if it is already picked up by an user. |
void |
update(Alert al)
For all Alert Observers which are registered to WebNMS, this method is invoked whenever there is an addition,updation or deletion of an Alert Object. |
void |
update(java.util.Vector v)
This method is similar to the previous method except the argument which is a Vector of Alert Objects. |
void |
update(XMLNode node)
This method will be invoked by WebNMS whenever bulk delete or purging of Alerts occur. |
boolean |
updateAlert(Alert alert)
Updates the Alert, matching the entity as that of the alert passed as a parameter to the method. |
boolean |
updateAlert(Alert alert,
boolean dealWithLock)
Update the Alert in the NMS.All the properties of the existing alert will be replaced with the properties of the alert passed as parameter.To update the Alert by locking.The user has to get the locked alert object by checkOutIfAvailable(String entity) method and then set the value of dealWithLock as true.After the required action is performed the user has to unlock the Alert Object by unlock(Alert obj) |
void |
updateNotes(Alert alert,
java.lang.String notes)
Deprecated. as of WebNMS2.1 |
void |
updateNotes(Alert alert,
java.lang.String userName,
java.lang.String notes)
Deprecated. as of WebNMS2.1 |
void |
updateNotes(Alert alert,
java.lang.String userName,
java.lang.String notes,
boolean dealWithLock)
To add annotation notes to the Alert. |
void |
updateNotes(java.lang.String entity,
java.lang.String notes)
To add annotation notes to the Alert |
void |
updateNotes(java.lang.String entity,
java.lang.String username,
java.lang.String notes)
To add annotation notes to the Alert as annotated by user of name userName. |
| 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 |
| Constructor Detail |
public AlertAPIProxyImpl()
throws java.rmi.RemoteException
| Method Detail |
public void pickUpAlert(Alert alert,
java.lang.String who)
throws java.rmi.RemoteException
pickUpAlert in interface AlertAPIalert - The Alert Object to be picked up.who - The user name to be assigned to the Alert.who field
public void pickUpAlert(java.lang.String entity,
java.lang.String who)
throws java.rmi.RemoteException
pickUpAlert in interface AlertAPIentity - The entity of the Alert object to be picked up.who - The user name to be assigned to the Alert.who field
public void pickUpAlert(Alert alert,
java.lang.String who,
boolean dealWithLock)
throws java.rmi.RemoteException,
AccessDeniedException,
UserTransactionException,
FaultException
pickUpAlert in interface AlertAPIalert - The Alert Object to be picked up.who - The user name to be assigned to the Alert.who fielddealWithLock - provides concurrency control for the Alert Object passed as an argument.AccessDeniedException - if the object is locked by some other
thread and is not available for writing.java.rmi.RemoteException - if request fails in remote machineUserTransactionException - if the current transaction is timed out.
public void unPickAlert(java.lang.String entity,
java.lang.String who)
throws java.rmi.RemoteException
unPickAlert in interface AlertAPIentity - The entity of the Alert object to be picked up.who - The user name who unpicking the alert
public void unPickAlert(Alert alert,
java.lang.String who,
boolean dealWithLock)
throws java.rmi.RemoteException,
AccessDeniedException,
UserTransactionException,
FaultException
unPickAlert in interface AlertAPIAlert - The Alert object to be picked up.who - The user name who unpicking the alertdealWithLock - provides concurrency control for the Alert Object passed as an argument.AccessDeniedException - if the object is locked by some other
thread and is not available for writing.java.rmi.RemoteException - if request fails in remote machineUserTransactionException - if the current transaction is timed out.
public Alert getAlert(java.lang.String entity)
throws java.rmi.RemoteException
getAlert in interface AlertAPIentity - Entity field of the Alert Object to be obtained
public java.util.Vector getAlerts(Alert alert)
throws java.rmi.RemoteException
AlertAPIThe values set for the String based properties in parameter alert can take wildCard character * which stands for its well known purpose. The String based properties can also accept values that starts with character ! which stands for negation operation while matching. They 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 Alert object passed namely alert. For the properties modTime and createTime, this method will return all the Alerts whose modTime or createTime is greater than that of the given Alert's modTime or createTime respectively.
getAlerts in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIalert - The alert object whose properties are used for filtering alerts.java.rmi.RemoteException - in request fails in remtoe machineAlertAPI.getAlerts(Alert alert1,Alert alert2),
CommonAPI.getObjectNamesWithProps(Properties),
CommonAPI.getPropertiesOfObject(String),
CommonAPI.getCompleteList()
public java.util.Vector getAlerts(Alert alert1,
Alert alert2)
throws java.rmi.RemoteException,
FaultException
AlertAPIThe values set for the String based properties in first Alert can take wildCard character * which stands for its well known purpose. The String based properties can a also accept values that starts with character ! which stands for negation operation while matching. They 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 alert object passed, namely alert1.
For the properties modTime and createTime the matching would take place as follows.
1. modTime specified both in alert1 and alert2.
Matches the Alert whose modTime greater than that specified in alert1
and less than specifed in alert2
2. modTime specified only in alert1 and not in alert2:
Matches the Alert whose modTime greater than specifed in alert1
3. modTime specified only in alert2 and not in alert1:
Matches the Alert whose modTime less than specified in alert2
4. modTime not specified in both alert2 and alert1:
modTime will not be taken as a filtering criteria
The same matching mechanism will be followed for the property createTime
getAlerts in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIalert1 - 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 - if request fails in remote machineFaultException - if there is any exception while fetching the alerts
matching the propertiesCommonAPI.getObjectNamesWithProps(Properties),
CommonAPI.getPropertiesOfObject(String),
CommonAPI.getCompleteList()
public void purgeAlertDB()
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
AlertAPInone history annotation both
If ON_DELETING_ALERT_DELETE is set to none, both history and annotation won't be deleted while deleting Alert. If it is set to annotation, only annotation will be deleted while deleting Alert. It it is set to history, only history will be deleted. Both history and annotation will be deleted it the parameter is is set to both. Before deleting Alerts, Alert Listeners will be notified about this operation.
Note: If Alerts are deleted through this method, ManagedObjects will not be updated.
purgeAlertDB in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIjava.rmi.RemoteException - if request fails in remote machineNmsStorageException - if any error occurs while updating the storage.UserTransactionException - if there is any exception while making the transactionAlertAPI.deleteAlert(Alert alert,boolean dealWithLock)
public java.lang.String getAnnotationNotes(java.lang.String entity)
throws java.rmi.RemoteException
getAnnotationNotes in interface AlertAPIentity - The unique entity name of the Alert.
public java.util.Vector getAnnotation(java.lang.String entity)
throws java.rmi.RemoteException,
FaultException
getAnnotation in interface AlertAPIentity - The unique entity name of the Alert.java.rmi.RemoteException - if request fails in remote machineFaultException - if any other exception occurs while processing the method.AlertAnnotation
public java.util.Vector getHistory(java.lang.String entity)
throws java.rmi.RemoteException,
FaultException
getHistory in interface AlertAPIentity - The unique entity name of the Alert.java.rmi.RemoteException - if request fails in remote machineFaultException - if any other exception occurs while processing the method.AlertHistory
public void addAnnotation(AlertAnnotation altan)
throws java.rmi.RemoteException,
UserTransactionException,
FaultException
addAnnotation in interface AlertAPIAlertAnnotation - object to be added.java.rmi.RemoteException - if request fails in remote machineUserTransactionException - if the current transaction is timed out.FaultException - if any other exception occurs while processing the method.
public void deleteAlert(Alert alert,
boolean dealWithLock)
throws java.rmi.RemoteException,
AccessDeniedException,
UserTransactionException,
FaultException
After the required action is performed the user has to unlock the Alert Object by unlock(Alert obj)
deleteAlert in interface AlertAPIalert - The Alert object to be deleteddealWithLock - provides concurrency control for the Alert Object passed as an argument.AccessDeniedException - if the object is locked by some other
thread and is not available for writing.java.rmi.RemoteException - if request fails in remote machineUserTransactionException - if the current transaction is timed out.
public void deleteAlert(Alert alert)
throws java.rmi.RemoteException
deleteAlert in interface AlertAPIalert - The Alert object to be deleted
public void deleteAlert(java.lang.String entity)
throws java.rmi.RemoteException
deleteAlert in interface AlertAPIentity - The entity of the alert object to be deleted
public void clearAlert(Alert alert)
throws java.rmi.RemoteException
clearAlert in interface AlertAPIalert - The Alert Object whose status is to be cleared.
public void clearAlert(Alert alert,
boolean dealWithLock)
throws java.rmi.RemoteException,
AccessDeniedException,
UserTransactionException,
FaultException
After the required action is performed the user has to unlock the Alert Object by unlock(Alert obj)
clearAlert in interface AlertAPIalert - The Alert Object whose status is to be cleared.dealWithLock - provides concurrency control for the Alert Object passed as an argument.AccessDeniedException - if the object is locked by some other
thread and is not available for writing.java.rmi.RemoteException - if request fails in remote machineUserTransactionException - if the current transaction is timed out.
public void clearAlert(java.lang.String entity)
throws java.rmi.RemoteException
clearAlert in interface AlertAPIentity - The entity of thr Alert Object whose status is to be cleared.
public boolean updateAlert(Alert alert)
throws java.rmi.RemoteException,
UserTransactionException,
FaultException
AlertAPIThe user should note that the severity value of the alert object passed should not be equal to that of any NO-CRITICAL severities defined in the Web NMS system, as well as that of the Special Purpose severity defined. Similarly, the entity and the source field cannot be null, in which case the method call will fail.
The user can modify all the properties except that of PreviousSeverity(alert previous severity) and modTime(alert Modified time). The previous severity will be set from the severity of the existing alert and the modified time will be determined by the Web NMS server, which will update it with the exact time of modification.
If the Alert is updated, corresponding Managed Object will be updated based on ALERT_TO_MANAGEDOBJECT_PROPOGATION parameter against EventMgr process in NmsProcessesBE.conf file, this parameter can have any one of the following values
max latest noneIf ALERT_TO_MANAGEDOBJECT_PROPOGATION is set to none, Managed Object will not be updated by Alerts. If it is set to max, Managed Object will reflect the maximum severity of Alerts belongs to that Manged Object. If the Alert belongs to that Managed Object is updated, Managed Object will be updated by the maximum severity of the remaining Alerts. If there is no more Alerts for that Managed Object, then it will reflect status of the updated Alert. If ALERT_TO_MANAGEDOBJECT_PROPOGATION is set to latest, Managed Object will reflect the status of latest Alert belongs to that Managed Object.
The method will return a value true, if the updation is successfull or else false will be returned.
Note : FaultException will not be thrown when there is some problem while adding Alert history entry into ANNOTATION table.
updateAlert in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIalert - The alert object by which the existing alert which has same
matching entity will be updated with. entity or source
fields of the Alert object is null or no Alert is there in WebNMS
with the corresponding entity java.rmi.RemoteException - if request fails in remote machineUserTransactionException - if there is any exception while making the transaction
for update the alertFaultException - wrapper for all other module level exceptionsAlertAPI.updateAlert(Alert alert,boolean dealWithLock)
public boolean updateAlert(Alert alert,
boolean dealWithLock)
throws java.rmi.RemoteException,
AccessDeniedException,
UserTransactionException,
FaultException
The user should note that the severity value of the alert object passed should not be equal to that of any NO-CRITICAL severities defined in the Web NMS system as well as that of the Special Purpose severity defined. Similarly the entity and the source field cannot be null, in which case the method call will fail.
The user can modify all the properties except that of PreviousSeverity(alert previous severity) and modTime(alert Modified time). The previous severity will be set from the severity of the existing alert and the modified time will be determined by the Web NMS server, which will update it with the exact time of modification.
The method will return a value true if the updation was successfull or else false will be returned.
updateAlert in interface AlertAPIalert - The alert object with which the existing alert with the
same matching entity will be updated with.dealWithLock - provides concurrency control for the Alert Object passed as an argument.AccessDeniedException - if the object is locked by some other
thread and is not available for writing.java.rmi.RemoteException - if request fails in remote machineUserTransactionException - if the current transaction is timed out.
public void updateNotes(Alert alert,
java.lang.String userName,
java.lang.String notes,
boolean dealWithLock)
throws java.rmi.RemoteException,
AccessDeniedException,
UserTransactionException,
FaultException
updateNotes in interface AlertAPIalert - The Alert object to which annotation has to be done.notes - The text which is to be used for annotation.userName - The name of the user who is adding the annotationdealWithLock - provides concurrency control for the Alert Object passed as an argument.AccessDeniedException - if the object is locked by some other
thread and is not available for writing.java.rmi.RemoteException - if request fails in remote machineUserTransactionException - if the current transaction is timed out.
public void updateNotes(Alert alert,
java.lang.String notes)
throws java.rmi.RemoteException
updateNotes in interface AlertAPIalert - The Alert object to which annotation has to be done.notes - The text which is to be used for annotation.
public void updateNotes(java.lang.String entity,
java.lang.String notes)
throws java.rmi.RemoteException
updateNotes in interface AlertAPIentity - The entity of the Alert to which annotation has to be done.notes - The text which is to be used for annotation.
public void updateNotes(java.lang.String entity,
java.lang.String username,
java.lang.String notes)
throws java.rmi.RemoteException
updateNotes in interface AlertAPIentity - The entity of the Alert to which annotation has to be done.userName - The name of the user who is adding the annotationnotes - The text which is to be used for annotation.
public void updateNotes(Alert alert,
java.lang.String userName,
java.lang.String notes)
throws java.rmi.RemoteException
updateNotes in interface AlertAPIalert - The Alert object to which annotation has to be done.userName - The name of the user who is adding the annotationnotes - The text which is to be used for annotation.
public int getMaxSeverityofAlerts()
throws java.rmi.RemoteException
getMaxSeverityofAlerts in interface AlertAPIjava.rmi.RemoteException - When the api call fails via RMI.
public int getAlertsCount(int severity)
throws java.rmi.RemoteException
AlertAPIgetAlertsCount in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIseverity - The severity value of the alert as specified in the
SeverityInfo.conf file in the WebNMS/conf directory..java.rmi.RemoteException - when this API call fails via RMIAlertAPI.getTotalAlertCount(),
AlertAPI.getAlertCount(String category,int severity),
AlertAPI.getAlertCount(String category[],int severity)
public int getCriticalAlertsCount()
throws java.rmi.RemoteException
AlertAPIgetCriticalAlertsCount in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIjava.rmi.RemoteException - if API call fails via RMIAlertAPI.getAlertsCount(int severity),
AlertAPI.getAlertCount(String category,int severity),
AlertAPI.getAlertCount(String category[],int severity)
public int getMajorAlertsCount()
throws java.rmi.RemoteException
AlertAPIgetMajorAlertsCount in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIjava.rmi.RemoteException - if API call fails via RMIAlertAPI.getAlertsCount(int),
AlertAPI.getAlertCount(String category,int severity),
AlertAPI.getAlertCount(String category[],int severity)
public int getMinorAlertsCount()
throws java.rmi.RemoteException
AlertAPIgetMinorAlertsCount in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIjava.rmi.RemoteException - if API call fails via RMIAlertAPI.getAlertsCount(int),
AlertAPI.getAlertCount(String category,int severity),
AlertAPI.getAlertCount(String category[],int severity)
public int getWarningAlertsCount()
throws java.rmi.RemoteException
AlertAPIgetWarningAlertsCount in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIjava.rmi.RemoteException - if API call fails via RMIAlertAPI.getAlertsCount(int),
AlertAPI.getAlertCount(String category,int severity),
AlertAPI.getAlertCount(String category[],int severity)
public int getClearAlertsCount()
throws java.rmi.RemoteException
AlertAPIgetClearAlertsCount in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIjava.rmi.RemoteException - if API call fails via RMIAlertAPI.getAlertsCount(int),
AlertAPI.getAlertCount(String category,int severity),
AlertAPI.getAlertCount(String category[],int severity)
public void saveAlertState()
throws java.rmi.RemoteException
AlertAPIsaveAlertState in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIjava.rmi.RemoteException - if API call fails via RMI
public java.util.Vector getObjects(java.lang.String classname,
java.util.Properties match)
throws java.rmi.RemoteException,
FaultException
AlertAPIgetObjects in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIclassname - Name of the class to which the object belongsmatch - The matching criteria in the form of Propertiesjava.rmi.RemoteException - if API call fails via RMIFaultException - if there is any exception while fetching
the objects with given criteriaCommonAPI.getObjectNamesWithProps(Properties),
CommonAPI.getPropertiesOfObject(String)
public boolean registerForAlerts(AlertObserver obs)
throws java.rmi.RemoteException
AlertAPIAlertObserver
interface and register that object with NMS by this method.registerForAlerts in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIobs - The AlertObserver interface implementor class
which will be notified about various alert related operations.java.rmi.RemoteException - if request fails in remote machineAlertAPI.deregisterForAlerts(AlertObserver),
AlertAPI.addAlertListener(AlertListener),
AlertAPI.removeAlertListener(AlertListener),
AlertListener,
AlertActionInformer
public boolean deregisterForAlerts(AlertObserver obs)
throws java.rmi.RemoteException
deregisterForAlerts in interface AlertAPIobs - The AlertObserver that has to be deregistered.
public boolean setAutoCommit(boolean b)
throws java.rmi.RemoteException,
java.sql.SQLException
AlertAPIsetAutoCommit in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIb - Decides the auto-commit modejava.rmi.RemoteException - if request fails in remote machineSQLException - When problem occurs dealing with DB
public java.util.Properties getPropertiesOfObject(java.lang.String objectname)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
CommonAPIgetPropertiesOfObject in interface CommonAPI
public java.util.Vector getObjectNamesWithProps(java.util.Properties p)
throws java.rmi.RemoteException
CommonAPIgetObjectNamesWithProps in interface CommonAPI
public java.util.Vector getCompleteList()
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
CommonAPIgetCompleteList in interface CommonAPI
public boolean isDatabaseMode()
throws java.rmi.RemoteException
AlertAPIisDatabaseMode in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIjava.rmi.RemoteException - if request fails in remote machine
public java.lang.String getGroupViewMode()
throws java.rmi.RemoteException
If the group mode is "none", then the alerts are not grouped and all the alerts are shown separately.
If the group mode is "max", then the alert of maximum severity, out of all the alerts belonging to that group, represents that group.
If the group mode is "latest", then the latest alert from an alert group represents that group.
This method will return the group view mode set in the configuration file processSmall_begin.conf_SERIALIZE_BE (Serialized mode) or processSmall_begin.conf_RDBMS_BE (RDBMS mode) as mentioned above.
getGroupViewMode in interface AlertAPI
public java.util.Vector getAlertsBasedOnGroupViewMode()
throws java.rmi.RemoteException,
FaultException
AlertAPIgetAlertsBasedOnGroupViewMode in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIjava.rmi.RemoteException - if request fails in remote machineFaultException - if there are any exceptions while fetching alerts
based on group view mode
public java.util.Vector getNextAlertBasedOnGroupViewMode(java.lang.String groupName)
throws java.rmi.RemoteException,
FaultException
AlertAPIgetNextAlertBasedOnGroupViewMode in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIgroupName - The groupName field of Alert objectjava.rmi.RemoteException - if request fails in remote machineFaultException - if there are any exceptions while fetching next alert
based on group view mode
public int getAlertQueueSize()
throws java.rmi.RemoteException
getAlertQueueSize in interface AlertAPI
public int getTotalAlertCount()
throws java.rmi.RemoteException,
FaultException
AlertAPIgetTotalAlertCount in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIjava.rmi.RemoteException - if request fails in remote machineFaultException - if there are any exceptions while fetching total alerts countAlertAPI.getAlertCount(String category,int severity),
AlertAPI.getAlertCount(String category[],int severity)
public Alert getNextAlertBasedOnModtime(java.lang.String entity)
throws java.rmi.RemoteException,
FaultException
getNextAlertBasedOnModtime in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIentity - The entity field of Alert ObjectmodTime or currentTime whichever is applicablejava.rmi.RemoteException - if request fails in remote machineFaultException - if there are any exceptions while fetching next alert
based on modified timeAlertAPI.getOldestModifiedAlert()
public void deleteAlertAnnotation(java.lang.String entity)
throws java.rmi.RemoteException,
FaultException,
UserTransactionException
deleteAlertAnnotation in interface AlertAPIentity - - 'entity' field of the Alert whose Annotation is to be deleted.java.rmi.RemoteException - if request fails in remote machineFaultException - if any other exception occurs while processing the method.
public void deleteAlertHistory(java.lang.String entity)
throws java.rmi.RemoteException,
FaultException,
UserTransactionException
deleteAlertHistory in interface AlertAPIentity - - 'entity' field of the Alert whose History is to be deleted.java.rmi.RemoteException - if request fails in remote machineFaultException - if any other exception occurs while processing the method.
public Alert getOldestModifiedAlert()
throws java.rmi.RemoteException,
NmsStorageException
getOldestModifiedAlert in interface AlertAPI
public boolean addAlertListener(AlertListener obs)
throws java.rmi.RemoteException
addAlertListener in interface AlertAPIAlertListener - The user written class that implements AlertListener
public boolean removeAlertListener(AlertListener obs)
throws java.rmi.RemoteException
removeAlertListener in interface AlertAPIAlertListener - The user written class that implements AlertListener
public int getAlertCount(java.lang.String category,
int severity)
throws java.rmi.RemoteException,
FaultException
getAlertCount in interface AlertAPIcategory - category of the Alertseverity - The severity value of the alert as specified in the
SeverityInfo.conf file in the WebNMS/conf directory..
public int getTotalAlertCount(java.lang.String category)
throws java.rmi.RemoteException,
FaultException
getTotalAlertCount in interface AlertAPIcategory - category of the Alert
public int getTotalAlertCount(java.lang.String[] category)
throws java.rmi.RemoteException,
FaultException
getTotalAlertCount in interface AlertAPIcategory - category of the Alerts
public int getAlertCount(java.lang.String[] category,
int severity)
throws java.rmi.RemoteException,
FaultException
getAlertCount in interface AlertAPIcategory - category of the Alertsseverity - The severity value of the alert as specified in the
SeverityInfo.conf file in the WebNMS/conf directory..
public Alert checkOutIfAvailable(java.lang.String entity)
throws java.rmi.RemoteException,
TimeoutException,
FaultException
checkOutIfAvailable in interface AlertAPIname - The unique name of the Alert to be checked outRemoteException, - if a problem occurs when accessing through RMI.TimeoutException, - if the object is locked by some other threadFaultException - if any other exception occurs while processing the method.
public Alert checkOut(java.lang.String entity,
int timeOut)
throws java.rmi.RemoteException,
TimeoutException,
FaultException
checkOut in interface AlertAPIname - The unique name of the Alert to be checked outtimeOut - Time in seconds to wait, if the object is locked by some other thread.TimeoutException, - if the object is not available for writing
for the specified amount of time.java.rmi.RemoteException - if request fails in remote machineFaultException - if any other exception occurs while processing the method.
public void unlock(Alert obj)
throws java.rmi.RemoteException,
FaultException
unlock in interface AlertAPIobj - The Alert Object that is to be unlocked.java.rmi.RemoteException - if request fails in remote machineFaultException - if any other exception occurs while processing the method.LockableObject
public boolean checkWritePermission(Alert obj)
throws java.rmi.RemoteException,
FaultException
checkWritePermission in interface AlertAPIobj - The AlertObject instance that is to be checked whether it has
a write lock.java.rmi.RemoteException - if request fails in remote machineFaultException - if any other exception occurs while processing the method.LockableObject
public int getCurrentLockType(Alert obj)
throws java.rmi.RemoteException,
FaultException
getCurrentLockType in interface AlertAPIobj - AlertObject instance for which the lock type is to be
obtained.java.rmi.RemoteException - if request fails in remote machineFaultException - if any other exception occurs while processing the method.
public void clearLockForObject(java.lang.String entity,
int lockType)
throws java.rmi.RemoteException,
FaultException
clearLockForObject in interface AlertAPIname - Name of the AlertObject to be unlocked.lockType - Type of the lock to be unlocked.java.rmi.RemoteException - if request fails in remote machineFaultException - if any other exception occurs while processing the method.
public Alert lock(Alert obj,
int lock_type,
int timeout)
throws java.rmi.RemoteException,
TimeoutException
AlertAPIlock in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIlock_type - Type of the lock to be locked. One of the constants
present in LockableObject interface.obj - AlertObject instance which is to be lockedtimeout - Time in seconds to wait.java.rmi.RemoteException - if request fails in remote machineTimeoutException - if the Alert object is already locked and not available
with in the spcified time interval,AlertAPI.unlock(Alert alt)
public void update(Alert al)
throws java.rmi.RemoteException
AlertObserverAlertObserver.update(Vector) will be invoked when there are a group of alerts getting
added or updated or deleted in the Web NMS system. In such case the Vector
object will contain all the Alert Objects under operation.
As mentioned earlier, Alert Observer will be notified for all operations on Alerts viz. Additions ,Deletions and Updations.
To ascertain whether the notification for the concerned Alert is due to addition or
updation or deletion the user could use severity and previousSeverity
properties of the Alert Object. The severity and previousSeverity of Alert object
can be obtained using Alert.getSeverity() and Alert.getPreviousSeverity()
methods respectively.
The information tabulated below could stand as a guideline for the users in this regard.
| Operation type | Severity | Previous Severity |
| Addition | int value based on the entry given in SeverityInfo.conf | Special purpose Severity can be obtained from SeverityInfo.getSpecialPurposeSeverity() |
| Deletion | Special purpose severity which can be obtained from SeverityInfo.getSpecialPurposeSeverity() |
int value based on the entry given in SeverityInfo.conf |
| Updation | int value based on the entry given in SeverityInfo.conf | int value based on the entry given in SeverityInfo.conf |
Note: Alert processing thread waits until invocation of this method gets completed. Hence users are suggested not to overload this method. This method is invoked after Alert object is added in database
update in interface AlertObservercom.adventnet.nms.alertdb.AlertObserveralert - The Alert Object that has been either added or updated or deleted,
in WebNMS system.java.rmi.RemoteException - if any exception in remote machineAlert,
AlertObserver.update(Vector)
public void update(java.util.Vector v)
throws java.rmi.RemoteException
AlertObserverNote: Alert processing thread waits until invocation of this method gets completed. Hence users are suggested not to overload this method. This method is invoked after Alert objects are added in database
update in interface AlertObservercom.adventnet.nms.alertdb.AlertObservervect - Vector of Alert Objects that has been added or updated or
deleted by the Web NMS systemjava.rmi.RemoteException - if any exception occurs in remote machineAlert,
AlertObserver.update(Alert)
public void update(XMLNode node)
throws java.rmi.RemoteException
AlertListenerTopoAPI.deleteObjectAndSubElements(String objkey)
method is invoked or for cascade delete when
TopoAPI.deleteObjectAndSubElements(String objkey,int level)
is invoked or when bulk delete is performed through client or when Alerts are purged using
AlertAPI.purgeAlertDB().
The bulk delete or cascade delete occurs for deletion of a Network or a container parent, or a group
relationship. When ever such a bulk delete of ManagedObjects occurs,
the corresponding Alerts have to be deleted and intimated to
the users who have registered themselves as AlertListener.
The XMLNode which is passed as an argument to this method contains the query
which could fetch Alert keys, corresponding to the deleted ManagedObject and its sub elements or the Alerts to be
purged.
The remote user can execute the query to get the entities of the deleted Alert.
An example structure of XMLNode for bulk delete is shown below as an reference
<BULK_DELETE_INFO>
<DATA
sqlQuery=" select entity from Alert where "+RelationalUtil.getAlias("source")+"
in ( "+moKeys+" ) and "+ RelationalUtil.getAlias("ownerName")+" like "
+"'"+ownerName+"'"
parentObjKey="192.168.4.0"
ownerName = "adventnet" />
<PROPS
parentKey="192.168.4.0" />
</BULK_DELETE_INFO>
If the database access is not available to the remote user then the user has to get the
names of the ManagedObjects deleted by
TopoAPI.getObjectNamesWithProps(Properties p) method. The
entity of the Alerts deleted for each ManagedObject can be obtained
one by one by CommonAPI.getObjectNamesWithProps(Properties p) method.
An example structure of XMLNode for purge Alert is shown below as an reference
<PURGE_ALERT>
<DATA
sqlQuery="select ENTITY,OWNERNAME from Alert"/>
</PURGE_ALERT>
update in interface AlertListenercom.adventnet.nms.alertdb.AlertListenernode - XMLNode which contains the entities of AlertRemoteException - if exception occurs in remote machine.
public void listenAlert(AlertActionInformer action)
throws java.rmi.RemoteException
AlertListenerAlertConstants
interface.
The various operations are
The operations can be identified by usingAlertConstants.ALS_CLEAR_ALERTAlertConstants.ALS_DELETE_ALERTAlertConstants.ALS_PICKUP_ALERTAlertConstants.ALS_UNPICK_ALERTAlertConstants.ALS_UPDATE_ALERTAlertConstants.ALS_UPDATE_NOTESAlertConstants.ALS_NMS_ACTION
AlertActionInformer.getOperation()
method. This method returns AlertConstants.ALS_NMS_ACTION if NMS itself
does any operation, like deletion of Alerts based on
ALERT_WINDOW_SIZE and ALERT_DELETE_INTERVAL parameters or updation
of Alerts through Events.
The user who is performing the corresponding operation, can be identified by using
AlertActionInformer.getUserName() method.
This method returns the corresponding user's name, if the operation is performed
through UI. It returns RMIUser if the operation is performed through RMI.
This method returns null if WebNMS itself does any operation.
AlertActionInformer.isBatchUpdate() method can be used to
the identify, whether the corresponding operation is a batch one or not.
If this method returns true, the corresponding alerts are stored in a Vector
and can be accessed using AlertActionInformer.getAlertList() method.
In this case AlertActionInformer.getAlert() method will return null.
If AlertActionInformer.isBatchUpdate() method returns false,
the corresponding alert object can be accesed by using
AlertActionInformer.getAlert() method. In this case
AlertActionInformer.getAlertList() returns null.
AlertActionInformer.getNotes() returns the corresponding notes added
by the user, only when user updating the notes using
AlertAPI.updateNotes(Alert alert,String userName,String notes, boolean lock)
method or from UI. For all other operations this method will return null.
listenAlert in interface AlertListenercom.adventnet.nms.alertdb.AlertListeneraction - AlertActionInformer object which encapsulates the details
of the operationRemoteException - if any errors in remote machine.public void preBEFailOverNotification(BEFailOverEvent event)
BEFailOverListener
The FE server, on detecting the BE server failure, intimates all the
BEFailOverListeners through this method and makes an
attempt to switch over to the standby BE server. The attempt to switch
over may fail, and this notification does not imply anything about
the outcome of the switch over operation.
preBEFailOverNotification in interface BEFailOverListenercom.adventnet.nms.fe.common.BEFailOverListenerbeFailOverEvent - An event object indicating BE fail over,
containing details about the failed BE server and the current
primary BE serverBEFailOverListener.postBEFailOverNotification(BEFailOverEvent),
MainSocketClientFE.registerBEFailOverListener(BEFailOverListener),
MainSocketClientFE.deRegisterBEFailOverListener(BEFailOverListener)public void postBEFailOverNotification(BEFailOverEvent beEvent)
BEFailOverListener
The FE server, on successfully switching over to the current primary
BE server, notifies all the BEFailOverListeners through
this method. This notification is the confirmation that the switch over
operation has been successful.
postBEFailOverNotification in interface BEFailOverListenercom.adventnet.nms.fe.common.BEFailOverListenerbeFailOverEvent - An event object indicating BE fail over,
containing details about the failed BE server and the current
primary BE serverBEFailOverListener.preBEFailOverNotification(BEFailOverEvent),
MainSocketClientFE.registerBEFailOverListener(BEFailOverListener),
MainSocketClientFE.deRegisterBEFailOverListener(BEFailOverListener)public void shutDown()
shutDown in interface ShutDownObserver
public java.util.Properties getAlertModuleParams()
throws java.rmi.RemoteException
The following parameters and their values will be put in the java.util.Properties object and returned.
| Alert Module Parameters | Possible Values |
| ALERT_DELETE_INTERVAL | int > 0 (numhours) |
| ALERT_TO_MANAGEDOBJECT_PROPOGATION | max,latest,none |
| ALERTS_USER_PROPERTY | latest,append,none |
| CREATE_ALERT_HISTORY | true,false |
| ON_DELETING_ALERT_DELETE | none,both,history,annotation |
| ACTION_ON_DELETING_MO | clear,delete,none |
| ANNOTATION_TABLE_SIZE | int >= 0 |
| ALERT_LOCK | true,false |
| ALERT_WINDOW_SIZE | int > 0 |
| GROUP_ALERTS_MODE | max,latest,none |
| MAX_ALERTS_PER_BATCH | int >= 0 |
getAlertModuleParams in interface AlertAPIjava.rmi.RemoteException - if request fails in remote machine
public void setAlertModuleParams(java.util.Properties prop)
throws java.rmi.RemoteException,
com.adventnet.nms.admin.InvalidParameterException
| Alert Module Parameters | Values Allowed |
| ALERT_DELETE_INTERVAL | int > 0 (numhours) |
| ALERT_TO_MANAGEDOBJECT_PROPOGATION | max,latest,none |
| ALERTS_USER_PROPERTY | latest,append,none |
| CREATE_ALERT_HISTORY | true,false |
| ON_DELETING_ALERT_DELETE | none,both,history,annotation |
| ACTION_ON_DELETING_MO | clear,delete,none |
| ANNOTATION_TABLE_SIZE | int >= 0 |
| ALERT_LOCK | true,false |
| MAX_ALERTS_PER_BATCH | int >= 0 |
setAlertModuleParams in interface AlertAPIprop - java.util.Properties object in which Alert 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 Alert Module Parameter.
public void resumeFilterAction(java.lang.String[] runnableClassName)
throws java.rmi.RemoteException
AlertAPIresumeFilterAction in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIrunnableClassName - 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.alertdb.SendEmailAlertAction"
runnableClassName[1]="com.adventnet.nms.alertdb.SendTrapAlertAction"
Note: The "FILTERACTION_FOR_ALERT_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
AlertAPIpauseFilterAction in interface AlertAPIcom.adventnet.nms.alertdb.AlertAPIrunnableClassName - 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.alertdb.SendEmailAlertAction"
runnableClassName[1]="com.adventnet.nms.alertdb.SendTrapAlertAction"
Note: The "FILTERACTION_FOR_ALERT_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 | ||||||||