Class SystemMessage

java.lang.Object
ecmwf.common.database.DataBaseObject
ecmwf.common.database.SystemMessage
All Implemented Interfaces:
Serializable, Cloneable

public class SystemMessage extends DataBaseObject
The Class SystemMessage.
See Also:
  • Field Details

    • LEVEL_INFO

      public static final String LEVEL_INFO
      Severity level: informational, blue banner.
      See Also:
    • LEVEL_WARNING

      public static final String LEVEL_WARNING
      Severity level: warning, orange banner (default).
      See Also:
    • LEVEL_DANGER

      public static final String LEVEL_DANGER
      Severity level: danger, red banner.
      See Also:
    • SYM_ID

      protected Long SYM_ID
      Auto-increment primary key.
    • SYM_MESSAGE

      protected String SYM_MESSAGE
      The message text, shown as-is (plain text) in the banner.
    • SYM_LEVEL

      protected String SYM_LEVEL
      The severity level: "info", "warning" or "danger".
    • SYM_START_TIME

      protected BigDecimal SYM_START_TIME
      Start of the display window (millis since epoch).
    • SYM_END_TIME

      protected BigDecimal SYM_END_TIME
      End of the display window (millis since epoch).
    • SYM_CREATED_BY

      protected String SYM_CREATED_BY
      Login of the admin who created/last saved this message.
    • SYM_CREATED_AT

      protected BigDecimal SYM_CREATED_AT
      Creation timestamp (millis since epoch).
  • Constructor Details

    • SystemMessage

      public SystemMessage()
      Instantiates a new SystemMessage.
  • Method Details

    • getId

      public long getId()
    • setId

      public void setId(long id)
    • getMessage

      public String getMessage()
    • setMessage

      public void setMessage(String message)
    • getLevel

      public String getLevel()
    • setLevel

      public void setLevel(String level)
    • getStartTime

      public long getStartTime()
    • setStartTime

      public void setStartTime(long time)
    • getEndTime

      public long getEndTime()
    • setEndTime

      public void setEndTime(long time)
    • getCreatedBy

      public String getCreatedBy()
    • setCreatedBy

      public void setCreatedBy(String createdBy)
    • getCreatedAt

      public long getCreatedAt()
    • setCreatedAt

      public void setCreatedAt(long time)
    • isActiveAt

      public boolean isActiveAt(long now)
      Checks if this message is currently active, i.e. the given time falls within its start/end window (inclusive).
      Parameters:
      now - the current time, in millis since epoch
      Returns:
      true, if this message should currently be displayed
    • getFormattedTimeframe

      public String getFormattedTimeframe()
      Formats the start/end window as a human-readable UTC timeframe, e.g. "24 Sep 2026, 12:30 - 13:30 UTC" (same day) or "24 Sep 2026, 12:30 - 25 Sep 2026, 06:00 UTC" (spanning multiple days). Intended to be shown alongside the free-text message so the reason for the outage does not need to also repeat the schedule.
      Returns:
      the formatted timeframe, e.g. "24 Sep 2026, 12:30 - 13:30 UTC"
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object