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

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
                                      extended by com.prosysopc.ua.types.opcua.server.ConditionTypeNodeBase
                                          extended by com.prosysopc.ua.types.opcua.server.ConditionTypeNode
All Implemented Interfaces:
UaInstance, UaNode, UaObject, GeneratedNode, UaCallable, BaseEventType, BaseInstanceType, BaseObjectType, ConditionType
Direct Known Subclasses:
AcknowledgeableConditionTypeNodeBase, DialogConditionTypeNodeBase

public class ConditionTypeNode
extends ConditionTypeNodeBase

Standard OPC UA condition type as defined in the A&C specification. The ConditionType defines all general characteristics of a Condition. All other ConditionTypes derive from it.


Field Summary
 
Fields inherited from class com.prosysopc.ua.types.opcua.server.BaseEventTypeNode
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.ConditionType
ADD_COMMENT, BRANCH_ID, CLIENT_USER_ID, COMMENT, CONDITION_CLASS_ID, CONDITION_CLASS_NAME, CONDITION_NAME, DISABLE, ENABLE, ENABLED_STATE, LAST_SEVERITY, QUALITY, RETAIN
 
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
protected ConditionTypeNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
           
 
Method Summary
 void addComment(org.opcfoundation.ua.builtintypes.ByteString eventId, org.opcfoundation.ua.builtintypes.LocalizedText comment, org.opcfoundation.ua.builtintypes.DateTime time, org.opcfoundation.ua.builtintypes.ByteString userEventId)
          Add a new comment to a specific eventId.
 void afterCreate()
          This method is called after NodeBuilder has constructed the instance, it is called for every sub-node that also implement this interface
protected  void checkEnabled()
           
 boolean isEnabled()
           
protected  void onAddComment(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.ByteString eventId, org.opcfoundation.ua.builtintypes.LocalizedText comment)
           
protected  void onDisable(ServiceContext serviceContext)
           
protected  void onEnable(ServiceContext serviceContext)
           
 void setEnabled(boolean enabled)
           
 void setEnabled(boolean enabled, org.opcfoundation.ua.builtintypes.DateTime enableTime)
          Define whether the condition is enabled or not.
 void setQuality(org.opcfoundation.ua.builtintypes.StatusCode quality)
          Quality reveals the status of process values or other resources that this Condition instance is based upon.
 void setRetain(boolean retain)
          Retain when TRUE describes a Condition (a ConditionBranch) as being in a state that is interesting for a Client wishing to synchronize its state with the Server's state.
 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.
 org.opcfoundation.ua.builtintypes.ByteString triggerEvent(org.opcfoundation.ua.builtintypes.DateTime time, org.opcfoundation.ua.builtintypes.DateTime receiveTime, org.opcfoundation.ua.builtintypes.ByteString userEventId, org.opcfoundation.ua.builtintypes.LocalizedText comment)
          Trigger an event, using an initial comment.
 
Methods inherited from class com.prosysopc.ua.types.opcua.server.ConditionTypeNodeBase
addComment, callMethod, disable, enable, getAddCommentMethodImplementation, getAddCommentNode, getBranchId, getBranchIdNode, getClientUserId, getClientUserIdNode, getComment, getCommentNode, getConditionClassId, getConditionClassIdNode, getConditionClassName, getConditionClassNameNode, getConditionName, getConditionNameNode, getConditionTypeNodeInitializer, getDisableMethodImplementation, getDisableNode, getEnabledState, getEnabledStateNode, getEnableMethodImplementation, getEnableNode, getLastSeverity, getLastSeverityNode, getQuality, getQualityNode, getRetainNode, isRetain, setAddCommentMethodImplementation, setBranchId, setClientUserId, setComment, setConditionClassId, setConditionClassName, setConditionName, setConditionTypeNodeInitializer, setDisableMethodImplementation, setEnabledState, setEnableMethodImplementation, setLastSeverity, setLastSeverity, setRetain
 
Methods inherited from class com.prosysopc.ua.types.opcua.server.BaseEventTypeNode
afterAddReference, getLastEvent, getSource, getSourceName, getSourceNode, isDeleteOneShotEvents, isMonitoredForEvents, setDeleteOneShotEvents, setSeverity, setSeverity, setSource, setSourceName, triggerEvent
 
Methods inherited from class com.prosysopc.ua.types.opcua.server.BaseEventTypeNodeBase
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.BaseEventType
getEventId, getEventIdNode, getEventType, getEventTypeNode, getLocalTime, getLocalTimeNode, getMessage, getMessageNode, getReceiveTime, getReceiveTimeNode, getSeverity, getSeverityNode, getSourceName, getSourceNameNode, getSourceNode, getSourceNodeNode, getTime, getTimeNode, setEventId, setEventType, setLocalTime, setMessage, setReceiveTime, setSeverity, setSourceName, setSourceNode, setTime
 
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
 

