Class RTCNodeSvcTimesList

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<RTCNodeSvcTime>, java.util.Collection<RTCNodeSvcTime>, java.util.Deque<RTCNodeSvcTime>, java.util.List<RTCNodeSvcTime>, java.util.Queue<RTCNodeSvcTime>

    public class RTCNodeSvcTimesList
    extends java.util.LinkedList<RTCNodeSvcTime>
    List of service times. This contains a list of service lost/regained set/pair for the RTCNode. 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 outage time for a window is calculated, the same calculations are not done on the node multiple times. 'Expired' outages are removed during 'add' and 'getDownTime' operations.
    Author:
    Sowmya Kumaraswamy , OpenNMS.org
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      RTCNodeSvcTimesList​(long rollingWindow)
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSvcTime​(long losttime)
      Add a new servicetime entry
      void addSvcTime​(long losttime, long regainedtime)
      Add a new servicetime entry.
      long getDownTime​(long curTime, long rollingWindow)
      Calculate the total downtime in this list of service times for the last 'rollingWindow' time starting at 'curTime'
      • Methods inherited from class java.util.LinkedList

        add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
      • Methods inherited from class java.util.AbstractSequentialList

        iterator
      • Methods inherited from class java.util.AbstractList

        equals, hashCode, listIterator, removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

        containsAll, isEmpty, removeAll, retainAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.util.Deque

        iterator
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
    • Constructor Detail

      • RTCNodeSvcTimesList

        public RTCNodeSvcTimesList​(long rollingWindow)
        Default constructor.
    • Method Detail

      • addSvcTime

        public void addSvcTime​(long losttime,
                               long regainedtime)
        Add a new servicetime entry.
        Parameters:
        losttime - time at which service was lost
        regainedtime - time at which service was regained
      • addSvcTime

        public void addSvcTime​(long losttime)
        Add a new servicetime 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 'rollingWindow' time starting at 'curTime'
        Parameters:
        curTime - the current time from which the down time is to be calculated
        rollingWindow - the last window for which the downtime is to be calculated
        Returns:
        total down time for all outages for this service