Class Outage


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

      Constructors 
      Constructor Description
      Outage()
      Default Constructor.
      Outage​(long svcLost)
      Constructor that sets the lost time.
      Outage​(long svcLost, long svcRegained)
      Constructor that sets the service lost and regained times.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getDownTime​(long curTime, long rollingWindow)
      Return the downtime (difference between the regained and lost times) in the last rolling window
      long getLostTime()
      Return the service lost time
      long getRegainedTime()
      Return the regained time
      void setLostTime​(long losttime)
      Set the Lost time
      void setRegainedTime​(long regainedtime)
      Set the regained time.
      java.lang.String toString()
      Returns the outage information in date format.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 java.lang.String toString()
        Returns the outage information in date format.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String object.