Class CategoryModel


  • public class CategoryModel
    extends java.lang.Object

    CategoryModel class.

    Version:
    $Id: $
    Author:
    ranger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String OVERALL_AVAILABILITY_CATEGORY
      The 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
      Category getCategory​(java.lang.String categoryName)
      Return the Category instance for the given category name.
      java.lang.String getCategoryComment​(java.lang.String categoryName)
      Look up the category definition and return the category's description.
      java.util.Map<java.lang.String,​Category> getCategoryMap()
      Return a mapping of category names to instances.
      double getCategoryNormalThreshold​(java.lang.String categoryName)
      Look up the category definition and return the category's normal threshold.
      double getCategoryWarningThreshold​(java.lang.String categoryName)
      Look up the category definition and return the category's warning threshold.
      static CategoryModel getInstance()
      Return the CategoryModel.
      static double getInterfaceAvailability​(int nodeId, java.lang.String ipAddr)
      Return the availability percentage for all managed services on the given interface for the last 24 hours.
      static double getNodeAvailability​(int nodeId)
      Return the availability percentage for all managed services on the given node for the last 24 hours.
      static double getServiceAvailability​(int nodeId, java.lang.String ipAddr, int serviceId)
      Return the availability percentage for a managed service for the last 24 hours.
      void updateCategory​(Category rtcCategory)
      Update a category with new values.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • OVERALL_AVAILABILITY_CATEGORY

        public static final java.lang.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 java.io.IOException
        Return the CategoryModel.
        Returns:
        a CategoryModel object.
        Throws:
        java.io.IOException - if any.
      • getCategory

        public Category getCategory​(java.lang.String categoryName)
        Return the Category instance for the given category name. Return null if there is no match for the given name.
        Parameters:
        categoryName - a String object.
        Returns:
        a Category object.
      • getCategoryMap

        public java.util.Map<java.lang.String,​Category> getCategoryMap()
        Return a mapping of category names to instances.
        Returns:
        a Map object.
      • getCategoryNormalThreshold

        public double getCategoryNormalThreshold​(java.lang.String categoryName)
        Look up the category definition and return the category's normal threshold.
        Parameters:
        categoryName - a String object.
        Returns:
        a double.
      • getCategoryWarningThreshold

        public double getCategoryWarningThreshold​(java.lang.String categoryName)
        Look up the category definition and return the category's warning threshold.
        Parameters:
        categoryName - a String object.
        Returns:
        a double.
      • getCategoryComment

        public java.lang.String getCategoryComment​(java.lang.String categoryName)
        Look up the category definition and return the category's description.
        Parameters:
        categoryName - a String object.
        Returns:
        a String object.
      • updateCategory

        public void updateCategory​(Category rtcCategory)
        Update a category with new values.
        Parameters:
        rtcCategory - a Category object.
      • getNodeAvailability

        public static double getNodeAvailability​(int nodeId)
                                          throws java.sql.SQLException
        Return 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:
        java.sql.SQLException - if any.
      • getInterfaceAvailability

        public static double getInterfaceAvailability​(int nodeId,
                                                      java.lang.String ipAddr)
                                               throws java.sql.SQLException
        Return 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 - a String object.
        Returns:
        a double.
        Throws:
        java.sql.SQLException - if any.
      • getServiceAvailability

        public static double getServiceAvailability​(int nodeId,
                                                    java.lang.String ipAddr,
                                                    int serviceId)
                                             throws java.sql.SQLException
        Return 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 - a String object.
        serviceId - a int.
        Returns:
        a double.
        Throws:
        java.sql.SQLException - if any.