Class RTCHashMap


  • public class RTCHashMap
    extends 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 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​(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,
                               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,
                                   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,
                                       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 List<RTCNode> getRTCNodes​(int nodeid)

        getRTCNodes

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

        public List<RTCNode> getRTCNodes​(int nodeid,
                                         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.