Package org.opennms.reporting.datablock
Class Outage
- java.lang.Object
-
- org.opennms.reporting.datablock.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
-
-
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 windowlong
getLostTime()
Return the service lost timelong
getRegainedTime()
Return the regained timevoid
setLostTime(long losttime)
Set the Lost timevoid
setRegainedTime(long regainedtime)
Set the regained time.java.lang.String
toString()
Returns the outage information in date format.
-
-
-
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 classjava.lang.Object
- Returns:
- a
String
object.
-
-