com.prosysopc.ua.types.opcua.server
Class BaseEventTypeNode

java.lang.Object
  extended by com.prosysopc.ua.nodes.AbstractUaNode
      extended by com.prosysopc.ua.server.nodes.ServerNode
          extended by com.prosysopc.ua.server.nodes.BaseNode
              extended by com.prosysopc.ua.server.nodes.UaInstanceNode
                  extended by com.prosysopc.ua.server.nodes.UaObjectNode
                      extended by com.prosysopc.ua.server.nodes.AbstractGeneratedObjectNode
                          extended by com.prosysopc.ua.types.opcua.server.BaseObjectTypeNode
                              extended by com.prosysopc.ua.types.opcua.server.BaseEventTypeNodeBase
                                  extended by com.prosysopc.ua.types.opcua.server.BaseEventTypeNode
All Implemented Interfaces:
UaInstance, UaNode, UaObject, GeneratedNode, UaCallable, BaseEventType, BaseInstanceType, BaseObjectType
Direct Known Subclasses:
AuditEventTypeNodeBase, BaseModelChangeEventTypeNodeBase, ConditionTypeNodeBase, EventQueueOverflowEventTypeNodeBase, ProgressEventTypeNodeBase, SystemEventTypeNodeBase, TransitionEventTypeNodeBase

public class BaseEventTypeNode
extends BaseEventTypeNodeBase

Base Event Type. This is the base type for all event definitions.


Field Summary
protected  AtomicReference<EventData> lastEvent
           
 
Fields inherited from class com.prosysopc.ua.server.nodes.BaseNode
NODE_VERSION_PROPERTY_NAME
 
Fields inherited from class com.prosysopc.ua.server.nodes.ServerNode
eventListeners, INITIALIZATION_TIME, nodeManager, supportedAttributesMap
 
Fields inherited from interface com.prosysopc.ua.types.opcua.BaseEventType
EVENT_ID, EVENT_TYPE, LOCAL_TIME, MESSAGE, RECEIVE_TIME, SEVERITY, SOURCE_NAME, SOURCE_NODE, TIME
 
Constructor Summary
BaseEventTypeNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
           
 
Method Summary
protected  void afterAddReference(UaReference reference)
           
 void afterCreate()
          This method is called after NodeBuilder has constructed the instance, it is called for every sub-node that also implement this interface
 EventData getLastEvent()
           
 UaNode getSource()
          The source of the event.
 String getSourceName()
          The name of the event source.
 org.opcfoundation.ua.builtintypes.NodeId getSourceNode()
          The NodeId of the event source.
static boolean isDeleteOneShotEvents()
          If this is true then after triggerEvent is called, "One-Shot" events, i.e. not ConditionType events, are deleted from the AddressSpace.
 boolean isMonitoredForEvents()
          Check if the event is monitored by any client application via MonitoredEventItems
static void setDeleteOneShotEvents(boolean deleteOneShotEvents)
           
 void setSeverity(int severity)
          The severity of the event.
 void setSeverity(org.opcfoundation.ua.builtintypes.UnsignedShort severity)
          The severity of the event.
 void setSource(UaNode source)
          Define the source node of the event.
 void setSourceName(String sourceName)
          Description of the source of the event.
 org.opcfoundation.ua.builtintypes.ByteString triggerEvent(org.opcfoundation.ua.builtintypes.ByteString userEventId)
          Generates a new event using the current time.
 org.opcfoundation.ua.builtintypes.ByteString triggerEvent(org.opcfoundation.ua.builtintypes.DateTime time, org.opcfoundation.ua.builtintypes.DateTime receiveTime, org.opcfoundation.ua.builtintypes.ByteString userEventId)
          Generates a new event.
 
Methods inherited from class com.prosysopc.ua.types.opcua.server.BaseEventTypeNodeBase
callMethod, getBaseEventTypeNodeInitializer, getEventId, getEventIdNode, getEventType, getEventTypeNode, getLocalTime, getLocalTimeNode, getMessage, getMessageNode, getReceiveTime, getReceiveTimeNode, getSeverity, getSeverityNode, getSourceNameNode, getSourceNodeNode, getTime, getTimeNode, setBaseEventTypeNodeInitializer, setEventId, setEventType, setLocalTime, setMessage, setReceiveTime, setSourceNode, setTime
 
