Enum Class SecuritySeverity

java.lang.Object
java.lang.Enum<SecuritySeverity>
com.iizix.security.SecuritySeverity
All Implemented Interfaces:
Serializable, Comparable<SecuritySeverity>, Constable

public enum SecuritySeverity extends Enum<SecuritySeverity>
The severity of a security event of a client session or an application session (CC-SIGNIN-RECORDS-AND-SECURITY-LOG, order 556). Every event reaches the server log through ILog at the level of its severity; CRITICAL has no level of its own there and is logged SEVERE with its name in front of the text, so that a log filter on "CRITICAL" finds it.
Author:
Christopher Mindus
  • Enum Constant Details

    • INFO

      public static final SecuritySeverity INFO
      Something that happened as it should and is worth a record: a sign-in.
    • WARNING

      public static final SecuritySeverity WARNING
      Something refused or failed that may be an attempt: a sign-in refused, a second factor that failed.
    • SEVERE

      public static final SecuritySeverity SEVERE
      Something that changes the security of an account or the server: a policy change, a recovery code used.
    • CRITICAL

      public static final SecuritySeverity CRITICAL
      Something an administrator must look at now: the break-glass file used, a session taken over.
  • Method Details

    • values

      public static SecuritySeverity[] 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 SecuritySeverity 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
    • getLogLevel

      public int getLogLevel()
      Gets the ILog level the events of this severity are logged at.
      Returns:
      ILog.INFO, ILog.WARNING or ILog.SEVERE.
    • isAtLeast

      public boolean isAtLeast(SecuritySeverity other)
      Tells whether this severity is at least another one: CRITICAL is above SEVERE, above WARNING, above INFO.
      Parameters:
      other - The other severity.
      Returns:
      true when this one is the same or worse.
    • of

      public static SecuritySeverity of(int ordinal)
      Gets a severity from its ordinal as stored, tolerant of a value out of range.
      Parameters:
      ordinal - The ordinal.
      Returns:
      The severity; INFO for a value below zero, CRITICAL for one above the last.