Class RTCHashMap


  • public class RTCHashMap
    extends java.lang.Object
    The RTCHashMap has either a nodeid or a nodeid/ip as key and provides convenience methods to add and remove 'RTCNodes' with these values - each key points to a list of 'RTCNode's
    Author:
    Sowmya Kumaraswamy , OpenNMS.org
    • Constructor Summary

      Constructors 
      Constructor Description
      RTCHashMap​(int initialCapacity)
      constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(RTCNode rtcN)
      Add an rtc node
      void delete​(RTCNode rtcN)
      delete
      void deleteNode​(int nodeid)
      deleteNode
      RTCNode getRTCNode​(RTCNodeKey key)
      getRTCNode
      java.util.List<RTCNode> getRTCNodes​(int nodeid)
      getRTCNodes
      java.util.List<RTCNode> getRTCNodes​(int nodeid, java.net.InetAddress ip)
      getRTCNodes
      int getServiceCount​(int nodeid, java.lang.String catLabel)
      Get the count of services for a node in the context of the the specified category
      int getServiceDownCount​(int nodeid, java.lang.String catLabel)
      Get the count of services currently down for a node in the context of the the specified category
      double getValue​(int nodeid, java.lang.String catLabel, long curTime, long rollingWindow)
      Get the value (uptime) for the a node that belongs to the category in the last 'rollingWindow' starting at current time
      double getValue​(java.lang.String catLabel, long curTime, long rollingWindow)
      Get the value (uptime) for a category in the last 'rollingWindow' starting at current time
      • Methods inherited from class java.lang.Object

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

      • RTCHashMap

        public RTCHashMap​(int initialCapacity)
        constructor
        Parameters:
        initialCapacity - a int.
    • Method Detail

      • add

        public void add​(RTCNode rtcN)
        Add an rtc node
        Parameters:
        rtcN - the rtcNode to add
      • delete

        public void delete​(RTCNode rtcN)

        delete

        Parameters:
        rtcN - a RTCNode object.
      • getValue

        public double getValue​(java.lang.String catLabel,
                               long curTime,
                               long rollingWindow)
        Get the value (uptime) for a category in the last 'rollingWindow' starting at current time
        Parameters:
        catLabel - the category to which the node should belong to
        curTime - the current time
        rollingWindow - the window for which value is to be calculated
        Returns:
        the value(uptime) for the node
      • getValue

        public double getValue​(int nodeid,
                               java.lang.String catLabel,
                               long curTime,
                               long rollingWindow)
        Get the value (uptime) for the a node that belongs to the category in the last 'rollingWindow' starting at current time
        Parameters:
        nodeid - the node for which value is to be calculated
        catLabel - the category to which the node should belong to
        curTime - the current time
        rollingWindow - the window for which value is to be calculated
        Returns:
        the value(uptime) for the node
      • getServiceCount

        public int getServiceCount​(int nodeid,
                                   java.lang.String catLabel)
        Get the count of services for a node in the context of the the specified category
        Parameters:
        nodeid - the node for which servicecount is needed
        catLabel - the category to which the node should belong to
        Returns:
        the service count for the nodeid in the context of the specfied category
      • getServiceDownCount

        public int getServiceDownCount​(int nodeid,
                                       java.lang.String catLabel)
        Get the count of services currently down for a node in the context of the the specified category
        Parameters:
        nodeid - the node for which servicecount is needed
        catLabel - the category to which the node should belong to
        Returns:
        the service down count for the nodeid in the context of the specfied category
      • getRTCNodes

        public java.util.List<RTCNode> getRTCNodes​(int nodeid)

        getRTCNodes

        Parameters:
        nodeid - a long.
        Returns:
        a List object.
      • getRTCNodes

        public java.util.List<RTCNode> getRTCNodes​(int nodeid,
                                                   java.net.InetAddress ip)

        getRTCNodes

        Parameters:
        nodeid - a long.
        ip - a String object.
        Returns:
        a List object.
      • deleteNode

        public void deleteNode​(int nodeid)

        deleteNode

        Parameters:
        nodeid - a long.