Constructor Detail

ConditionTypeNode

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

addComment

public void addComment(org.opcfoundation.ua.builtintypes.ByteString eventId,
                       org.opcfoundation.ua.builtintypes.LocalizedText comment,
                       org.opcfoundation.ua.builtintypes.DateTime time,
                       org.opcfoundation.ua.builtintypes.ByteString userEventId)
                throws StatusException
Add a new comment to a specific eventId. If the event equals to the LastEvent, also sets the current Comment.

Changing the comment with addComment will also trigger a new event notification to the clients.

If you simply wish to set the current comment, and trigger the event later yourself, use ConditionTypeNodeBase.setComment(LocalizedText).

Parameters:
eventId - the event to comment; use null to add comment to the last event
comment - the comment text to add to the event
time - time used when triggering the new event; if null currentTime is used
userEventId - a new userEventId used when triggering the change, can be null
Throws:
StatusException - if the event is not found
See Also:
ConditionTypeNodeBase.setComment(LocalizedText)

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 ConditionTypeNodeBase

isEnabled

public boolean isEnabled()
Returns:

setEnabled

public void setEnabled(boolean enabled)

setEnabled

public void setEnabled(boolean enabled,
                       org.opcfoundation.ua.builtintypes.DateTime enableTime)
Define whether the condition is enabled or not. If Enabled is set to false, Retain is also set to false, automatically.

When you set Enabled to true, you should update the condition properties, set retain accordingly and call triggerEvent, if it requires attention from the clients.

For any Condition that exists in the AddressSpace the Attributes and the following Variables will continue to have valid values even in the disabled state; EventId, Event Type, Source Node, Source Name, Time, and EnabledState. Other properties may no longer provide current valid values. All Variables that are no longer provided shall return a status of Bad_ConditionDisabled.

When enabled, changes to the following components should cause a ConditionType Event Notification, i.e. you should call triggerEvent after modifying them:

Parameters:
enabled - value of enabled to set
enableTime - transitionTime to the enabled state

setQuality

public void setQuality(org.opcfoundation.ua.builtintypes.StatusCode quality)
Quality reveals the status of process values or other resources that this Condition instance is based upon. If, for example, a process value is 'Uncertain', the associated 'LevelAlarm' Condition is also questionable. Values for the Quality can be any of the OPC StatusCodes defined in Part 8 (DataAccess) as well as Good, Uncertain and Bad as defined in Part 4. These StatusCodes are similar to but slightly more generic than the description of data quality in the various Fieldbus Specifications. It is the responsibility of the Server to map internal status information to these codes. A Server which supports no quality information must return StatusCode.GOOD (which is the default value).

Specified by:
setQuality in interface ConditionType
Overrides:
setQuality in class ConditionTypeNodeBase
Parameters:
quality - the quality to set

setRetain

public void setRetain(boolean retain)
Retain when TRUE describes a Condition (a ConditionBranch) as being in a state that is interesting for a Client wishing to synchronize its state with the Server's state. The logic to determine how this flag is set is Server specific. Typically all Active Alarms would have the Retain flag set; however, it is also possible for inactive Alarms to have their Retain flag set to TRUE.

In normal processing when a Client receives an Event with the Retain flag set to FALSE, the Client should consider this as a ConditionBranch that is no longer of interest, in the case of a 'current Alarm display' the ConditionBranch would be removed from the display.

Parameters:
retain - the retain to set

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)
Description copied from class: BaseEventTypeNode
Generates a new event. The event is triggered to the clients that are listening to it.

Overrides:
triggerEvent in class BaseEventTypeNode
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)

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,
                                                                 org.opcfoundation.ua.builtintypes.LocalizedText comment)
Trigger an event, using an initial comment. By default, Comment is cleared when you trigger a new event. In case you wish to keep it or initialize it to a comment in your own system, use this method, instead of triggerEvent(DateTime, DateTime, ByteString).

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.
Returns:
the fullEventId generated for the event, it is composed of a system eventId generated with #createEventId(long) appended by the userEventId (if any)

checkEnabled

protected void checkEnabled()
                     throws StatusException
Throws:
StatusException

onAddComment

protected void onAddComment(ServiceContext serviceContext,
                            org.opcfoundation.ua.builtintypes.ByteString eventId,
                            org.opcfoundation.ua.builtintypes.LocalizedText comment)
                     throws StatusException
Specified by:
onAddComment in class ConditionTypeNodeBase
Throws:
StatusException

onDisable

protected void onDisable(ServiceContext serviceContext)
                  throws StatusException
Specified by:
onDisable in class ConditionTypeNodeBase
Throws:
StatusException

onEnable

protected void onEnable(ServiceContext serviceContext)
                 throws StatusException
Specified by:
onEnable in class ConditionTypeNodeBase
Throws:
StatusException


Copyright © 2018. All rights reserved.