|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.web.category.Category
public class Category
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.
| Field Summary | |
|---|---|
protected Category |
m_categoryDef
The category definition (from the categories.xml file). |
protected Date |
m_lastUpdated
The last time this category was updated. |
protected Category |
m_rtcCategory
An update from the RTC about the service level availability for this category. |
protected Long |
m_serviceCount
A cached value of the total number of services on nodes belonging to this category. |
protected Long |
m_serviceDownCount
A cached value of the total number of services on nodes belonging to this category that are currently down. |
protected Double |
m_servicePercentage
A cached value of the ratio of services that are up on notes beloging to this category to all nodes belonging in this category. |
| Constructor Summary | |
|---|---|
protected |
Category(Category categoryDef,
Category rtcCategory,
Date lastUpdated)
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). |
protected |
Category(String categoryName)
Create an empty category with nothing other than a name. |
| Method Summary | |
|---|---|
Enumeration |
enumerateNode()
Returns an enumeration of the Castor-generated Node objects tied to this category. |
String |
getAvailClass()
Returns the availability CSS class for this category. |
String |
getAvailColor()
Returns the availability background color for this category. |
String |
getAvailText()
Returns the availability text for this category ("XXX.XX%"). |
String |
getComment()
Return a description explaining this category. |
Date |
getLastUpdated()
Return the date and time this category was last updated by the RTC. |
String |
getName()
Return the unique name for this category. |
double |
getNormalThreshold()
Return the value considered to be the minimum "normal" value. |
String |
getOutageClass()
Returns the outage CSS class for this category. |
String |
getOutageColor()
Returns the outage background color for this category. |
String |
getOutageText()
Returns the outage text for this category ("X of Y" nodes down). |
long |
getServiceCount()
Return the number of services contained within this category. |
protected static long[] |
getServiceCounts(Category category)
Convenience method to count the number of services under a category and the number of those services that are currently down. |
long |
getServiceDownCount()
Return the number of services that are currently down with this category. |
double |
getServicePercentage()
Return a percentage of the ratio of services that are up to all services in this category. |
String |
getTitle()
Returns the category comment if there is one, otherwise, its name. |
double |
getValue()
Return the current service level availability for this category. |
double |
getWarningThreshold()
Return the value considered to be the minimum value below the "normal" value where only a warning is necessary. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Category m_categoryDef
protected Category m_rtcCategory
protected Date m_lastUpdated
protected Long m_serviceCount
protected Long m_serviceDownCount
protected Double m_servicePercentage
| Constructor Detail |
|---|
protected Category(String categoryName)
protected Category(Category categoryDef,
Category rtcCategory,
Date lastUpdated)
| Method Detail |
|---|
public String getName()
public double getNormalThreshold()
public double getWarningThreshold()
public String getComment()
public Date getLastUpdated()
public double getValue()
public long getServiceCount()
public long getServiceDownCount()
public double getServicePercentage()
public String getOutageColor()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getAvailColor()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getOutageClass()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getAvailClass()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationExceptionpublic String getOutageText()
public String getAvailText()
public String getTitle()
public Enumeration enumerateNode()
Note, LJK Dec 5,2001: I'm not really happy about exposing the Castor objects this way. We do it all over the place, but I've already started hiding them in this particular case (the rtceui.xsd objects). I'm not very pleased with this half approach. I'd rather hide them completely or not at all, but I don't want to introduce a new pass-through object.
protected static long[] getServiceCounts(Category category)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||