Class RTCNodeSvcTime


  • public class RTCNodeSvcTime
    extends Object
    This contains a service lost/regained set/pair for the node - i.e each service lost time and the corresponding service regained time
    Author:
    Sowmya Kumaraswamy , OpenNMS.org
    • Constructor Detail

      • RTCNodeSvcTime

        public RTCNodeSvcTime​(long lostTime)
        Creates a time with the lost time
        Parameters:
        lostTime - the time at which service was lost
      • RTCNodeSvcTime

        public RTCNodeSvcTime​(long lostTime,
                              long regainedTime)
        Creates the service time with both the lost and regained times
        Parameters:
        lostTime - the time at which service was lost
        regainedTime - the time at which service was regained
    • Method Detail

      • setRegainedTime

        public void setRegainedTime​(long t)
        Set the service regained time
        Parameters:
        t - the time at which service was regained
      • getLostTime

        public long getLostTime()
        Return the service lost time
        Returns:
        the service lost time
      • getRegainedTime

        public long getRegainedTime()
        Return the service regained time
        Returns:
        the service regained time
      • hasExpired

        public boolean hasExpired​(long startOfRollingWindow)
        Return true if this outage has expired.
        Parameters:
        startOfRollingWindow - Epoch milliseconds that indicates the beginning of the rolling outage window.
        Returns:
        true if this outage has expired
      • getDownTime

        public long getDownTime​(long curTime,
                                long rollingWindow)
        Return the downtime (difference between the regained and lost times) in the last rolling window
        Parameters:
        curTime - a long.
        rollingWindow - a long.
        Returns:
        the downtime (difference between the regained and lost times) in the last rolling window