java.lang.Object
de.iip_ecosphere.platform.transport.status.Alert

public class Alert extends Object
Represents a generic platform alert.
Author:
Holger Eichelberger, SSE, Matjaž Cerkvenik (original author DEvent, see monitoring.prometheus).
  • Field Details

    • ALERT_STREAM

      public static final String ALERT_STREAM
      See Also:
    • uid

      private String uid
    • correlationId

      private String correlationId
    • timestamp

      private long timestamp
    • firstTimestamp

      private long firstTimestamp
    • lastTimestamp

      private long lastTimestamp
    • clearTimestamp

      private long clearTimestamp
    • source

      private String source
    • alertname

      private String alertname
    • info

      private String info
    • instance

      private String instance
    • severity

      private String severity
    • priority

      private String priority
    • tags

      private String tags
    • description

      private String description
    • eventType

      private String eventType
    • probableCause

      private String probableCause
    • currentValue

      private String currentValue
    • url

      private String url
    • status

      private String status
    • ruleExpression

      private String ruleExpression
    • ruleTimeLimit

      private String ruleTimeLimit
  • Constructor Details

    • Alert

      public Alert()
  • Method Details

    • getUid

      public String getUid()
      Returns the unique ID of notification.
      Returns:
      the UID (may be null or empty)
    • setUid

      public void setUid(String uid)
      Defines the unique ID of notification.
      Parameters:
      uid - the UID
    • getCorrelationId

      public String getCorrelationId()
      Returns the correlation ID identifying the same type of events.
      Returns:
      the correlation ID (may be null or empty)
    • setCorrelationId

      public void setCorrelationId(String correlationId)
      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

      public String getSource()
      Returns source (id, IP) who caused/sent the notification.
      Returns:
      the source id/IP
    • setSource

      public void setSource(String source)
      Changes the source (id, IP) who caused/sent the notification.
      Parameters:
      source - the source id/IP
    • getInfo

      public String getInfo()
      Returns information about the alert.
      Returns:
      information, may be null or empty
    • setInfo

      public void setInfo(String info)
      Changes information about the alert.
      Parameters:
      info - information, may be null or empty
    • getAlertname

      public String getAlertname()
      Returns the name of the alert.
      Returns:
      the name, may be null or empty
    • setAlertname

      public void setAlertname(String alertname)
      Changes the name of the alert.
      Parameters:
      alertname - the name, may be null or empty
    • getInstance

      public String getInstance()
      Returns source (id, IP) who caused/sent the notification.
      Returns:
      the source id/IP, may be null or empty
    • setInstance

      public void setInstance(String instance)
      Changes the instance (id, IP) who caused/sent the notification. Depending on the event, may be same as getSource()
      Parameters:
      instance - the instance id/IP
    • getSeverity

      public String getSeverity()
      Returns the severity of the notification. [currently no enum here]
      Returns:
      the severity, may be null or empty
    • setSeverity

      public void setSeverity(String severity)
      Defines the severity of the notification. [currently no enum here]
      Parameters:
      severity - the severity
    • getPriority

      public String getPriority()
      Returns the urgency of the notification.
      Returns:
      the urgency, may be null or empty
    • setPriority

      public void setPriority(String priority)
      Changes the urgency of the notification.
      Parameters:
      priority - the urgency
    • getTags

      public String getTags()
      Returns a comma-separated list of custom tags (labels).
      Returns:
      the tags, may be null or empty
    • setTags

      public void setTags(String tags)
      Defines a comma-separated list of custom tags (labels).
      Parameters:
      tags - the tags
    • getDescription

      public String getDescription()
      Returns an additional description of notification.
      Returns:
      the description, may be null or empty
    • setDescription

      public void setDescription(String description)
      Changes the additional description of notification.
      Parameters:
      description - the description
    • getStatus

      public String getStatus()
      Returns the status of the alert: firing or resolved.
      Returns:
      the status
    • setStatus

      public void setStatus(String status)
      Changes the status of the alert: firing or resolved.
      Parameters:
      status - the status
    • getEventType

      public String getEventType()
      Returns the event type according to ITU X.733.
      Returns:
      the event type, may be null or empty
    • setEventType

      public void setEventType(String eventType)
      Defines the event type according to ITU X.733.
      Parameters:
      eventType - the event type
    • getProbableCause

      public String getProbableCause()
      Returns the probable cause according to ITU X.733.
      Returns:
      the probable cause
    • setProbableCause

      public void setProbableCause(String probableCause)
      Defines the probable cause according to ITU X.733.
      Parameters:
      probableCause - the probable cause
    • getCurrentValue

      public String getCurrentValue()
      Returns the current (metric) value causing the alert.
      Returns:
      the current value
    • setCurrentValue

      public void setCurrentValue(String currentValue)
      Returns the current (metric) value causing the alert.
      Parameters:
      currentValue - the current value
    • getUrl

      public String getUrl()
      Returns URL of somewhere associated to the alert, e.g. grafana.
      Returns:
      the URL, may be null or empty
    • setUrl

      public void setUrl(String url)
      Defines URL of somewhere associated to the alert, e.g. grafana.
      Parameters:
      url - the URL
    • getRuleExpression

      public String getRuleExpression()
      Returns a rule that caused this notification.
      Returns:
      the rule expression, may be null or empty
    • setRuleExpression

      public void setRuleExpression(String ruleExpression)
      Defines a rule that caused this notification.
      Parameters:
      ruleExpression - the rule expression
    • getRuleTimeLimit

      public String getRuleTimeLimit()
      Returns a time limit set on the rule.
      Returns:
      the time limit, may be null or empty
    • setRuleTimeLimit

      public void setRuleTimeLimit(String ruleTimeLimit)
      Changes the time limit set on the rule.
      Parameters:
      ruleTimeLimit - the time limit, may be null or empty
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • send

      public void send(TransportConnector conn) throws IOException
      Sends this message to the given connector on #ALERT STREAM. [convenience]
      Parameters:
      conn - the connector
      Throws:
      IOException - if sending fails