OpenNMS API 1.2.3

org.opennms.web.category
Class CategoryModel

java.lang.Object
  extended byorg.opennms.web.category.CategoryModel

public class CategoryModel
extends java.lang.Object


Field Summary
protected  java.util.HashMap categories
          A mapping of category names to category instances.
protected  CategoryFactory catFactory
          A reference to the CategoryFactory to get to category definitions.
private static CategoryModel instance
          The singleton instance of this class.
protected  org.apache.log4j.Category log
          The Log4J category for logging status and debug messages.
static java.lang.String OVERALL_AVAILABILITY_CATEGORY
          The name of the category that includes all services and nodes.
 
Constructor Summary
private CategoryModel()
          Create the instance of the CategoryModel.
 
Method Summary
 Category getCategory(java.lang.String categoryName)
          Return the Category instance for the given category name.
 java.lang.String getCategoryComment(java.lang.String categoryName)
          Look up the category definition and return the category's description.
 java.util.Map getCategoryMap()
          Return a mapping of category names to instances.
 double getCategoryNormalThreshold(java.lang.String categoryName)
          Look up the category definition and return the category's normal threshold.
 double getCategoryWarningThreshold(java.lang.String categoryName)
          Look up the category definition and return the category's warning threshold.
static CategoryModel getInstance()
          Return the CategoryModel.
 double getInterfaceAvailability(int nodeId, java.lang.String ipAddr)
          Return the availability percentage for all managed services on the given interface for the last 24 hours.
 double getInterfaceAvailability(int nodeId, java.lang.String ipAddr, java.util.Date start, java.util.Date end)
          Return the availability percentage for all managed services on the given interface from the given start time until the given end time.
 double getNodeAvailability(int nodeId)
          Return the availability percentage for all managed services on the given node for the last 24 hours.
 double getNodeAvailability(int nodeId, java.util.Date start, java.util.Date end)
          Return the availability percentage for all managed services on the given node from the given start time until the given end time.
 double getServiceAvailability(int nodeId, java.lang.String ipAddr, int serviceId)
          Return the availability percentage for a managed service for the last 24 hours.
 double getServiceAvailability(int nodeId, java.lang.String ipAddr, int serviceId, java.util.Date start, java.util.Date end)
          Return the availability percentage for a managed service from the given start time until the given end time.
 void updateCategory(Category rtcCategory)
          Update a category with new values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OVERALL_AVAILABILITY_CATEGORY

public static final java.lang.String OVERALL_AVAILABILITY_CATEGORY
The name of the category that includes all services and nodes.

See Also:
Constant Field Values

instance

private static CategoryModel instance
The singleton instance of this class.


categories

protected java.util.HashMap categories
A mapping of category names to category instances.


catFactory

protected CategoryFactory catFactory
A reference to the CategoryFactory to get to category definitions.


log

protected org.apache.log4j.Category log
The Log4J category for logging status and debug messages.

Constructor Detail

CategoryModel

private CategoryModel()
               throws java.io.IOException,
                      org.exolab.castor.xml.MarshalException,
                      org.exolab.castor.xml.ValidationException
Create the instance of the CategoryModel.

Method Detail

getInstance

public static CategoryModel getInstance()
                                 throws java.io.IOException,
                                        org.exolab.castor.xml.MarshalException,
                                        org.exolab.castor.xml.ValidationException
Return the CategoryModel.

Throws:
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getCategory

public Category getCategory(java.lang.String categoryName)
Return the Category instance for the given category name. Return null if there is no match for the given name.


getCategoryMap

public java.util.Map getCategoryMap()
Return a mapping of category names to instances.


getCategoryNormalThreshold

public double getCategoryNormalThreshold(java.lang.String categoryName)
Look up the category definition and return the category's normal threshold.


getCategoryWarningThreshold

public double getCategoryWarningThreshold(java.lang.String categoryName)
Look up the category definition and return the category's warning threshold.


getCategoryComment

public java.lang.String getCategoryComment(java.lang.String categoryName)
Look up the category definition and return the category's description.


updateCategory

public void updateCategory(Category rtcCategory)
Update a category with new values.


getNodeAvailability

public double getNodeAvailability(int nodeId)
                           throws java.sql.SQLException
Return the availability percentage for all managed services on the given node for the last 24 hours. If there are no managed services on this node, then a value of -1 is returned.

Throws:
java.sql.SQLException

getNodeAvailability

public double getNodeAvailability(int nodeId,
                                  java.util.Date start,
                                  java.util.Date end)
                           throws java.sql.SQLException
Return the availability percentage for all managed services on the given node from the given start time until the given end time. If there are no managed services on this node, then a value of -1 is returned.

Throws:
java.sql.SQLException

getInterfaceAvailability

public double getInterfaceAvailability(int nodeId,
                                       java.lang.String ipAddr)
                                throws java.sql.SQLException
Return the availability percentage for all managed services on the given interface for the last 24 hours. If there are no managed services on this interface, then a value of -1 is returned.

Throws:
java.sql.SQLException

getInterfaceAvailability

public double getInterfaceAvailability(int nodeId,
                                       java.lang.String ipAddr,
                                       java.util.Date start,
                                       java.util.Date end)
                                throws java.sql.SQLException
Return the availability percentage for all managed services on the given interface from the given start time until the given end time. If there are no managed services on this interface, then a value of -1 is returned.

Throws:
java.sql.SQLException

getServiceAvailability

public double getServiceAvailability(int nodeId,
                                     java.lang.String ipAddr,
                                     int serviceId)
                              throws java.sql.SQLException
Return the availability percentage for a managed service for the last 24 hours. If the service is not managed, then a value of -1 is returned.

Throws:
java.sql.SQLException

getServiceAvailability

public double getServiceAvailability(int nodeId,
                                     java.lang.String ipAddr,
                                     int serviceId,
                                     java.util.Date start,
                                     java.util.Date end)
                              throws java.sql.SQLException
Return the availability percentage for a managed service from the given start time until the given end time. If the service is not managed, then a value of -1 is returned.

Throws:
java.sql.SQLException

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.