Methods inherited from class com.prosysopc.ua.types.opcua.server.BaseObjectTypeNode
isCacheMethodIds, setCacheMethodIds
 
Methods inherited from class com.prosysopc.ua.server.nodes.AbstractGeneratedObjectNode
afterCreateInitIfExists, afterCreateSetValueIfExists, callAfterCreateIfExists, getDefaultTypeDefinition, getQualifiedName, isComponentMatch
 
Methods inherited from class com.prosysopc.ua.server.nodes.UaObjectNode
addCallListener, callMethod, deleteIfNodeExists, getAttributes, getAttributes, getEventNotifier, getIcon, getNodeClass, initSupportedAttributes, readAttributeValue, removeCallListener, setAttributes, setEventNotifier, setIcon, toString, writeAttributeValue
 
Methods inherited from class com.prosysopc.ua.server.nodes.UaInstanceNode
addModellingRule, beforeAddReference, getTypeDefinition, getTypeDefinitionId, hasTypeDefinition, registerOverridePlainMethod, setTypeDefinition, setTypeDefinitionId, setTypeDefinitionId, supportsTypeDefinitionNode
 
Methods inherited from class com.prosysopc.ua.server.nodes.BaseNode
addPlainProperty, addPlainVariable, assertTypeSupport, assertTypeSupport, createNodeId, createNodeId, createReflectiveInstanceProperty, createReflectiveInstanceProperty, deleteReference, deleteReference, doAddProperty, getAttributes, getBrowseName, getComponent, getComponents, getDescription, getDescription, getDisplayName, getDisplayName, getMethod, getNodeVersion, getNodeVersionValue, getProperties, getProperty, getPropertyValue, getReferencesAsList, getStandardBrowseName, getStandardDisplayText, getUserWriteMask, getWriteMask, hasProperty, hasReference, hasUserWriteAccess, hasWriteAccess, incNodeVersion, initNodeVersion, isChildOfType, readAttribute, readAttribute, registerCallbackProperty, registerPlainInstanceProperty, registerPlainInstanceProperty, registerPlainProperty, registerPlainProperty, registerPlainVariable, registerPlainVariable, registerReflectiveInstanceProperty, registerReflectiveInstanceVariable, registerReflectiveProperty, registerReflectiveVariable, removeProperty, setAccessLevelRecursively, setAccessLevelRecursively, setAttribute, setBrowseName, setDescription, setDisplayName, setNodeVersionValue, setPropertyValue, setUserWriteMask, setWriteMask, writeAttribute
 
Methods inherited from class com.prosysopc.ua.server.nodes.ServerNode
addComponent, addDataChangeListener, addEventListener, addNewReference, addNewReference, addOrganizes, addProperties, addProperty, addReference, addReference, addReference, addReference, addReference, addReference, afterDeleteReference, dataChange, deleteReference, deleteReference, deleteReferences, doDeleteReference, equals, findPlaceholders, fireDataChange, fireEvent, fireEventInParents, getAddressSpace, getDefaultBrowseName, getNodeId, getNodeManager, getReference, getReferenceList, getReferences, getSupportedAttributes, getTargetNodes, hashCode, isAddNotifierReferencesToServerObject, isFalseOrNull, isMandatory, isMonitoredForEvents, isTrueOrNull, isType, referenceTypeInherits, removeComponent, removeDataChangeListener, removeEventListener, setAddNotifierReferencesToServerObject, setReferences, supportsAttribute, translateBrowsePathToNodeIds, validateHasEventSourceChain, validateHasEventSourceChain
 
Methods inherited from class com.prosysopc.ua.nodes.AbstractUaNode
getForwardReferences, getInverseReferences, getReferences, getReferences, referenceTypeInherits
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.prosysopc.ua.types.opcua.BaseInstanceType
getQualifiedName
 
Methods inherited from interface com.prosysopc.ua.nodes.UaObject
callMethod, getEventNotifier, getIcon, setEventNotifier, setIcon
 
