Package org.opennms.reporting.datablock
Class OutageSvcTimesList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<Outage>
-
- org.opennms.reporting.datablock.OutageSvcTimesList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<Outage>
,java.util.Collection<Outage>
,java.util.List<Outage>
,java.util.RandomAccess
public class OutageSvcTimesList extends java.util.ArrayList<Outage>
This contains a list of service lost/regained set/pair. Also maintains the outage/down time each time it is calculated and the time from which this was calculated - this is done so when the view outage time for a window is calculated, the same calculations are not done on the node multiple times
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OutageSvcTimesList()
Default constructorOutageSvcTimesList(int initialCapacity)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSvcTime(long losttime)
Add a new service time entryvoid
addSvcTime(long losttime, long regainedtime)
Add a new servicetime entrylong
getDownTime(long curTime, long rollingWindow)
Calculate the total downtime in this list of service times for the last 'rollinWindow' time starting at 'curTime'java.util.List<OutageSince>
getServiceOutages(java.lang.String nodeName, long curTime, long rollingWindow)
Returns a list of outage / out-since pairs for the rolling window specifiedjava.lang.String
toString()
toString-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Method Detail
-
addSvcTime
public void addSvcTime(long losttime, long regainedtime)
Add a new servicetime entry- Parameters:
losttime
- time at which service was lostregainedtime
- time at which service was regained
-
addSvcTime
public void addSvcTime(long losttime)
Add a new service time entry- Parameters:
losttime
- time at which service was lost
-
getDownTime
public long getDownTime(long curTime, long rollingWindow)
Calculate the total downtime in this list of service times for the last 'rollinWindow' time starting at 'curTime'- Parameters:
curTime
- the current time from which the down time is to be calculatedrollingWindow
- the last window for which the downtime is to be calculated- Returns:
- total down time in service times in this list
-
getServiceOutages
public java.util.List<OutageSince> getServiceOutages(java.lang.String nodeName, long curTime, long rollingWindow)
Returns a list of outage / out-since pairs for the rolling window specified- Parameters:
curTime
- the current time from which the down time is to be calculatedrollingWindow
- the last window for which the down time is to be calculatednodeName
- aString
object.- Returns:
- a
List
object.
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classjava.util.AbstractCollection<Outage>
- Returns:
- a
String
object.
-
-