Package org.opennms.web.category
Class Category
- java.lang.Object
-
- org.opennms.web.category.Category
-
public class Category extends Object
Deprecated.This is awful... a 3rd Category model object that combines the other two model objects???? These all need to be merged into a single object.Adapts the functionality of the category definition and RTC category updates into one simple interface. Also adds many convenience methods.The category definition is read from the categories.xml file by the
CategoryFactory. The RTC category updates are periodically sent from the RTC to the WebUI.- Author:
- Lawrence Karnowski , OpenNMS
-
-
Field Summary
Fields Modifier and Type Field Description protected org.opennms.netmgt.config.categories.Categorym_categoryDefDeprecated.The category definition (from the categories.xml file).protected Datem_lastUpdatedDeprecated.The last time this category was updated.protected org.opennms.netmgt.xml.rtc.Categorym_rtcCategoryDeprecated.An update from the RTC about the service level availability for this category.protected Longm_serviceCountDeprecated.A cached value of the total number of services on nodes belonging to this category.protected Longm_serviceDownCountDeprecated.A cached value of the total number of services on nodes belonging to this category that are currently down.protected Doublem_servicePercentageDeprecated.A cached value of the ratio of services that are up on notes belonging to this category to all nodes belonging in this category.
-
Constructor Summary
Constructors Modifier Constructor Description protectedCategory()Deprecated.protectedCategory(String categoryName)Deprecated.Create an empty category with nothing other than a name.protectedCategory(org.opennms.netmgt.config.categories.Category categoryDef, org.opennms.netmgt.xml.rtc.Category rtcCategory, Date lastUpdated)Deprecated.Create a new instance to wrapper information from the categories.xml file (that defines a category) and information from the RTC (that gives current service level availability).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetAvailClass()Deprecated.Returns the availability CSS class for this category.StringgetAvailText()Deprecated.Returns the availability text for this category ("XXX.XX%").StringgetComment()Deprecated.Return a description explaining this category.DategetLastUpdated()Deprecated.Return the date and time this category was last updated by the RTC.StringgetName()Deprecated.Return the unique name for this category.List<org.opennms.netmgt.xml.rtc.Node>getNode()Deprecated.AvailabilityNodegetNode(Long nodeId)Deprecated.List<Long>getNodeIds()Deprecated.NodeListgetNodes()Deprecated.doublegetNormalThreshold()Deprecated.Return the value considered to be the minimum "normal" value.StringgetOutageClass()Deprecated.Returns the outage CSS class for this category.StringgetOutageText()Deprecated.Returns the outage text for this category ("X of Y" nodes down).protected static long[]getServiceCounts(org.opennms.netmgt.xml.rtc.Category category)Deprecated.Convenience method to count the number of services under a category and the number of those services that are currently down.longgetServiceDownCount()Deprecated.Return the number of services that are currently down with this category.doublegetServicePercentage()Deprecated.Return a percentage of the ratio of services that are up to all services in this category.StringgetTitle()Deprecated.Returns the category comment if there is one, otherwise, its name.doublegetValue()Deprecated.Return the current service level availability for this category.doublegetWarningThreshold()Deprecated.Return the value considered to be the minimum value below the "normal" value where only a warning is necessary.
-
-
-
Field Detail
-
m_categoryDef
protected final org.opennms.netmgt.config.categories.Category m_categoryDef
Deprecated.The category definition (from the categories.xml file).
-
m_rtcCategory
protected final org.opennms.netmgt.xml.rtc.Category m_rtcCategory
Deprecated.An update from the RTC about the service level availability for this category.
-
m_lastUpdated
protected final Date m_lastUpdated
Deprecated.The last time this category was updated. Note that with the current way this class and the CategoryModel are implemented, this value does not change because a new instance of this class is created for each RTC update.
-
m_serviceCount
protected Long m_serviceCount
Deprecated.A cached value of the total number of services on nodes belonging to this category.
-
m_serviceDownCount
protected Long m_serviceDownCount
Deprecated.A cached value of the total number of services on nodes belonging to this category that are currently down.
-
m_servicePercentage
protected Double m_servicePercentage
Deprecated.A cached value of the ratio of services that are up on notes belonging to this category to all nodes belonging in this category.
-
-
Constructor Detail
-
Category
protected Category()
Deprecated.
-
Category
protected Category(String categoryName)
Deprecated.Create an empty category with nothing other than a name. This represents a category with no RTC data.- Parameters:
categoryName- aStringobject.
-
Category
protected Category(org.opennms.netmgt.config.categories.Category categoryDef, org.opennms.netmgt.xml.rtc.Category rtcCategory, Date lastUpdated)Deprecated.Create a new instance to wrapper information from the categories.xml file (that defines a category) and information from the RTC (that gives current service level availability).- Parameters:
categoryDef- aCategoryobject.rtcCategory- aCategoryobject.lastUpdated- aDateobject.
-
-
Method Detail
-
getName
public String getName()
Deprecated.Return the unique name for this category.- Returns:
- a
Stringobject.
-
getNormalThreshold
public double getNormalThreshold()
Deprecated.Return the value considered to be the minimum "normal" value.- Returns:
- a double.
-
getWarningThreshold
public double getWarningThreshold()
Deprecated.Return the value considered to be the minimum value below the "normal" value where only a warning is necessary. Below this value the category's value will be considered unacceptable.- Returns:
- a double.
-
getComment
public String getComment()
Deprecated.Return a description explaining this category.- Returns:
- a
Stringobject.
-
getLastUpdated
public Date getLastUpdated()
Deprecated.Return the date and time this category was last updated by the RTC.- Returns:
- a
Dateobject.
-
getValue
public double getValue()
Deprecated.Return the current service level availability for this category.- Returns:
- a double.
-
getServiceDownCount
public long getServiceDownCount()
Deprecated.Return the number of services that are currently down with this category.- Returns:
- a long.
-
getServicePercentage
public double getServicePercentage()
Deprecated.Return a percentage of the ratio of services that are up to all services in this category.- Returns:
- a double.
-
getOutageClass
public String getOutageClass() throws IOException
Deprecated.Returns the outage CSS class for this category.- Returns:
- a
Stringobject. - Throws:
IOException- if any.
-
getAvailClass
public String getAvailClass() throws IOException
Deprecated.Returns the availability CSS class for this category.- Returns:
- a
Stringobject. - Throws:
IOException- if any.
-
getOutageText
public String getOutageText()
Deprecated.Returns the outage text for this category ("X of Y" nodes down).- Returns:
- a
Stringobject.
-
getAvailText
public String getAvailText()
Deprecated.Returns the availability text for this category ("XXX.XX%").- Returns:
- a
Stringobject.
-
getTitle
public String getTitle()
Deprecated.Returns the category comment if there is one, otherwise, its name.- Returns:
- a
Stringobject.
-
getNode
public List<org.opennms.netmgt.xml.rtc.Node> getNode()
Deprecated.
-
getNodes
public NodeList getNodes()
Deprecated.
-
getNode
public AvailabilityNode getNode(Long nodeId)
Deprecated.
-
getServiceCounts
protected static long[] getServiceCounts(org.opennms.netmgt.xml.rtc.Category category)
Deprecated.Convenience method to count the number of services under a category and the number of those services that are currently down.- Parameters:
category- aCategoryobject.- Returns:
- an array of long.
-
-