com.prosysopc.ua
Class EventData

java.lang.Object
  extended by com.prosysopc.ua.EventData

public class EventData
extends Object

State of an event object, when an event is triggered.


Field Summary
static org.opcfoundation.ua.builtintypes.QualifiedName[] EVENT_TYPE_PATH
          The browse path to the EventType field.
static org.opcfoundation.ua.builtintypes.QualifiedName[] TIME_PATH
          The browse path to the Time field.
 
Constructor Summary
EventData(org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.ByteString eventId)
          Create a new EventData structure.
EventData(UaNode node, org.opcfoundation.ua.builtintypes.ByteString eventId)
          Create a new EventData structure using the current field values of an event node.
 
Method Summary
 void addComment(org.opcfoundation.ua.builtintypes.LocalizedText comment)
           
 org.opcfoundation.ua.builtintypes.LocalizedText[] getComments()
           
 org.opcfoundation.ua.builtintypes.ByteString getEventId()
          The unique EventId of the event.
 UaType getEventType()
          The EventType as a reference to a UaType node.
 org.opcfoundation.ua.builtintypes.NodeId getEventTypeId()
          The EventType as a NodeId.
 Set<List<org.opcfoundation.ua.builtintypes.QualifiedName>> getFieldNames()
          Provide an iterable set of all field names for the EventData.
 org.opcfoundation.ua.builtintypes.Variant getFieldValue(List<org.opcfoundation.ua.builtintypes.QualifiedName> fieldPath)
          Read the value of an event field
 org.opcfoundation.ua.builtintypes.Variant getFieldValue(org.opcfoundation.ua.builtintypes.QualifiedName[] fieldPath)
          Read the value of an event field
 org.opcfoundation.ua.builtintypes.Variant[] getFieldValues(List<List<org.opcfoundation.ua.builtintypes.QualifiedName>> fieldPaths)
          Get the field values corresponding to the provided fieldPaths.
 org.opcfoundation.ua.builtintypes.NodeId getNodeId()
          The ID of the node that generated the event.
 org.opcfoundation.ua.builtintypes.DateTime getTime()
           
 void setEventType(UaType eventType)
           
 void setFieldValue(List<org.opcfoundation.ua.builtintypes.QualifiedName> browsePath, org.opcfoundation.ua.builtintypes.Variant value)
          Set the value of an event field in the EventData structure.
 void setFieldValue(org.opcfoundation.ua.builtintypes.QualifiedName[] browsePath, org.opcfoundation.ua.builtintypes.Variant value)
          Set the value of an event field in the EventData structure.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EVENT_TYPE_PATH

public static final org.opcfoundation.ua.builtintypes.QualifiedName[] EVENT_TYPE_PATH
The browse path to the EventType field. Used in getEventTypeId()


TIME_PATH

public static final org.opcfoundation.ua.builtintypes.QualifiedName[] TIME_PATH
The browse path to the Time field. Used in getTime()

Constructor Detail

EventData

public EventData(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                 org.opcfoundation.ua.builtintypes.ByteString eventId)
Create a new EventData structure.

Use setFieldValue(java.util.List, org.opcfoundation.ua.builtintypes.Variant) to define the values of the event fields.

Parameters:
nodeId - the event or condition node that generated the event
eventId - the ID of the event occurrence

EventData

public EventData(UaNode node,
                 org.opcfoundation.ua.builtintypes.ByteString eventId)
Create a new EventData structure using the current field values of an event node.

Parameters:
node - the event or condition node that generated the event
eventId - the ID of the event occurrence
Method Detail

addComment

public void addComment(org.opcfoundation.ua.builtintypes.LocalizedText comment)
Parameters:
comment -

getComments

public org.opcfoundation.ua.builtintypes.LocalizedText[] getComments()
Returns:
the comments

getEventId

public org.opcfoundation.ua.builtintypes.ByteString getEventId()
The unique EventId of the event. EventIds are used to identify event occurrences. Whenever the state of the condition changes, for example, a new event with a new ID is generated.

Returns:
the unique EventId.

getEventType

public UaType getEventType()
The EventType as a reference to a UaType node. The node is not defined by default, but may be provided using the setEventType(UaType) method. In case the node is not be available, use getEventTypeId() and define the node for further use, if possible.

Returns:
the eventType or null if not defined

getEventTypeId

public org.opcfoundation.ua.builtintypes.NodeId getEventTypeId()
The EventType as a NodeId. The event type is defined by the "EventType" field.

Returns:
the value of "EventType" field. The NodeId of the event type.
See Also:
getEventType()

getFieldNames

public Set<List<org.opcfoundation.ua.builtintypes.QualifiedName>> getFieldNames()
Provide an iterable set of all field names for the EventData. Each field name is identified with a BrowsePath defined using a List of QualifiedNames.

Returns:
the key set of the underlying map that is used to keep the field values.

getFieldValue

public org.opcfoundation.ua.builtintypes.Variant getFieldValue(List<org.opcfoundation.ua.builtintypes.QualifiedName> fieldPath)
Read the value of an event field

Parameters:
fieldPath - the browse path to the field of the event to read
Returns:
the value of field

getFieldValue

public org.opcfoundation.ua.builtintypes.Variant getFieldValue(org.opcfoundation.ua.builtintypes.QualifiedName[] fieldPath)
Read the value of an event field

Parameters:
fieldPath - the browse path to the field of the event to read
Returns:
the value of field

getFieldValues

public org.opcfoundation.ua.builtintypes.Variant[] getFieldValues(List<List<org.opcfoundation.ua.builtintypes.QualifiedName>> fieldPaths)
Get the field values corresponding to the provided fieldPaths.

Parameters:
fieldPaths -
Returns:

getNodeId

public org.opcfoundation.ua.builtintypes.NodeId getNodeId()
The ID of the node that generated the event.

Returns:
the NodeId "field"

getTime

public org.opcfoundation.ua.builtintypes.DateTime getTime()

setEventType

public void setEventType(UaType eventType)
Parameters:
eventType - the eventType to set

setFieldValue

public void setFieldValue(List<org.opcfoundation.ua.builtintypes.QualifiedName> browsePath,
                          org.opcfoundation.ua.builtintypes.Variant value)
Set the value of an event field in the EventData structure.

You typically only need to use this method, if you do not provide the UaNode to the EventData in the constructor. If you do provide it, the field values are added to the EventData automatically.

Parameters:
browsePath - The browse path to the field (e.g. property) of the event.
value - the value of the field

setFieldValue

public void setFieldValue(org.opcfoundation.ua.builtintypes.QualifiedName[] browsePath,
                          org.opcfoundation.ua.builtintypes.Variant value)
Set the value of an event field in the EventData structure.

Parameters:
browsePath - The browse path to the field (e.g. property) of the event.
value - the value of the field

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2018. All rights reserved.