Class Category


  • public class Category
    extends java.lang.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 java.util.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 java.lang.Long m_serviceCount
      Deprecated.
      A cached value of the total number of services on nodes belonging to this category.
      protected java.lang.Long m_serviceDownCount
      Deprecated.
      A cached value of the total number of services on nodes belonging to this category that are currently down.
      protected java.lang.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​(java.lang.String categoryName)
      Deprecated.
      Create an empty category with nothing other than a name.
      protected Category​(Category categoryDef, Category rtcCategory, java.util.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
      java.lang.String getAvailClass()
      Deprecated.
      Returns the availability CSS class for this category.
      java.lang.String getAvailText()
      Deprecated.
      Returns the availability text for this category ("XXX.XX%").
      java.lang.String getComment()
      Deprecated.
      Return a description explaining this category.
      java.util.Date getLastUpdated()
      Deprecated.
      Return the date and time this category was last updated by the RTC.
      java.lang.String getName()
      Deprecated.
      Return the unique name for this category.
      java.util.List<Node> getNode()
      Deprecated.
       
      AvailabilityNode getNode​(java.lang.Long nodeId)
      Deprecated.
       
      java.util.List<java.lang.Long> getNodeIds()
      Deprecated.
       
      NodeList getNodes()
      Deprecated.
       
      double getNormalThreshold()
      Deprecated.
      Return the value considered to be the minimum "normal" value.
      java.lang.String getOutageClass()
      Deprecated.
      Returns the outage CSS class for this category.
      java.lang.String getOutageText()
      Deprecated.
      Returns the outage text for this category ("X of Y" nodes down).
      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.
      long getServiceDownCount()
      Deprecated.
      Return the number of services that are currently down with this category.
      double getServicePercentage()
      Deprecated.
      Return a percentage of the ratio of services that are up to all services in this category.
      java.lang.String getTitle()
      Deprecated.
      Returns the category comment if there is one, otherwise, its name.
      double getValue()
      Deprecated.
      Return the current service level availability for this category.
      double getWarningThreshold()
      Deprecated.
      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

      • 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 java.util.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 java.lang.Long m_serviceCount
        Deprecated.
        A cached value of the total number of services on nodes belonging to this category.
      • m_serviceDownCount

        protected java.lang.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 java.lang.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​(java.lang.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,
                           java.util.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 java.lang.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 java.lang.String getComment()
        Deprecated.
        Return a description explaining this category.
        Returns:
        a String object.
      • getLastUpdated

        public java.util.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 java.lang.String getOutageClass()
                                        throws java.io.IOException
        Deprecated.
        Returns the outage CSS class for this category.
        Returns:
        a String object.
        Throws:
        java.io.IOException - if any.
      • getAvailClass

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

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

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

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

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

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

        public NodeList getNodes()
        Deprecated.
      • getNode

        public AvailabilityNode getNode​(java.lang.Long nodeId)
        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.