|
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 | +--com.adventnet.nms.severity.SeverityInfo
This class provides the API mechanism to access information about the severities configured in Web NMS. Since Web NMS Release 2.2, severities that are handled by Web NMS can be configured in a XML based configuration file namely SeverityInfo.conf present in the [WebNMSHome]/conf directory. User can add or modify or delete severities in the configuration file, which are used by the Web NMS, giving the flexibility to customize and configure severities according to their needs.
The severties are defined using custom defined XML nodes. Each of the severity is specified using an XML node of the following format.
< SEVERITY ID="Severity-Name" //name of the severity
SEV-COLOR="sev-color"> //eg.,"255-255-0"
< /SEVERITY >
Each SEVERITY node will be treated as a valid severity of Web NMS
system. A SEVERITY node can contain sub nodes with any number of levels.
Here the Criticality of a severity is measured by the deviation of the
SEVERITY node from the mandatory Clear node. The further
the node is from the Clear node, the more will be its deviation and hence its criticality.
The class provides mechanism to access every information that are configured within Severity configuration file. To use these methods first the user has to create an instance of this class using any of the static getInstance() method present in this class. The instance of this class created will contain complete information about the severities configured. This information can be accessed by the users using the various methods provided by this class.
The severity information configured in the configuration file is modeled as a tree. With the tree model in place a iterator API mechanism through the class com.adventnet.nms.severity.SeverityIterator is provided to traverse the severity tree and retrieve any desired information about the severities configured.
Any code written by the developers over any of the Web NMS functionalities that directly or indirectly depend upon the severities information, have to use this class to access appropriate details about severities. The developer should notice that it is enough to get one instance of this class (using anyone of the getInstance() method present in this class) to access the entire information about the severities configured. An example user written application would be to add a new event object into Web NMS using Event API mechanism, by setting appropriate severities to the event object created.
To avoid creating multiple instances of this class, this class has a static reference of SeverityInfo and the same reference will be returned whenever the method getInstance() is called.
SeverityNode,
SeverityIterator, Serialized Form| Field Summary | |
static int |
EXCLUDE_NO_CRITICALITY
Used in few methods to retrieve severity values |
static int |
LEFT
Used to refer the left portion from clear node |
static int |
RIGHT
Used to refer the right portion from clear node |
| Method Summary | |
int |
compare(int firstSeverity,
int secondSeverity)
This method compares the criticality of two severities. |
int |
compare(java.lang.String firstSeverity,
java.lang.String secondSeverity)
This method compares the criticality of two severities. |
boolean |
contains(int severity)
This method can be used to find whether a severity is valid one or not. |
boolean |
contains(java.lang.String severity)
This method can be used to find whether a severity is valid one or not. |
int |
getClear()
Return severity value from clear node. |
java.awt.Color |
getColor(int severityValue)
This method can be used to get color value for a severity. |
java.awt.Color |
getColor(java.lang.String severityName)
This method can be used to get color value for a severity. |
int |
getDirectionOfHighestSeverity()
This can be used to get the direction where the highest criticality occurs. |
int |
getInfo()
Return severity value from info node. |
static SeverityInfo |
getInstance()
This method can be used to get the instance of severityInfo. |
static SeverityInfo |
getInstance(java.lang.String url)
This method can be called to initialize severity values by reading data from the configuration file. |
static SeverityInfo |
getInstanceFromHost(java.lang.String hostName)
This method can be used to get SeverityAPI reference from another host. |
static SeverityInfo |
getInstanceFromHost(java.lang.String hostName,
int port)
This method can be used to get SeverityAPI reference from another host. |
static SeverityInfo |
getInstanceFromHost(java.lang.String hostName,
int port,
java.lang.String userName,
AuthTicket ticket)
This method takes in username and ticket for getting the instance of the SeverityInfo when BE is in Secure RMI mode. |
SeverityIterator |
getIterator()
SeverityIterator can be used to traverse leaf nodes which are having criticality. |
java.lang.String |
getName(int severityValue)
This method can be used to get severity name for a severity value. |
java.util.Vector |
getNames()
This method can be used to get the severity names in criticality descending order. |
java.util.Vector |
getNames(int type)
This method can be used to get the severity names in criticality descending order. |
SeverityNode |
getRootNode()
This method returns root node. |
int |
getSeverityCount()
This method can be used to get total count of all severities. |
int |
getSeverityCount(int type)
This method can be used to get total count of severities based on a type. |
SeverityNode |
getSeverityNode(int severity)
This method can be used to get SeverityNode of given severity value. |
SeverityNode |
getSeverityNode(java.lang.String severity)
This method can be used to get SeverityNode of given severity name. |
int |
getSpecialPurposeSeverity()
Web NMS uses one special kind of severity called as specialPurposeSeverity. |
int |
getUnknown()
Return severity value from unknown node. |
int |
getValue(java.lang.String severityName)
This method can be used to get severity value for a severity name. |
boolean |
isClear(int severity)
This method can be used to find the given severity is a clear severity or not. |
boolean |
isDescending()
This method is find out the order of the SEV-VALUE. |
boolean |
isInfo(int severity)
This method can be used to find the given severity is a info severity or not. |
boolean |
isNoCriticality(int severity)
This method can be used to find whether a severity having criticality or not. |
boolean |
isNoCriticality(java.lang.String severity)
This method can be used to find whether a severity having criticality or not. |
boolean |
isUnknown(int severity)
This method can be used to find the given severity is a unknown severity or not. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int LEFT
public static final int RIGHT
public static final int EXCLUDE_NO_CRITICALITY
| Method Detail |
public static SeverityInfo getInstanceFromHost(java.lang.String hostName)
HostName - The name of the host for look up the SeverityAPI
reference.getInstance(String url)
public static SeverityInfo getInstanceFromHost(java.lang.String hostName,
int port)
hostName - The name of the host for look up the SeverityAPI
reference.port - The port number to which we need to do RMI lookup. This port number refers to the port
to which the SeverityAPI would have been bound in the Server.getInstance(String url)public static SeverityInfo getInstance(java.lang.String url)
UrlString - The urlstring for the configuration file name. To
read a conf file from a local disk, the file protocol can be used as
follows.
String url = "file:" + new File(fileName).getAbsolutePath();
getInstance()public static SeverityInfo getInstance()
Critical - 1; Major - 2; Minor - 3; Warning - 4; Clear - 5;
Info - 6; Unknown - 7
getInstance(String url)public java.util.Vector getNames()
public java.util.Vector getNames(int type)
type - Type to denote what kind of names to be returned.
Presently the only possible value of type is
EXCLUDE_NO_CRITICALITY.
EXCLUDE_NO_CRITICALITY - This will return only the names of severities which are having criticality. ie., If a severity node contains an attribute NO-CRITICALITY with the value true, this method will not include such a severity in the vector to be returned.
public java.awt.Color getColor(java.lang.String severityName)
severityName - Name of the severity as specified in the
configuration file.public java.awt.Color getColor(int severityValue)
severityValue - Value of the severity as specified in the
configuration file.public int getValue(java.lang.String severityName)
severityName - Name of the severity as specified in the
configuration file.public java.lang.String getName(int severityValue)
severityValue - Value of a severity as specified in the
configuration file.public int getClear()
public int getInfo()
public int getUnknown()
public int getSeverityCount()
getSeverityCount(int type)public int getSeverityCount(int type)
type - Type is to denote what kind of severities to be counted. Presently
the only possible value of type is EXCLUDE_NO_CRITICALITY.
EXCLUDE_NO_CRITICALITY - This will count only the severities which are having criticality. ie., if a severity node contains an attribute NO-CRITICALITY with the value true, this method will not count such a severity in the result to be returned.
getSeverityCount()
public int compare(int firstSeverity,
int secondSeverity)
If both the severity values are having equal criticality then it returns 0. If the first severity is having greater criticality than second one, it returns +1. Or if the second severity is having greater criticality than first one, it returns -1.
firstSeverity - a valid severity value.secondSeverity - a valid severity value.java.util.NoSuchElementException - if both or one of the severities
are invalid.java.lang.IllegalArgumentException - if both or one of the severities
are having no criticality.
public int compare(java.lang.String firstSeverity,
java.lang.String secondSeverity)
If both the severity values are having equal criticality then it returns 0. If the first severity is having greater criticality than second one, it returns +1. Or if the second severity is having greater criticality than first one, it returns -1.
firstSeverity - a valid severity name.secondSeverity - a valid severity name.java.util.NoSuchElementException - if both or one of the severities
are invalid.java.lang.IllegalArgumentException - if both or one of the severities
are having no criticality.public SeverityIterator getIterator()
SeverityIteratorpublic int getDirectionOfHighestSeverity()
public boolean isNoCriticality(int severity)
severity - a valid severity value.public boolean isNoCriticality(java.lang.String severity)
severity - a valid severity name.public boolean contains(int severity)
severity - a severity value to find the validity.public boolean contains(java.lang.String severity)
severity - a severity name to find the validity.public int getSpecialPurposeSeverity()
public boolean isClear(int severity)
severity - a valid severity value.public boolean isInfo(int severity)
severity - a valid severity value.public boolean isUnknown(int severity)
severity - a valid severity value.public SeverityNode getRootNode()
SeverityNodepublic SeverityNode getSeverityNode(int severity)
severity - a valid severity value to get its SeverityNode.SeverityNodepublic SeverityNode getSeverityNode(java.lang.String severity)
severity - a valid severity name to get its SeverityNode.SeverityNodepublic boolean isDescending()
isDescending method here.boolean If SEV-VALUE order is descending, return true, otherwise return false.
public static SeverityInfo getInstanceFromHost(java.lang.String hostName,
int port,
java.lang.String userName,
AuthTicket ticket)
throws java.lang.Exception
hostName - The name of the host for lookup the SeverityAPI reference.port - The RMI registry portuserName - A valid user for the server.ticket - The user's ticket (SeverityInfo instancejava.lang.Exception - if an error occurs during either lookup or during the getAPI method of
RMIAccessAPI.
|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||