Enum Class SlaWindow

java.lang.Object
java.lang.Enum<SlaWindow>
com.nmontytskyi.monitoring.server.sla.SlaWindow
All Implemented Interfaces:
Serializable, Comparable<SlaWindow>, Constable

public enum SlaWindow extends Enum<SlaWindow>
Defines the time window over which an SLA report is calculated.

Each constant encapsulates the Duration that is subtracted from the current timestamp to obtain the start of the reporting window. Used as a request parameter in GET /api/services/{id}/sla?window=.

  • Enum Constant Details

    • HOUR

      public static final SlaWindow HOUR
      Last 1 hour.
    • DAY

      public static final SlaWindow DAY
      Last 24 hours.
    • WEEK

      public static final SlaWindow WEEK
      Last 7 days.
    • MONTH

      public static final SlaWindow MONTH
      Last 30 days.
  • Method Details

    • values

      public static SlaWindow[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SlaWindow valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getDuration

      public Duration getDuration()
      Returns the Duration associated with this window.
      Returns:
      the duration from "now" back to the start of the window