Class NotificationSignal

java.lang.Object
com.kingsrook.qqq.backend.core.alerts.NotificationSignal
All Implemented Interfaces:
Serializable

public class NotificationSignal extends Object implements Serializable
One user notification from a producer, passed to QAlerts.notify: "tell these people this". Unlike an AlertSignal it is not a problem to fix; it is a message for a person's bell (and, by their preference, email): a job that failed or finished, a share, a security notice, a release note. title and audience are required. Bounds: at most MAX_ATTRIBUTES attributes (extras are ignored).
See Also:
  • Field Details

  • Constructor Details

    • NotificationSignal

      public NotificationSignal()
      Constructor
    • NotificationSignal

      public NotificationSignal(String title)
      Constructor
  • Method Details

    • getTitle

      public String getTitle()
      Getter for title
    • setTitle

      public void setTitle(String title)
      Setter for title
    • withTitle

      public NotificationSignal withTitle(String title)
      Fluent setter for title (the headline, plain text; required)
    • getBody

      public String getBody()
      Getter for body
    • setBody

      public void setBody(String body)
      Setter for body
    • withBody

      public NotificationSignal withBody(String body)
      Fluent setter for body (the message, markdown (rendered safely, no raw HTML))
    • getSeverity

      public NotificationSeverity getSeverity()
      Getter for severity
    • setSeverity

      public void setSeverity(NotificationSeverity severity)
      Setter for severity
    • withSeverity

      public NotificationSignal withSeverity(NotificationSeverity severity)
      Fluent setter for severity (default INFO)
    • getCategory

      public NotificationCategory getCategory()
      Getter for category
    • setCategory

      public void setCategory(NotificationCategory category)
      Setter for category
    • withCategory

      public NotificationSignal withCategory(NotificationCategory category)
      Fluent setter for category (default SYSTEM)
    • getSourceName

      public String getSourceName()
      Getter for sourceName
    • setSourceName

      public void setSourceName(String sourceName)
      Setter for sourceName
    • withSourceName

      public NotificationSignal withSourceName(String sourceName)
      Fluent setter for sourceName (who emitted it: a qbit or app name)
    • getSourceKey

      public String getSourceKey()
      Getter for sourceKey
    • setSourceKey

      public void setSourceKey(String sourceKey)
      Setter for sourceKey
    • withSourceKey

      public NotificationSignal withSourceKey(String sourceKey)
      Fluent setter for sourceKey (dedup key: a second notify with the same key and audience updates the first)
    • getSourceTableName

      public String getSourceTableName()
      Getter for sourceTableName
    • setSourceTableName

      public void setSourceTableName(String sourceTableName)
      Setter for sourceTableName
    • withSourceTableName

      public NotificationSignal withSourceTableName(String sourceTableName)
      Fluent setter for sourceTableName (the table of the record it is about)
    • getSourceRecordId

      public String getSourceRecordId()
      Getter for sourceRecordId
    • setSourceRecordId

      public void setSourceRecordId(String sourceRecordId)
      Setter for sourceRecordId
    • withSourceRecordId

      public NotificationSignal withSourceRecordId(String sourceRecordId)
      Fluent setter for sourceRecordId (the id of the record it is about)
    • getLink

      public AlertLink getLink()
      Getter for link
    • setLink

      public void setLink(AlertLink link)
      Setter for link
    • withLink

      public NotificationSignal withLink(AlertLink link)
      Fluent setter for link (a deep link to where the user acts on it)
    • getAudience

      public NotificationAudience getAudience()
      Getter for audience
    • setAudience

      public void setAudience(NotificationAudience audience)
      Setter for audience
    • withAudience

      public NotificationSignal withAudience(NotificationAudience audience)
      Fluent setter for audience (who it is for; required)
    • getPublishAt

      public Instant getPublishAt()
      Getter for publishAt
    • setPublishAt

      public void setPublishAt(Instant publishAt)
      Setter for publishAt
    • withPublishAt

      public NotificationSignal withPublishAt(Instant publishAt)
      Fluent setter for publishAt (not shown before this time)
    • getExpireAt

      public Instant getExpireAt()
      Getter for expireAt
    • setExpireAt

      public void setExpireAt(Instant expireAt)
      Setter for expireAt
    • withExpireAt

      public NotificationSignal withExpireAt(Instant expireAt)
      Fluent setter for expireAt (hidden after this time)
    • getSticky

      public Boolean getSticky()
      Getter for sticky
    • setSticky

      public void setSticky(Boolean sticky)
      Setter for sticky
    • withSticky

      public NotificationSignal withSticky(Boolean sticky)
      Fluent setter for sticky (a banner until dismissed (meant for CRITICAL))
    • getAttributes

      public Map<String,String> getAttributes()
      Getter for attributes
    • setAttributes

      public void setAttributes(Map<String,String> attributes)
      Setter for attributes
    • withAttribute

      public NotificationSignal withAttribute(String key, String value)
      Add a routing label (not displayed by default). At most MAX_ATTRIBUTES keys; a new key beyond that is ignored (replacing an existing key is fine).
    • getOccurredAt

      public Instant getOccurredAt()
      Getter for occurredAt
    • setOccurredAt

      public void setOccurredAt(Instant occurredAt)
      Setter for occurredAt
    • withOccurredAt

      public NotificationSignal withOccurredAt(Instant occurredAt)
      Fluent setter for occurredAt (default: when QAlerts.notify is called)