Class BasicAlarmEvent
- java.lang.Object
-
- com.inductiveautomation.ignition.common.config.BasicPropertySet
-
- com.inductiveautomation.ignition.common.alarming.BasicAlarmEvent
-
- All Implemented Interfaces:
AlarmEvent
,Countable
,Extendable<PropertySet>
,Mergable<PropertySet>
,MutablePropertyValueSource
,ObservablePropertySet
,PropertySet
,PropertyValueSource
,java.io.Serializable
,java.lang.Iterable<PropertyValue>
public class BasicAlarmEvent extends BasicPropertySet implements AlarmEvent
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.inductiveautomation.ignition.common.config.BasicPropertySet
BasicPropertySet.Builder
-
-
Field Summary
-
Fields inherited from interface com.inductiveautomation.ignition.common.config.PropertySet
EMPTY
-
-
Constructor Summary
Constructors Constructor Description BasicAlarmEvent(QualifiedPath source, java.lang.String displayPath, AlarmPriority priority)
BasicAlarmEvent(QualifiedPath source, java.lang.String displayPath, AlarmPriority priority, java.lang.String notes)
BasicAlarmEvent(java.util.UUID id, QualifiedPath source, StringPath displayPath, AlarmPriority priority, java.lang.String notes)
BasicAlarmEvent(java.util.UUID id, QualifiedPath source, java.lang.String displayPath, AlarmPriority priority)
BasicAlarmEvent(java.util.UUID id, QualifiedPath source, java.lang.String displayPath, AlarmPriority priority, java.lang.String notes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acknowledge(EventData ackData)
void
active(EventData activeData)
void
clear(EventData clearData)
boolean
contains(Property<?> prop)
boolean
equals(java.lang.Object obj)
<T> T
get(Property<T> prop)
Retrieves the value of the property, or null if this set doesn't contain that property.protected <T> T
get(Property<T> prop, boolean retDefault)
EventData
getAckData()
EventData
getActiveData()
EventData
getClearedData()
StringPath
getDisplayPath()
java.lang.String
getDisplayPathOrSource()
java.util.UUID
getId()
The unique id for this event.java.lang.String
getLabel()
Returns the "Label" property, or "Name" if not defined.AlarmStateTransition
getLastEventState()
Returns the most recent transition, or if this event represents a single state, the particular state that it represents.java.lang.String
getName()
java.lang.String
getNotes()
<T> T
getOrDefault(Property<T> prop)
Searches the various event datas for the specified property.AlarmPriority
getPriority()
Returns the priority of the alarm event.QualifiedPath
getSource()
The path to the alarm that generated this event.AlarmState
getState()
Returns the current state, as an enum.boolean
isAcked()
boolean
isCleared()
boolean
isShelved()
Returns whether this is event is currently shelved, if the ShelfExpiration property is set, or whether the event was shelved, for journaled events, base on whether the IsShelved property is set.java.lang.String
toString()
-
Methods inherited from class com.inductiveautomation.ignition.common.config.BasicPropertySet
addPropertyChangeListener, addPropertyChangeListener, change, coerceValue, firePropertyChange, getCount, getExtension, getOrElse, getProperties, getRaw, getRawValueMap, getValues, isExtended, isInherited, iterator, of, remove, removePropertyChangeListener, removePropertyChangeListener, set, set, setDirect, setImpl, setRawValueMap
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.common.config.MutablePropertyValueSource
merge, remove, set, set
-
Methods inherited from interface com.inductiveautomation.ignition.common.config.PropertySet
extend, getExtension, isExtended, isInherited, newDefaultInstance, newExtension
-
Methods inherited from interface com.inductiveautomation.ignition.common.config.PropertyValueSource
getNonNull, getNonNull, getOrElse, getProperties, getValues
-
-
-
-
Constructor Detail
-
BasicAlarmEvent
public BasicAlarmEvent(QualifiedPath source, java.lang.String displayPath, AlarmPriority priority)
-
BasicAlarmEvent
public BasicAlarmEvent(QualifiedPath source, java.lang.String displayPath, AlarmPriority priority, java.lang.String notes)
-
BasicAlarmEvent
public BasicAlarmEvent(java.util.UUID id, QualifiedPath source, java.lang.String displayPath, AlarmPriority priority)
-
BasicAlarmEvent
public BasicAlarmEvent(java.util.UUID id, QualifiedPath source, java.lang.String displayPath, AlarmPriority priority, java.lang.String notes)
-
BasicAlarmEvent
public BasicAlarmEvent(java.util.UUID id, QualifiedPath source, StringPath displayPath, AlarmPriority priority, java.lang.String notes)
-
-
Method Detail
-
getId
public java.util.UUID getId()
The unique id for this event. Generated when the alarm is first generated, and then maintained for the life of the alarm event cycle.- Specified by:
getId
in interfaceAlarmEvent
-
getSource
public QualifiedPath getSource()
The path to the alarm that generated this event.- Specified by:
getSource
in interfaceAlarmEvent
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceAlarmEvent
-
getPriority
public AlarmPriority getPriority()
Returns the priority of the alarm event.- Specified by:
getPriority
in interfaceAlarmEvent
-
getDisplayPath
public StringPath getDisplayPath()
- Specified by:
getDisplayPath
in interfaceAlarmEvent
-
getDisplayPathOrSource
public java.lang.String getDisplayPathOrSource()
- Specified by:
getDisplayPathOrSource
in interfaceAlarmEvent
-
getLabel
public java.lang.String getLabel()
Description copied from interface:AlarmEvent
Returns the "Label" property, or "Name" if not defined.- Specified by:
getLabel
in interfaceAlarmEvent
-
active
public void active(EventData activeData)
- Specified by:
active
in interfaceAlarmEvent
-
acknowledge
public void acknowledge(EventData ackData)
- Specified by:
acknowledge
in interfaceAlarmEvent
-
clear
public void clear(EventData clearData)
- Specified by:
clear
in interfaceAlarmEvent
-
isCleared
public boolean isCleared()
- Specified by:
isCleared
in interfaceAlarmEvent
-
isAcked
public boolean isAcked()
- Specified by:
isAcked
in interfaceAlarmEvent
-
isShelved
public boolean isShelved()
Returns whether this is event is currently shelved, if the ShelfExpiration property is set, or whether the event was shelved, for journaled events, base on whether the IsShelved property is set.- Specified by:
isShelved
in interfaceAlarmEvent
-
getState
public AlarmState getState()
Returns the current state, as an enum. If this event represents a single state, such as the result from a journal query, this value will be misleading. In that case, getLastEventState() is the more accurate state function to use.- Specified by:
getState
in interfaceAlarmEvent
-
getLastEventState
public AlarmStateTransition getLastEventState()
Returns the most recent transition, or if this event represents a single state, the particular state that it represents.- Specified by:
getLastEventState
in interfaceAlarmEvent
-
getActiveData
public EventData getActiveData()
- Specified by:
getActiveData
in interfaceAlarmEvent
-
getClearedData
public EventData getClearedData()
- Specified by:
getClearedData
in interfaceAlarmEvent
-
getAckData
public EventData getAckData()
- Specified by:
getAckData
in interfaceAlarmEvent
-
getNotes
public java.lang.String getNotes()
- Specified by:
getNotes
in interfaceAlarmEvent
-
getOrDefault
public <T> T getOrDefault(Property<T> prop)
Searches the various event datas for the specified property. Looks in the order: Ack, Clear, Active, according to the state the event is in. If not found, the default is returned.- Specified by:
getOrDefault
in interfacePropertyValueSource
- Overrides:
getOrDefault
in classBasicPropertySet
- Returns:
- The value for prop or
Property.getDefaultValue()
if not present. Can return null if the value is null.
-
get
public <T> T get(Property<T> prop)
Description copied from interface:PropertyValueSource
Retrieves the value of the property, or null if this set doesn't contain that property.- Specified by:
get
in interfacePropertyValueSource
- Overrides:
get
in classBasicPropertySet
-
get
protected <T> T get(Property<T> prop, boolean retDefault)
-
contains
public boolean contains(Property<?> prop)
- Specified by:
contains
in interfacePropertyValueSource
- Overrides:
contains
in classBasicPropertySet
- Returns:
- True if the source contains a value for prop.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classBasicPropertySet
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classBasicPropertySet
-
-