Class DefaultAlertMessage
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.alert.DefaultAlertMessage
-
- All Implemented Interfaces:
AlertMessage
,java.io.Serializable
public class DefaultAlertMessage extends java.lang.Object implements AlertMessage
A simple immutable implementation of AlertMessage- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.inductiveautomation.ignition.common.alert.AlertMessage
ACKNOWLEDGED, ACTIVE, CLEARED, DEREGISTER, INFO_UPDATE, REGISTER, SUPPRESS_CLEAR_MSG
-
-
Constructor Summary
Constructors Constructor Description DefaultAlertMessage()
DefaultAlertMessage(AlertMessage copy)
DefaultAlertMessage(java.lang.String system, java.lang.String path, java.lang.String stateName, AlertSeverity stateSeverity, java.lang.Double value, java.util.Date timestamp, boolean register, boolean active, boolean cleared, boolean acknowledged, java.lang.String user, java.lang.String message, java.lang.String displayPath, java.lang.String notes, AlertNotificationMode notificationMode)
DefaultAlertMessage(java.util.Date timeStamp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAlertFlags()
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 - 0x00010000java.lang.String
getDisplayPath()
Returns a user-configurable "friendly" path for the alert.java.lang.String
getMessage()
Returns the alert's custom message, if any.java.lang.String
getMessageSubject()
Returns the alerts custom subject, if any.java.lang.String
getNotes()
Get alert notes (extra information about the alert).AlertNotificationMode
getNotificationMode()
Returns the notification mode for the tag- when it wants notifications to occur.java.lang.String
getPath()
Returns the path of the source, such as the path to a SQLTag, which should be reasonably unique.java.lang.String
getStateName()
Returns the name of the alert state that was triggeredAlertSeverity
getStateSeverity()
Returns the severity of the alert statejava.lang.String
getSystem()
Returns the name of the SCADARail system responsible for the alertjava.util.Date
getTimestamp()
Returns the originating timestamp for the message.java.lang.String
getUser()
Returns a username associated with the message.java.lang.Double
getValue()
Returns the value that caused this alert.boolean
isAcknowledged()
Returns whether or not the message is flagged as ACKNOWLEDGEDboolean
isActive()
Returns whether or not the message is flagged as ACTIVEboolean
isCleared()
Returns whether or not the message is flagged as CLEAREDboolean
isDeregister()
Returns whether or not the message is flagged as DEREGISTERboolean
isRegister()
Returns whether or not the message is flagged as REGISTERboolean
isUpdate()
void
setAlertFlag(int flag)
Sets an alert flag to on status.void
setAlertFlag(int flag, boolean value)
Sets an alert flag to on or off status depending on value.void
setDisplayPath(java.lang.String displayPath)
void
setMessage(java.lang.String message)
void
setMessageSubject(java.lang.String value)
void
setNotes(java.lang.String notes)
void
setNotificationMode(AlertNotificationMode notificationMode)
void
setPath(java.lang.String path)
void
setStateName(java.lang.String stateName)
void
setStateSeverity(AlertSeverity stateSeverity)
void
setSystem(java.lang.String system)
void
setTimestamp(java.util.Date timestamp)
void
setUser(java.lang.String user)
void
setValue(java.lang.Double value)
boolean
suppressClearMessage()
Returns whether or not the message is flagged as SUPPRESS_CLEAR_MSGjava.lang.String
toString()
-
-
-
Constructor Detail
-
DefaultAlertMessage
public DefaultAlertMessage()
-
DefaultAlertMessage
public DefaultAlertMessage(java.util.Date timeStamp)
-
DefaultAlertMessage
public DefaultAlertMessage(AlertMessage copy)
-
DefaultAlertMessage
public DefaultAlertMessage(java.lang.String system, java.lang.String path, java.lang.String stateName, AlertSeverity stateSeverity, java.lang.Double value, java.util.Date timestamp, boolean register, boolean active, boolean cleared, boolean acknowledged, java.lang.String user, java.lang.String message, java.lang.String displayPath, java.lang.String notes, AlertNotificationMode notificationMode)
-
-
Method Detail
-
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 interfaceAlertMessage
-
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 java.lang.String getMessageSubject()
Description copied from interface:AlertMessage
Returns the alerts custom subject, if any.- Specified by:
getMessageSubject
in interfaceAlertMessage
-
setMessageSubject
public void setMessageSubject(java.lang.String value)
-
getMessage
public java.lang.String getMessage()
Description copied from interface:AlertMessage
Returns the alert's custom message, if any.- Specified by:
getMessage
in interfaceAlertMessage
-
setMessage
public void setMessage(java.lang.String message)
-
getNotes
public java.lang.String getNotes()
Description copied from interface:AlertMessage
Get alert notes (extra information about the alert).- Specified by:
getNotes
in interfaceAlertMessage
-
setNotes
public void setNotes(java.lang.String notes)
-
getPath
public java.lang.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 interfaceAlertMessage
-
setPath
public void setPath(java.lang.String path)
-
getDisplayPath
public java.lang.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 interfaceAlertMessage
-
setDisplayPath
public void setDisplayPath(java.lang.String displayPath)
-
getStateName
public java.lang.String getStateName()
Description copied from interface:AlertMessage
Returns the name of the alert state that was triggered- Specified by:
getStateName
in interfaceAlertMessage
-
setStateName
public void setStateName(java.lang.String stateName)
-
getStateSeverity
public AlertSeverity getStateSeverity()
Description copied from interface:AlertMessage
Returns the severity of the alert state- Specified by:
getStateSeverity
in interfaceAlertMessage
-
setStateSeverity
public void setStateSeverity(AlertSeverity stateSeverity)
-
getSystem
public java.lang.String getSystem()
Description copied from interface:AlertMessage
Returns the name of the SCADARail system responsible for the alert- Specified by:
getSystem
in interfaceAlertMessage
-
setSystem
public void setSystem(java.lang.String system)
-
getTimestamp
public java.util.Date getTimestamp()
Description copied from interface:AlertMessage
Returns the originating timestamp for the message.- Specified by:
getTimestamp
in interfaceAlertMessage
-
setTimestamp
public void setTimestamp(java.util.Date timestamp)
-
getUser
public java.lang.String getUser()
Description copied from interface:AlertMessage
Returns a username associated with the message. Mostly used for Acknowledegments- Specified by:
getUser
in interfaceAlertMessage
-
setUser
public void setUser(java.lang.String user)
-
getValue
public java.lang.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 interfaceAlertMessage
-
setValue
public void setValue(java.lang.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 interfaceAlertMessage
-
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 interfaceAlertMessage
-
isActive
public boolean isActive()
Description copied from interface:AlertMessage
Returns whether or not the message is flagged as ACTIVE- Specified by:
isActive
in interfaceAlertMessage
-
isCleared
public boolean isCleared()
Description copied from interface:AlertMessage
Returns whether or not the message is flagged as CLEARED- Specified by:
isCleared
in interfaceAlertMessage
-
isRegister
public boolean isRegister()
Description copied from interface:AlertMessage
Returns whether or not the message is flagged as REGISTER- Specified by:
isRegister
in interfaceAlertMessage
-
isDeregister
public boolean isDeregister()
Description copied from interface:AlertMessage
Returns whether or not the message is flagged as DEREGISTER- Specified by:
isDeregister
in interfaceAlertMessage
-
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 interfaceAlertMessage
-
isUpdate
public boolean isUpdate()
- Specified by:
isUpdate
in interfaceAlertMessage
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-