Class DefaultAlertMessage

java.lang.Object
com.inductiveautomation.ignition.gateway.alert.DefaultAlertMessage
All Implemented Interfaces:
AlertMessage, Serializable

public class DefaultAlertMessage extends Object implements AlertMessage
A simple immutable implementation of AlertMessage
See Also:
  • Constructor Details

    • DefaultAlertMessage

      public DefaultAlertMessage()
    • DefaultAlertMessage

      public DefaultAlertMessage(Date timeStamp)
    • DefaultAlertMessage

      public DefaultAlertMessage(AlertMessage copy)
    • DefaultAlertMessage

      public DefaultAlertMessage(String system, String path, String stateName, AlertSeverity stateSeverity, Double value, Date timestamp, boolean register, boolean active, boolean cleared, boolean acknowledged, String user, String message, String displayPath, String notes, AlertNotificationMode notificationMode)
  • Method Details

    • getAlertFlags

      public int getAlertFlags()
      Description copied from interface: AlertMessage
      Returns the alert flags to determine what type of alert it is.
      • REGISTER - 0x00000001
      • ACTIVE - 0x00000010
      • CLEARED - 0x00000100
      • ACKNOWLEDGED - 0x00001000
      • DEREGISTER - 0x00010000
      • SUPPRESS_CLEAR_MSG - 0x00010000
      Specified by:
      getAlertFlags in interface AlertMessage
    • setAlertFlag

      public void setAlertFlag(int flag)
      Sets an alert flag to on status.
    • setAlertFlag

      public void setAlertFlag(int flag, boolean value)
      Sets an alert flag to on or off status depending on value.
    • getMessageSubject

      public String getMessageSubject()
      Description copied from interface: AlertMessage
      Returns the alerts custom subject, if any.
      Specified by:
      getMessageSubject in interface AlertMessage
    • setMessageSubject

      public void setMessageSubject(String value)
    • getMessage

      public String getMessage()
      Description copied from interface: AlertMessage
      Returns the alert's custom message, if any.
      Specified by:
      getMessage in interface AlertMessage
    • setMessage

      public void setMessage(String message)
    • getNotes

      public String getNotes()
      Description copied from interface: AlertMessage
      Get alert notes (extra information about the alert).
      Specified by:
      getNotes in interface AlertMessage
    • setNotes

      public void setNotes(String notes)
    • getPath

      public String getPath()
      Description copied from interface: AlertMessage
      Returns the path of the source, such as the path to a SQLTag, which should be reasonably unique. That is, there should not be another alert with the same path in the same SCADARail system. This path lets alert handlers correlate ACKS and CLEARS with their initial ALERTs
      Specified by:
      getPath in interface AlertMessage
    • setPath

      public void setPath(String path)
    • getDisplayPath

      public String getDisplayPath()
      Description copied from interface: AlertMessage
      Returns a user-configurable "friendly" path for the alert. Configured on the tag level (so will likely be used often along with state name).
      Specified by:
      getDisplayPath in interface AlertMessage
    • setDisplayPath

      public void setDisplayPath(String displayPath)
    • getStateName

      public String getStateName()
      Description copied from interface: AlertMessage
      Returns the name of the alert state that was triggered
      Specified by:
      getStateName in interface AlertMessage
    • setStateName

      public void setStateName(String stateName)
    • getStateSeverity

      public AlertSeverity getStateSeverity()
      Description copied from interface: AlertMessage
      Returns the severity of the alert state
      Specified by:
      getStateSeverity in interface AlertMessage
    • setStateSeverity

      public void setStateSeverity(AlertSeverity stateSeverity)
    • getSystem

      public String getSystem()
      Description copied from interface: AlertMessage
      Returns the name of the SCADARail system responsible for the alert
      Specified by:
      getSystem in interface AlertMessage
    • setSystem

      public void setSystem(String system)
    • getTimestamp

      public Date getTimestamp()
      Description copied from interface: AlertMessage
      Returns the originating timestamp for the message.
      Specified by:
      getTimestamp in interface AlertMessage
    • setTimestamp

      public void setTimestamp(Date timestamp)
    • getUser

      public String getUser()
      Description copied from interface: AlertMessage
      Returns a username associated with the message. Mostly used for Acknowledegments
      Specified by:
      getUser in interface AlertMessage
    • setUser

      public void setUser(String user)
    • getValue

      public Double getValue()
      Description copied from interface: AlertMessage
      Returns the value that caused this alert. May not be applicable for all message types
      Specified by:
      getValue in interface AlertMessage
    • setValue

      public void setValue(Double value)
    • getNotificationMode

      public AlertNotificationMode getNotificationMode()
      Description copied from interface: AlertMessage
      Returns the notification mode for the tag- when it wants notifications to occur.
      Specified by:
      getNotificationMode in interface AlertMessage
    • setNotificationMode

      public void setNotificationMode(AlertNotificationMode notificationMode)
    • isAcknowledged

      public boolean isAcknowledged()
      Description copied from interface: AlertMessage
      Returns whether or not the message is flagged as ACKNOWLEDGED
      Specified by:
      isAcknowledged in interface AlertMessage
    • isActive

      public boolean isActive()
      Description copied from interface: AlertMessage
      Returns whether or not the message is flagged as ACTIVE
      Specified by:
      isActive in interface AlertMessage
    • isCleared

      public boolean isCleared()
      Description copied from interface: AlertMessage
      Returns whether or not the message is flagged as CLEARED
      Specified by:
      isCleared in interface AlertMessage
    • isRegister

      public boolean isRegister()
      Description copied from interface: AlertMessage
      Returns whether or not the message is flagged as REGISTER
      Specified by:
      isRegister in interface AlertMessage
    • isDeregister

      public boolean isDeregister()
      Description copied from interface: AlertMessage
      Returns whether or not the message is flagged as DEREGISTER
      Specified by:
      isDeregister in interface AlertMessage
    • suppressClearMessage

      public boolean suppressClearMessage()
      Description copied from interface: AlertMessage
      Returns whether or not the message is flagged as SUPPRESS_CLEAR_MSG
      Specified by:
      suppressClearMessage in interface AlertMessage
    • isUpdate

      public boolean isUpdate()
      Specified by:
      isUpdate in interface AlertMessage
    • toString

      public String toString()
      Overrides:
      toString in class Object