Class SystemMessage
java.lang.Object
ecmwf.common.database.DataBaseObject
ecmwf.common.database.SystemMessage
- All Implemented Interfaces:
Serializable, Cloneable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSeverity level: danger, red banner.static final StringSeverity level: informational, blue banner.static final StringSeverity level: warning, orange banner (default).protected BigDecimalCreation timestamp (millis since epoch).protected StringLogin of the admin who created/last saved this message.protected BigDecimalEnd of the display window (millis since epoch).protected LongAuto-increment primary key.protected StringThe severity level: "info", "warning" or "danger".protected StringThe message text, shown as-is (plain text) in the banner.protected BigDecimalStart of the display window (millis since epoch).Fields inherited from class DataBaseObject
collectionSize, TAG_ACROSS_MULTIPLE_LINES, TAG_END_OF_LINES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonglongFormats 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).longgetId()getLevel()longinthashCode()booleanisActiveAt(long now) Checks if this message is currently active, i.e. the given time falls within its start/end window (inclusive).voidsetCreatedAt(long time) voidsetCreatedBy(String createdBy) voidsetEndTime(long time) voidsetId(long id) voidvoidsetMessage(String message) voidsetStartTime(long time) Methods inherited from class DataBaseObject
bigDecimalToTimestamp, clone, compare, compare, getCollectionSize, integerToInt, integerToString, removeHiddenOptions, setCollectionSize, strim, stringToInteger, stringToLong, stringToString, timestampToBigDecimal, toString, toString, toString, toString
-
Field Details
-
LEVEL_INFO
-
LEVEL_WARNING
Severity level: warning, orange banner (default).- See Also:
-
LEVEL_DANGER
-
SYM_ID
Auto-increment primary key. -
SYM_MESSAGE
The message text, shown as-is (plain text) in the banner. -
SYM_LEVEL
The severity level: "info", "warning" or "danger". -
SYM_START_TIME
Start of the display window (millis since epoch). -
SYM_END_TIME
End of the display window (millis since epoch). -
SYM_CREATED_BY
Login of the admin who created/last saved this message. -
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
-
setMessage
-
getLevel
-
setLevel
-
getStartTime
public long getStartTime() -
setStartTime
public void setStartTime(long time) -
getEndTime
public long getEndTime() -
setEndTime
public void setEndTime(long time) -
getCreatedBy
-
setCreatedBy
-
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
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
-
hashCode
-