Package org.opennms.web.category
Class CategoryModel
- java.lang.Object
-
- org.opennms.web.category.CategoryModel
-
public class CategoryModel extends Object
CategoryModel class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Field Summary
Fields Modifier and Type Field Description static StringOVERALL_AVAILABILITY_CATEGORYThe name of the category that includes all services and nodes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CategorygetCategory(String categoryName)Return theCategoryinstance for the given category name.StringgetCategoryComment(String categoryName)Look up the category definition and return the category's description.Map<String,Category>getCategoryMap()Return a mapping of category names to instances.doublegetCategoryNormalThreshold(String categoryName)Look up the category definition and return the category's normal threshold.doublegetCategoryWarningThreshold(String categoryName)Look up the category definition and return the category's warning threshold.static CategoryModelgetInstance()Return theCategoryModel.static doublegetInterfaceAvailability(int nodeId, String ipAddr)Return the availability percentage for all managed services on the given interface for the last 24 hours.static doublegetNodeAvailability(int nodeId)Return the availability percentage for all managed services on the given node for the last 24 hours.static doublegetServiceAvailability(int nodeId, String ipAddr, int serviceId)Return the availability percentage for a managed service for the last 24 hours.voidupdateCategory(Category rtcCategory)Update a category with new values.
-
-
-
Field Detail
-
OVERALL_AVAILABILITY_CATEGORY
public static final String OVERALL_AVAILABILITY_CATEGORY
The name of the category that includes all services and nodes.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static CategoryModel getInstance() throws IOException
Return theCategoryModel.- Returns:
- a
CategoryModelobject. - Throws:
IOException- if any.
-
getCategory
public Category getCategory(String categoryName)
Return theCategoryinstance for the given category name. Return null if there is no match for the given name.
-
getCategoryMap
public Map<String,Category> getCategoryMap()
Return a mapping of category names to instances.- Returns:
- a
Mapobject.
-
getCategoryNormalThreshold
public double getCategoryNormalThreshold(String categoryName)
Look up the category definition and return the category's normal threshold.- Parameters:
categoryName- aStringobject.- Returns:
- a double.
-
getCategoryWarningThreshold
public double getCategoryWarningThreshold(String categoryName)
Look up the category definition and return the category's warning threshold.- Parameters:
categoryName- aStringobject.- Returns:
- a double.
-
getCategoryComment
public String getCategoryComment(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.- Parameters:
rtcCategory- aCategoryobject.
-
getNodeAvailability
public static double getNodeAvailability(int nodeId) throws SQLExceptionReturn 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.- Parameters:
nodeId- a int.- Returns:
- a double.
- Throws:
SQLException- if any.
-
getInterfaceAvailability
public static double getInterfaceAvailability(int nodeId, String ipAddr) throws SQLExceptionReturn 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.- Parameters:
nodeId- a int.ipAddr- aStringobject.- Returns:
- a double.
- Throws:
SQLException- if any.
-
getServiceAvailability
public static double getServiceAvailability(int nodeId, String ipAddr, int serviceId) throws SQLExceptionReturn 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.- Parameters:
nodeId- a int.ipAddr- aStringobject.serviceId- a int.- Returns:
- a double.
- Throws:
SQLException- if any.
-
-