Class NetworkOutage

java.lang.Object
org.deltava.beans.servinfo.NetworkOutage
All Implemented Interfaces:
Comparable<Object>, CalendarEntry, TimeSpan

public class NetworkOutage extends Object implements TimeSpan
A bean to track Online Network data feed outages.
Since:
8.6
Version:
10.3
Author:
Luke
  • Constructor Details

    • NetworkOutage

      public NetworkOutage(OnlineNetwork net)
      Creates the bean.
      Parameters:
      net - the OnlineNetwork
  • Method Details

    • getNetwork

      public OnlineNetwork getNetwork()
      Return the Online Network that had an outage.
      Returns:
      the OnlineNetwork
    • getDate

      public Instant getDate()
      Description copied from interface: CalendarEntry
      Returns this entry's date for ordering in the Calendar.
      Specified by:
      getDate in interface CalendarEntry
      Returns:
      the date/time
    • getStartTime

      public Instant getStartTime()
      Description copied from interface: TimeSpan
      The start date/time of this span.
      Specified by:
      getStartTime in interface TimeSpan
      Returns:
      the start date/time
    • getEndTime

      public Instant getEndTime()
      Description copied from interface: TimeSpan
      The end date/time of this span.
      Specified by:
      getEndTime in interface TimeSpan
      Returns:
      the end date/time
    • getDuration

      public Duration getDuration()
      Description copied from interface: TimeSpan
      The duration of this span, or null if both times are not set.
      Specified by:
      getDuration in interface TimeSpan
      Returns:
      a Duration, or null
    • setStartTime

      public void setStartTime(Instant dt)
      Updates the start of the outage.
      Parameters:
      dt - the start date/time
    • setEndTime

      public void setEndTime(Instant dt)
      Updates the end of the outage.
      Parameters:
      dt - the end date/time
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(Object o2)
      Specified by:
      compareTo in interface Comparable<Object>
    • calculate

      public static Collection<NetworkOutage> calculate(OnlineNetwork net, TimeSpan ts, Collection<Instant> fetchTimes, int updateInterval)
      Creates a list of data feed outages from a Collection of data feed pull times within a given time span.
      Parameters:
      net - the OnlineNetwork
      ts - the TimeSpan
      fetchTimes - a Collection of pull date/times
      updateInterval - the fetch interval in seconds
      Returns:
      a Collection of NetworkOutage beans