Methods inherited from interface com.prosysopc.ua.nodes.UaInstance
getTypeDefinition, getTypeDefinitionId, setTypeDefinition, setTypeDefinitionId, setTypeDefinitionId
 
Methods inherited from interface com.prosysopc.ua.nodes.UaNode
addComponent, addProperty, addReference, addReference, addReference, deleteReference, deleteReference, deleteReference, deleteReference, getAddressSpace, getAttributes, getBrowseName, getComponent, getComponents, getDescription, getDisplayName, getForwardReferences, getInverseReferences, getMethod, getNodeClass, getNodeId, getNodeVersion, getProperties, getProperty, getReference, getReferences, getReferences, getSupportedAttributes, getUserWriteMask, getWriteMask, hasUserWriteAccess, hasWriteAccess, readAttribute, readAttribute, removeComponent, removeProperty, setAttribute, setAttributes, setBrowseName, setDescription, setDisplayName, setReferences, setUserWriteMask, setWriteMask, supportsAttribute, writeAttribute
 

Field Detail

lastEvent

protected final AtomicReference<EventData> lastEvent
Constructor Detail

BaseEventTypeNode

public BaseEventTypeNode(NodeManagerUaNode nodeManager,
                         org.opcfoundation.ua.builtintypes.NodeId nodeId,
                         org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                         org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Method Detail

isDeleteOneShotEvents

public static boolean isDeleteOneShotEvents()
If this is true then after triggerEvent is called, "One-Shot" events, i.e. not ConditionType events, are deleted from the AddressSpace. Default is true. This should not be changed, unless for testing purposes where the node should exist after triggering


setDeleteOneShotEvents

public static void setDeleteOneShotEvents(boolean deleteOneShotEvents)
See Also:
isDeleteOneShotEvents()

afterCreate

public void afterCreate()
Description copied from interface: GeneratedNode
This method is called after NodeBuilder has constructed the instance, it is called for every sub-node that also implement this interface

Specified by:
afterCreate in interface GeneratedNode
Overrides:
afterCreate in class BaseEventTypeNodeBase

getLastEvent

public EventData getLastEvent()

getSource

public UaNode getSource()
The source of the event.

The source defines the node from which the Event is generated from.

Returns:
the event source

getSourceName

public String getSourceName()
The name of the event source. If SourceName is null, then checks for the display name of the source node.

Specified by:
getSourceName in interface BaseEventType
Overrides:
getSourceName in class BaseEventTypeNodeBase
Returns:
the sourceName

getSourceNode

public org.opcfoundation.ua.builtintypes.NodeId getSourceNode()
The NodeId of the event source.

Specified by:
getSourceNode in interface BaseEventType
Overrides:
getSourceNode in class BaseEventTypeNodeBase
Returns:
the sourceNode

isMonitoredForEvents

public boolean isMonitoredForEvents()
Check if the event is monitored by any client application via MonitoredEventItems

Returns:
true if at least one client is monitoring the event

setSeverity

public void setSeverity(int severity)
The severity of the event. Severity is an indication of the urgency of the Event. This is also commonly called 'priority'. Values will range from 1 to 1000, with 1 being the lowest severity and 1000 being the highest. Typically, a severity of 1 would indicate an Event which is informational in nature, while a value of 1000 would indicate an Event of catastrophic nature, which could potentially result in severe financial loss or loss of life.

It is expected that very few Server implementations will support 1000 distinct severity levels. Therefore, Server developers are responsible for distributing their severity levels across the 1 - 1000 range in such a manner that clients can assume a linear distribution. For example, a client wishing to present five severity levels to a user should be able to do the following mapping:

Client Severity OPC Severity
HIGH 801 - 1000
MEDIUM HIGH 601 - 800
MEDIUM 401 - 600
MEDIUM LOW 201 - 400
LOW 1 - 200
In many cases a strict linear mapping of underlying source severities to the OPC Severity range is not appropriate. The Server developer will instead intelligently map the underlying source severities to the 1 - 1000 OPC Severity range in some other fashion. In particular, it is recommended that Server developers map Events of high urgency into the OPC severity range of 667 - 1000, Events of medium urgency into the OPC severity range of 334 - 666 and Events of low urgency into OPC severities of 1 - 333.

Overrides:
setSeverity in class BaseEventTypeNodeBase
Parameters:
severity - between 1 and 1000

setSeverity

public void setSeverity(org.opcfoundation.ua.builtintypes.UnsignedShort severity)
The severity of the event. Severity is an indication of the urgency of the Event. This is also commonly called 'priority'. Values will range from 1 to 1000, with 1 being the lowest severity and 1000 being the highest. Typically, a severity of 1 would indicate an Event which is informational in nature, while a value of 1000 would indicate an Event of catastrophic nature, which could potentially result in severe financial loss or loss of life.

It is expected that very few Server implementations will support 1000 distinct severity levels. Therefore, Server developers are responsible for distributing their severity levels across the 1 - 1000 range in such a manner that clients can assume a linear distribution. For example, a client wishing to present five severity levels to a user should be able to do the following mapping:

Client Severity OPC Severity
HIGH 801 - 1000
MEDIUM HIGH 601 - 800
MEDIUM 401 - 600
MEDIUM LOW 201 - 400
LOW 1 - 200
In many cases a strict linear mapping of underlying source severities to the OPC Severity range is not appropriate. The Server developer will instead intelligently map the underlying source severities to the 1 - 1000 OPC Severity range in some other fashion. In particular, it is recommended that Server developers map Events of high urgency into the OPC severity range of 667 - 1000, Events of medium urgency into the OPC severity range of 334 - 666 and Events of low urgency into OPC severities of 1 - 333.

Specified by:
setSeverity in interface BaseEventType
Overrides:
setSeverity in class BaseEventTypeNodeBase
Parameters:
severity - between 1 and 1000

setSource

public void setSource(UaNode source)
Define the source node of the event. This sets SourceNode and SourceName from the NodeId and DisplayName of the source node.

Parameters:
source - the source node of the event

setSourceName

public void setSourceName(String sourceName)
Description of the source of the event.

If you do not define SourceName (or set it to null), the DisplayName of Source is used (if defined, of course).

Specified by:
setSourceName in interface BaseEventType
Overrides:
setSourceName in class BaseEventTypeNodeBase
Parameters:
sourceName - the sourceName to set, use null to use the DisplayName of Source (default)

triggerEvent

public org.opcfoundation.ua.builtintypes.ByteString triggerEvent(org.opcfoundation.ua.builtintypes.ByteString userEventId)
Generates a new event using the current time. The event is triggered to the clients that are listening to it.

Parameters:
userEventId - a user specific part that will be added to the eventId that is generated automatically for each event. The userEventId helps you to identify the event that you created from your application, for example when an AcknowledgeableConditionType is acknowledged. You can use EventManager.createEventId(long) to create a custom ID from an integer value.
Returns:
the fullEventId generated for the event, it is composed of a system eventId generated with #createEventId(long) appended by the userEventId (if any)

triggerEvent

public org.opcfoundation.ua.builtintypes.ByteString triggerEvent(org.opcfoundation.ua.builtintypes.DateTime time,
                                                                 org.opcfoundation.ua.builtintypes.DateTime receiveTime,
                                                                 org.opcfoundation.ua.builtintypes.ByteString userEventId)
Generates a new event. The event is triggered to the clients that are listening to it.

Parameters:
time - Time provides the time the Event occurred. This value is set as close to the event generator as possible. It often comes from the underlying system or device. If 'null' is provided, currentTime is used.
receiveTime - ReceiveTime provides the time the OPC UA Server received the Event from the underlying device of another Server. If 'null' is provided, time is also used as receiveTime.
userEventId - a user specific part that will be added to the eventId that is generated automatically for each event. The userEventId helps you to identify the event that you created from your application, for example when an AcknowledgeableConditionType is acknowledged. You can use EventManager.createEventId(long) to create a custom ID from an integer value.
Returns:
the fullEventId generated for the event, it is composed of a system eventId generated with #createEventId(long) appended by the userEventId (if any)

afterAddReference

protected void afterAddReference(UaReference reference)
Overrides:
afterAddReference in class ServerNode


Copyright © 2018. All rights reserved.