Class Alert
java.lang.Object
de.iip_ecosphere.platform.transport.status.Alert
Represents a generic platform alert.
- Author:
- Holger Eichelberger, SSE, Matjaž Cerkvenik (original author DEvent, see monitoring.prometheus).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate Stringprivate longprivate Stringprivate Stringprivate Stringprivate Stringprivate longprivate Stringprivate Stringprivate longprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate longprivate Stringprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the alert.longReturns the timestamp when the alert was cleared.Returns the correlation ID identifying the same type of events.Returns the current (metric) value causing the alert.Returns an additional description of notification.Returns the event type according to ITU X.733.longReturns the timestamp of the first occurrence.getInfo()Returns information about the alert.Returns source (id, IP) who caused/sent the notification.longReturns the timestamp of the last occurrence.Returns the urgency of the notification.Returns the probable cause according to ITU X.733.Returns a rule that caused this notification.Returns a time limit set on the rule.Returns the severity of the notification.Returns source (id, IP) who caused/sent the notification.Returns the status of the alert: firing or resolved.getTags()Returns a comma-separated list of custom tags (labels).longReturns the timestamp of the first occurrence.getUid()Returns the unique ID of notification.getUrl()Returns URL of somewhere associated to the alert, e.g.voidsend(TransportConnector conn) Sends this message to the given connector on#ALERT STREAM.voidsetAlertname(String alertname) Changes the name of the alert.voidsetClearTimestamp(long clearTimestamp) Changes the timestamp when the alert was cleared.voidsetCorrelationId(String correlationId) Defines the correlation ID identifying the same type of events.voidsetCurrentValue(String currentValue) Returns the current (metric) value causing the alert.voidsetDescription(String description) Changes the additional description of notification.voidsetEventType(String eventType) Defines the event type according to ITU X.733.voidsetFirstTimestamp(long firstTimestamp) Changes the timestamp of the first occurrence.voidChanges information about the alert.voidsetInstance(String instance) Changes the instance (id, IP) who caused/sent the notification.voidsetLastTimestamp(long lastTimestamp) Changes the timestamp of the last occurrence.voidsetPriority(String priority) Changes the urgency of the notification.voidsetProbableCause(String probableCause) Defines the probable cause according to ITU X.733.voidsetRuleExpression(String ruleExpression) Defines a rule that caused this notification.voidsetRuleTimeLimit(String ruleTimeLimit) Changes the time limit set on the rule.voidsetSeverity(String severity) Defines the severity of the notification.voidChanges the source (id, IP) who caused/sent the notification.voidChanges the status of the alert: firing or resolved.voidDefines a comma-separated list of custom tags (labels).voidsetTimestamp(long timestamp) Defines the timestamp of the first occurrence.voidDefines the unique ID of notification.voidDefines URL of somewhere associated to the alert, e.g.toString()
-
Field Details
-
ALERT_STREAM
- See Also:
-
uid
-
correlationId
-
timestamp
private long timestamp -
firstTimestamp
private long firstTimestamp -
lastTimestamp
private long lastTimestamp -
clearTimestamp
private long clearTimestamp -
source
-
alertname
-
info
-
instance
-
severity
-
priority
-
tags
-
description
-
eventType
-
probableCause
-
currentValue
-
url
-
status
-
ruleExpression
-
ruleTimeLimit
-
-
Constructor Details
-
Alert
public Alert()
-
-
Method Details
-
getUid
Returns the unique ID of notification.- Returns:
- the UID (may be null or empty)
-
setUid
Defines the unique ID of notification.- Parameters:
uid- the UID
-
getCorrelationId
Returns the correlation ID identifying the same type of events.- Returns:
- the correlation ID (may be null or empty)
-
setCorrelationId
Defines the correlation ID identifying the same type of events.- Parameters:
correlationId- the correlation ID
-
getTimestamp
public long getTimestamp()Returns the timestamp of the first occurrence.- Returns:
- the timestamp
-
setTimestamp
public void setTimestamp(long timestamp) Defines the timestamp of the first occurrence.- Parameters:
timestamp- timestamp
-
getFirstTimestamp
public long getFirstTimestamp()Returns the timestamp of the first occurrence.- Returns:
- the timestamp of the first occurrence
-
setFirstTimestamp
public void setFirstTimestamp(long firstTimestamp) Changes the timestamp of the first occurrence.- Parameters:
firstTimestamp- the timestamp of the first occurrence
-
getLastTimestamp
public long getLastTimestamp()Returns the timestamp of the last occurrence.- Returns:
- the timestamp of the last occurrence
-
setLastTimestamp
public void setLastTimestamp(long lastTimestamp) Changes the timestamp of the last occurrence.- Parameters:
lastTimestamp- the timestamp of the last occurrence
-
getClearTimestamp
public long getClearTimestamp()Returns the timestamp when the alert was cleared.- Returns:
- the timestamp
-
setClearTimestamp
public void setClearTimestamp(long clearTimestamp) Changes the timestamp when the alert was cleared.- Parameters:
clearTimestamp- the timestamp
-
getSource
Returns source (id, IP) who caused/sent the notification.- Returns:
- the source id/IP
-
setSource
Changes the source (id, IP) who caused/sent the notification.- Parameters:
source- the source id/IP
-
getInfo
Returns information about the alert.- Returns:
- information, may be null or empty
-
setInfo
Changes information about the alert.- Parameters:
info- information, may be null or empty
-
getAlertname
Returns the name of the alert.- Returns:
- the name, may be null or empty
-
setAlertname
Changes the name of the alert.- Parameters:
alertname- the name, may be null or empty
-
getInstance
Returns source (id, IP) who caused/sent the notification.- Returns:
- the source id/IP, may be null or empty
-
setInstance
Changes the instance (id, IP) who caused/sent the notification. Depending on the event, may be same asgetSource()- Parameters:
instance- the instance id/IP
-
getSeverity
Returns the severity of the notification. [currently no enum here]- Returns:
- the severity, may be null or empty
-
setSeverity
Defines the severity of the notification. [currently no enum here]- Parameters:
severity- the severity
-
getPriority
Returns the urgency of the notification.- Returns:
- the urgency, may be null or empty
-
setPriority
Changes the urgency of the notification.- Parameters:
priority- the urgency
-
getTags
Returns a comma-separated list of custom tags (labels).- Returns:
- the tags, may be null or empty
-
setTags
Defines a comma-separated list of custom tags (labels).- Parameters:
tags- the tags
-
getDescription
Returns an additional description of notification.- Returns:
- the description, may be null or empty
-
setDescription
Changes the additional description of notification.- Parameters:
description- the description
-
getStatus
Returns the status of the alert: firing or resolved.- Returns:
- the status
-
setStatus
Changes the status of the alert: firing or resolved.- Parameters:
status- the status
-
getEventType
Returns the event type according to ITU X.733.- Returns:
- the event type, may be null or empty
-
setEventType
Defines the event type according to ITU X.733.- Parameters:
eventType- the event type
-
getProbableCause
Returns the probable cause according to ITU X.733.- Returns:
- the probable cause
-
setProbableCause
Defines the probable cause according to ITU X.733.- Parameters:
probableCause- the probable cause
-
getCurrentValue
Returns the current (metric) value causing the alert.- Returns:
- the current value
-
setCurrentValue
Returns the current (metric) value causing the alert.- Parameters:
currentValue- the current value
-
getUrl
Returns URL of somewhere associated to the alert, e.g. grafana.- Returns:
- the URL, may be null or empty
-
setUrl
Defines URL of somewhere associated to the alert, e.g. grafana.- Parameters:
url- the URL
-
getRuleExpression
Returns a rule that caused this notification.- Returns:
- the rule expression, may be null or empty
-
setRuleExpression
Defines a rule that caused this notification.- Parameters:
ruleExpression- the rule expression
-
getRuleTimeLimit
Returns a time limit set on the rule.- Returns:
- the time limit, may be null or empty
-
setRuleTimeLimit
Changes the time limit set on the rule.- Parameters:
ruleTimeLimit- the time limit, may be null or empty
-
toString
-
send
Sends this message to the given connector on#ALERT STREAM. [convenience]- Parameters:
conn- the connector- Throws:
IOException- if sending fails
-