Package org.opennms.netmgt.rtc.datablock
Class RTCNodeSvcTime
- java.lang.Object
-
- org.opennms.netmgt.rtc.datablock.RTCNodeSvcTime
-
public class RTCNodeSvcTime extends java.lang.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 Summary
Constructors Constructor Description RTCNodeSvcTime(long lostTime)
Creates a time with the lost timeRTCNodeSvcTime(long lostTime, long regainedTime)
Creates the service time with both the 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 windowlong
getLostTime()
Return the service lost timelong
getRegainedTime()
Return the service regained timeboolean
hasExpired(long startOfRollingWindow)
Return true if this outage has expired.void
setRegainedTime(long t)
Set the service regained time
-
-
-
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 lostregainedTime
- 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
-
-