Class 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 Category m_categoryDef
      Deprecated.
      The category definition (from the categories.xml file).
      protected Date m_lastUpdated
      Deprecated.
      The last time this category was updated.
      protected Category m_rtcCategory
      Deprecated.
      An update from the RTC about the service level availability for this category.
      protected Long m_serviceCount
      Deprecated.
      A cached value of the total number of services on nodes belonging to this category.
      protected Long m_serviceDownCount
      Deprecated.
      A cached value of the total number of services on nodes belonging to this category that are currently down.
      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 Summary

      Constructors 
      Modifier Constructor Description
      protected Category()
      Deprecated.
       
      protected Category​(String categoryName)
      Deprecated.
      Create an empty category with nothing other than a name.
      protected Category​(Category categoryDef, 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).
    • Field Detail

      • m_categoryDef

        protected final Category m_categoryDef
        Deprecated.
        The category definition (from the categories.xml file).
      • m_rtcCategory

        protected final 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 - a String object.
      • Category

        protected Category​(Category categoryDef,
                           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 - a Category object.
        rtcCategory - a Category object.
        lastUpdated - a Date object.
    • Method Detail

      • getName

        public String getName()
        Deprecated.
        Return the unique name for this category.
        Returns:
        a String object.
      • 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 String object.
      • getLastUpdated

        public Date getLastUpdated()
        Deprecated.
        Return the date and time this category was last updated by the RTC.
        Returns:
        a Date object.
      • 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 String object.
        Throws:
        IOException - if any.
      • getAvailClass

        public String getAvailClass()
                             throws IOException
        Deprecated.
        Returns the availability CSS class for this category.
        Returns:
        a String object.
        Throws:
        IOException - if any.
      • getOutageText

        public String getOutageText()
        Deprecated.
        Returns the outage text for this category ("X of Y" nodes down).
        Returns:
        a String object.
      • getAvailText

        public String getAvailText()
        Deprecated.
        Returns the availability text for this category ("XXX.XX%").
        Returns:
        a String object.
      • getTitle

        public String getTitle()
        Deprecated.
        Returns the category comment if there is one, otherwise, its name.
        Returns:
        a String object.
      • getNodeIds

        public List<Long> getNodeIds()
        Deprecated.
      • getNode

        public List<Node> getNode()
        Deprecated.
      • getNodes

        public NodeList getNodes()
        Deprecated.
      • getServiceCounts

        protected static long[] getServiceCounts​(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 - a Category object.
        Returns:
        an array of long.