Class Outage


  • public class Outage
    extends Object
    This class holds the service lost and regained time pair for the node/ipaddr/service combination.
    Author:
    Jacinta Remedios
    • Constructor Detail

      • Outage

        public Outage()
        Default Constructor.
      • Outage

        public Outage​(long svcLost)
        Constructor that sets the lost time.
        Parameters:
        svcLost - Time at which the service is lost.
      • Outage

        public Outage​(long svcLost,
                      long svcRegained)
        Constructor that sets the service lost and regained times.
        Parameters:
        svcLost - Time at which the service is lost.
        svcRegained - Time at which the service is regained.
    • Method Detail

      • setLostTime

        public void setLostTime​(long losttime)
        Set the Lost time
        Parameters:
        losttime - Time at which the service is lost.
      • setRegainedTime

        public void setRegainedTime​(long regainedtime)
        Set the regained time.
        Parameters:
        regainedtime - Time at which the service is regained.
      • getLostTime

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

        public long getRegainedTime()
        Return the regained time
        Returns:
        the service regained time.
      • 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 - Time denoting end of rolling window (milliseconds).
        rollingWindow - Rolling Window (milliseconds)
        Returns:
        the downtime (difference between the regained and lost times) in the last rolling window
      • toString

        public String toString()
        Returns the outage information in date format.
        Overrides:
        toString in class Object
        Returns:
        a String object.