public class EventData extends Object
EventData supports the Value Attribute for all paths except for the
RelativeNamePath.EMPTY. For the RelativeNamePath.EMPTY EventData stores
the NodeId Attribute. No other Attribute/Path combinations are supported.| Modifier and Type | Field and Description |
|---|---|
static RelativeNamePath |
EVENT_ID_PATH
The browse path to the EventId field.
|
static RelativeNamePath |
EVENT_TYPE_PATH
The browse path to the EventType field.
|
static RelativeNamePath |
NODE_ID_PATH
The browse path to the Event instance root node.
|
static RelativeNamePath |
TIME_PATH
The browse path to the Time field.
|
| Modifier | Constructor and Description |
|---|---|
|
EventData(NodeId nodeId,
ByteString eventId)
Deprecated.
use
raw(NodeId, ByteString) instead. |
protected |
EventData(NodeId nodeId,
ByteString eventId,
Set<NodeId> typeHierarchy)
Internal method, signature may change in future versions, creates new EventData.
|
|
EventData(UaNode node,
ByteString eventId)
Deprecated.
use
#fromNodeHierarchy(UaNode, ByteString) instead. |
protected |
EventData(UaNode node,
ByteString eventId,
Set<NodeClass> excludeNodeClasses,
boolean calculateTypeHierarchy)
Internal method, signature may change in future versions, creates new EventData.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addComment(LocalizedText comment)
Adds a comment to the event.
|
static EventData |
fromNodeHierarchy(UaNode node,
ByteString eventId,
Iterable<NodeClass> excludeNodeClasses)
Creates a new EventData structure using the current field values of an event node and it's
subnodes.
|
static EventData |
fromNodeHierarchy(UaNode node,
ByteString eventId,
NodeClass... excludeNodeClasses)
Creates a new EventData structure using the current field values of an event node and it's
subnodes.
|
LocalizedText[] |
getComments()
Returns the current comments.
|
ByteString |
getEventId()
The unique EventId of the event.
|
UaType |
getEventType()
The EventType as a reference to a UaType node.
|
NodeId |
getEventTypeId()
The EventType as a NodeId.
|
Set<RelativeNamePath> |
getFieldNames()
Return unmodifiable Set of all event fields i.e.
|
Variant |
getFieldValue(List<QualifiedName> fieldPath)
Read the value of an event field.
|
Variant |
getFieldValue(QualifiedName[] fieldPath)
Read the value of an event field.
|
Variant |
getFieldValue(RelativeNamePath fieldPath)
Read the value of an event field.
|
Variant |
getFieldValue(SimpleAttributeOperand field)
Returns field values for the given field.
|
Variant[] |
getFieldValues(List<List<QualifiedName>> fieldPaths)
Get the field values corresponding to the provided fieldPaths.
|
Variant[] |
getFieldValues(SimpleAttributeOperand[] fields)
Returns field values for the given fields (in the relative indexes).
|
NodeId |
getNodeId()
The ID of the node that generated the event.
|
DateTime |
getTime()
Returns the value of
TIME_PATH BrowsePath, or DateTime.MIN_VALUE if none
exist. |
Set<NodeId> |
getTypeHierarchy()
Returns event type and all supertypes of it as an unmodifiable Set (iteration order is not
defined).
|
static EventData |
raw(NodeId nodeId,
ByteString eventId)
Create a new (blank) EventData structure.
|
static EventData |
raw(NodeId nodeId,
ByteString eventId,
Set<NodeId> typeHierarchy)
Create a new (blank) EventData structure.
|
void |
setEventType(UaType eventType)
Allows setting an event type UaNode to be used for
EVENT_TYPE_PATH BrowsePath. |
void |
setFieldValue(List<QualifiedName> browsePath,
Variant value)
Set the value of an event field in the EventData structure.
|
void |
setFieldValue(QualifiedName[] browsePath,
Variant value)
Set the value of an event field in the EventData structure.
|
void |
setFieldValue(RelativeNamePath browsePath,
Variant value)
Set the value of an event field in the EventData structure.
|
void |
setTypeHierarchy(Set<NodeId> typeHierarchy)
Sets the type hierarchy.
|
String |
toString() |
public static final RelativeNamePath NODE_ID_PATH
getNodeId(). This path is
special since it is an empty (empty QualifiedNames array, in practice), which instead of a
selecting a sub-node selects the main (root) node of the Event instance. Same as
RelativeNamePath.EMPTY.public static final RelativeNamePath EVENT_TYPE_PATH
getEventTypeId().public static final RelativeNamePath EVENT_ID_PATH
getEventId().public static final RelativeNamePath TIME_PATH
getTime().@Deprecated public EventData(NodeId nodeId, ByteString eventId)
raw(NodeId, ByteString) instead.setFieldValue(java.util.List<com.prosysopc.ua.stack.builtintypes.QualifiedName>, com.prosysopc.ua.stack.builtintypes.Variant) to define the values of the event
fields.nodeId - the event or condition node that generated the eventeventId - the ID of the event occurrence@Deprecated public EventData(UaNode node, ByteString eventId)
#fromNodeHierarchy(UaNode, ByteString) instead.node - the event or condition node that generated the eventeventId - the ID of the event occurrenceprotected EventData(NodeId nodeId, ByteString eventId, Set<NodeId> typeHierarchy)
protected EventData(UaNode node, ByteString eventId, Set<NodeClass> excludeNodeClasses, boolean calculateTypeHierarchy)
public static EventData fromNodeHierarchy(UaNode node, ByteString eventId, Iterable<NodeClass> excludeNodeClasses)
node - the event or condition node that generated the eventeventId - the ID of the event occurrenceexcludeNodeClasses - 0 or more NodeClasses to exclude during calculating the node
hierarchy. Also excludes any subnodes under the excluded nodes, recursively.public static EventData fromNodeHierarchy(UaNode node, ByteString eventId, NodeClass... excludeNodeClasses)
node - the event or condition node that generated the eventeventId - the ID of the event occurrenceexcludeNodeClasses - 0 or more NodeClasses to exclude during calculating the node
hierarchy. Also excludes any subnodes under the excluded nodes, recursively.public static EventData raw(NodeId nodeId, ByteString eventId)
setFieldValue(java.util.List<com.prosysopc.ua.stack.builtintypes.QualifiedName>, com.prosysopc.ua.stack.builtintypes.Variant) to define the values of
the event fields. It is recommended when possible to use raw(NodeId, ByteString, Set)
and give the TypeDefinition hierarchy of the event type. Without hierarchy
getFieldValue(SimpleAttributeOperand) and
getFieldValues(SimpleAttributeOperand[]) wont use
SimpleAttributeOperand.getTypeDefinitionId() as part of the filtering process, which
can lead into ambiguous situations if a client used more than one
SimpleAttributeOperand.getBrowsePath() with different
SimpleAttributeOperand.getTypeDefinitionId().nodeId - the event or condition node that generated the eventeventId - the ID of the event occurrencepublic static EventData raw(NodeId nodeId, ByteString eventId, Set<NodeId> typeHierarchy)
setFieldValue(java.util.List<com.prosysopc.ua.stack.builtintypes.QualifiedName>, com.prosysopc.ua.stack.builtintypes.Variant) to define the values of
the event fields. The given type hierarchy Set should contain the TypeDefinition and all
supertypes of the given NodeId (the Set can be empty, but then this method behaves the same as
raw(NodeId, ByteString)). Assuming type hierarchy is given, it is used in
getFieldValue(SimpleAttributeOperand) and
getFieldValues(SimpleAttributeOperand[]) to resolve
SimpleAttributeOperand.getTypeDefinitionId(). If type hierarchy is not given (the set
is empty), then SimpleAttributeOperand.getTypeDefinitionId() is not used as part of the
filtering process.nodeId - the event or condition node that generated the eventeventId - the ID of the event occurrencetypeHierarchy - a Set containing the TypeDefinition NodeId of the #nodeId
parameter and all supertypes of it.public void addComment(LocalizedText comment)
comment - text for the comment.public LocalizedText[] getComments()
public ByteString getEventId()
public UaType getEventType()
setEventType(UaType) method. In case the node is not be available,
use getEventTypeId() and define the node for further use, if possible.public NodeId getEventTypeId()
getEventType()public Set<RelativeNamePath> getFieldNames()
EventFilter. Note that only paths that do have a value exist in the Set, a client can
also select paths that do not exist here (those will get a null value in the event
notification).public Variant getFieldValue(List<QualifiedName> fieldPath)
fieldPath - the browse path to the field of the event to readpublic Variant getFieldValue(QualifiedName[] fieldPath)
fieldPath - the browse path to the field of the event to readpublic Variant getFieldValue(RelativeNamePath fieldPath)
public Variant getFieldValue(SimpleAttributeOperand field)
EventData was constructed in a way
that the type hierarchy of the EventType was resolvable, then assuming
SimpleAttributeOperand.getTypeDefinitionId() is found from the hierarchy the returned
value (per index) is same as calling getFieldValue(QualifiedName[]) with
SimpleAttributeOperand.getBrowsePath(), otherwise Variant.NULL is returned. If
this EventData was not constructed as EventType hierarchy aware, then the
SimpleAttributeOperand.getTypeDefinitionId() is skipped and
getFieldValue(QualifiedName[]) is returned always in the index. Returns
Variant.NULL if given null.public Variant[] getFieldValues(List<List<QualifiedName>> fieldPaths)
fieldPaths - BrowsePaths to collect as values.public Variant[] getFieldValues(SimpleAttributeOperand[] fields)
SimpleAttributeOperand results in a null in the return array. If This
EventData was constructed in a way that the type hierarchy of the EventType was
resolvable, then assuming SimpleAttributeOperand.getTypeDefinitionId() is found from
the hierarchy the returned value (per index) is same as calling
getFieldValue(QualifiedName[]) with SimpleAttributeOperand.getBrowsePath(),
otherwise Variant.NULL is returned. If this EventData was not constructed as
EventType hierarchy aware, then the SimpleAttributeOperand.getTypeDefinitionId() is
skipped and getFieldValue(QualifiedName[]) is returned always in the index.public NodeId getNodeId()
public DateTime getTime()
TIME_PATH BrowsePath, or DateTime.MIN_VALUE if none
exist.public Set<NodeId> getTypeHierarchy()
EventData was not created with the
hierarchy.public void setEventType(UaType eventType)
EVENT_TYPE_PATH BrowsePath.public void setFieldValue(List<QualifiedName> browsePath, Variant value)
browsePath - The browse path to the field (e.g. property) of the event.value - the value of the fieldpublic void setFieldValue(QualifiedName[] browsePath, Variant value)
browsePath - The browse path to the field (e.g. property) of the event.value - the value of the fieldpublic void setFieldValue(RelativeNamePath browsePath, Variant value)
browsePath - The browse path to the field (e.g. property) of the event.value - the value of the fieldpublic void setTypeHierarchy(Set<NodeId> typeHierarchy)
Copyright © 2026. All rights reserved.