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

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

public class AcknowledgeableConditionTypeNode
extends AcknowledgeableConditionTypeNodeBase

The AcknowledgeableConditionType extends the ConditionType by defining acknowledgement characteristics. It is an abstract type.

The following is from the OPC UA specification Part 9, section 5.7:

AckedState when FALSE indicates that the Condition instance requires acknowledgement for the reported Condition state. When the Condition instance is acknowledged the AckedState is set to TRUE. ConfirmedState indicates whether it requires confirmation. Recommended state names are described in Annex A. The two states are sub-states of the TRUE EnabledState. See section 4.3 for more information about acknowledgement and confirmation models. The EventId used in the Event Notification is considered the identifier of this state and has to be used when calling the Methods for acknowledgement or confirmation.

A Server may require that previous states be acknowledged. If the acknowledgement of a previous state is still open and a new state also requires acknowledgement, the Server shall create a branch of the Condition instance as specified in section 4.4. Clients are expected to keep track of all ConditionBranches where AckedState/Id is FALSE to allow acknowledgement of those. See also section 5.5.2 for more information about ConditionBranches and the examples in appendix B.1. The handling of the AckedState and branches also applies to the ConfirmState.


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.AcknowledgeableConditionType
ACKED_STATE, ACKNOWLEDGE, CONFIRM, CONFIRMED_STATE, ENABLED_STATE
 
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, 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 AcknowledgeableConditionTypeNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
          NodeBuilder uses this, you should not call this yourself.
 
Method Summary
 void acknowledge(org.opcfoundation.ua.builtintypes.ByteString eventId, org.opcfoundation.ua.builtintypes.LocalizedText comment, org.opcfoundation.ua.builtintypes.DateTime ackTime, org.opcfoundation.ua.builtintypes.ByteString userEventId)
          Acknowledged the condition, adds the comment to the eventId with ConditionTypeNode.addComment(ByteString, LocalizedText, DateTime, ByteString).
 void afterCreate()
          This method is called after NodeBuilder has constructed the instance, it is called for every sub-node that also implement this interface
 void confirm(org.opcfoundation.ua.builtintypes.ByteString eventId, org.opcfoundation.ua.builtintypes.LocalizedText comment, org.opcfoundation.ua.builtintypes.DateTime confirmTime, org.opcfoundation.ua.builtintypes.ByteString userEventId)
          Confirms the condition and adds the comment to the eventId with ConditionTypeNode.addComment(ByteString, LocalizedText, DateTime, ByteString).
 boolean isAcked()
           
 boolean isConfirmed()
           
protected  void onAcknowledge(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.ByteString eventId, org.opcfoundation.ua.builtintypes.LocalizedText comment)
           
protected  void onConfirm(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.ByteString eventId, org.opcfoundation.ua.builtintypes.LocalizedText comment)
           
 void setAcked(boolean acked)
          Set the Acknowledged status of the condition.
 void setAcked(boolean acked, org.opcfoundation.ua.builtintypes.DateTime ackTime)
          Set the Acknowledged status of the condition.
 void setConfirmed(boolean confirmed)
          Set the Confirmed status of the condition.
 void setConfirmed(boolean confirmed, org.opcfoundation.ua.builtintypes.DateTime confirmTime)
          Set the Confirmed status of the condition.
 
Methods inherited from class com.prosysopc.ua.types.opcua.server.AcknowledgeableConditionTypeNodeBase
acknowledge, callMethod, confirm, getAckedState, getAckedStateNode, getAcknowledgeableConditionTypeNodeInitializer, getAcknowledgeMethodImplementation, getAcknowledgeNode, getConfirmedState, getConfirmedStateNode, getConfirmMethodImplementation, getConfirmNode, getEnabledState, getEnabledStateNode, setAckedState, setAcknowledgeableConditionTypeNodeInitializer, setAcknowledgeMethodImplementation, setConfirmedState, setConfirmMethodImplementation, setEnabledState
 
Methods inherited from class com.prosysopc.ua.types.opcua.server.ConditionTypeNode
addComment, checkEnabled, isEnabled, onAddComment, onDisable, onEnable, setEnabled, setEnabled, setQuality, setRetain, triggerEvent, triggerEvent
 
Methods inherited from class com.prosysopc.ua.types.opcua.server.ConditionTypeNodeBase
addComment, disable, enable, getAddCommentMethodImplementation, getAddCommentNode, getBranchId, getBranchIdNode, getClientUserId, getClientUserIdNode, getComment, getCommentNode, getConditionClassId, getConditionClassIdNode, getConditionClassName, getConditionClassNameNode, getConditionName, getConditionNameNode, getConditionTypeNodeInitializer, getDisableMethodImplementation, getDisableNode, getEnableMethodImplementation, getEnableNode, getLastSeverity, getLastSeverityNode, getQuality, getQualityNode, getRetainNode, isRetain, setAddCommentMethodImplementation, setBranchId, setClientUserId, setComment, setConditionClassId, setConditionClassName, setConditionName, setConditionTypeNodeInitializer, setDisableMethodImplementation, 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.ConditionType
addComment, disable, enable, getAddCommentNode, getBranchId, getBranchIdNode, getClientUserId, getClientUserIdNode, getComment, getCommentNode, getConditionClassId, getConditionClassIdNode, getConditionClassName, getConditionClassNameNode, getConditionName, getConditionNameNode, getDisableNode, getEnableNode, getLastSeverity, getLastSeverityNode, getQuality, getQualityNode, getRetainNode, isRetain, setBranchId, setClientUserId, setComment, setConditionClassId, setConditionClassName, setConditionName, setLastSeverity, setQuality, setRetain
 
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

AcknowledgeableConditionTypeNode

protected AcknowledgeableConditionTypeNode(NodeManagerUaNode nodeManager,
                                           org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                           org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                           org.opcfoundation.ua.builtintypes.LocalizedText displayName)
NodeBuilder uses this, you should not call this yourself. If you do call it, you need to create the structure of the Node yourself

Method Detail

acknowledge

public void acknowledge(org.opcfoundation.ua.builtintypes.ByteString eventId,
                        org.opcfoundation.ua.builtintypes.LocalizedText comment,
                        org.opcfoundation.ua.builtintypes.DateTime ackTime,
                        org.opcfoundation.ua.builtintypes.ByteString userEventId)
                 throws StatusException
Acknowledged the condition, adds the comment to the eventId with ConditionTypeNode.addComment(ByteString, LocalizedText, DateTime, ByteString).

Also calls triggerEvent after acknowledging, to send a new event notification to the clients.

Parameters:
eventId - the event to acknowledge; use null to acknowledge the last event
comment - the comment to add
ackTime - the acknowledging time
userEventId - your custom Id for the new event that is sent about the acknowledging
Throws:
StatusException - Bad_ConditionBranchAlreadyAcked, if the condition is already acknowledged

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 AcknowledgeableConditionTypeNodeBase

confirm

public void confirm(org.opcfoundation.ua.builtintypes.ByteString eventId,
                    org.opcfoundation.ua.builtintypes.LocalizedText comment,
                    org.opcfoundation.ua.builtintypes.DateTime confirmTime,
                    org.opcfoundation.ua.builtintypes.ByteString userEventId)
             throws StatusException
Confirms the condition and adds the comment to the eventId with ConditionTypeNode.addComment(ByteString, LocalizedText, DateTime, ByteString).

Confirming the condition typically means that a corrective action has been taken and the condition should be recovering after this. It typically happens after the condition is acknowledged.

Also calls triggerEvent after confirming the condition, to send a new event notification to the clients.

Since ConfirmedState is an optional node in the condition, the method will only set the value if the node is defined. If the node is not defined, the method will not do anything.

Parameters:
eventId - the event to confirm; use null to confirm the last event
comment - the comment to add
confirmTime - the acknowledging time
userEventId - your custom Id for the new event that is sent about the acknowledging
Throws:
StatusException - Bad_ConditionBranchAlreadyConfirmed, if the condition is already confirmed

isAcked

public boolean isAcked()
Returns:
the acked

isConfirmed

public boolean isConfirmed()
Returns:
the confirmed status, which is the current value of the ConfirmedState/Id node. Since ConfirmedState is an optional node, the method will return false, if the node does not exist.

setAcked

public void setAcked(boolean acked)
Set the Acknowledged status of the condition. Use current time as the transition time.

Note: When Acked is set to false, Confirmed will also be set to false automatically, since the combination of Acked=false, Confirmed=true is an invalid state in OPC UA.

Parameters:
acked - the value of acked to set
See Also:
setConfirmed(boolean)

setAcked

public void setAcked(boolean acked,
                     org.opcfoundation.ua.builtintypes.DateTime ackTime)
Set the Acknowledged status of the condition.

Note: When Acked is set to false, Confirmed will also be set to false automatically, since the combination of Acked=false, Confirmed=true is an invalid state in OPC UA.

Parameters:
acked - the value of acked to set
ackTime - transitionTime for the change in acked state
See Also:
acknowledge(ByteString, LocalizedText, DateTime, ByteString), setConfirmed(boolean, DateTime)

setConfirmed

public void setConfirmed(boolean confirmed)
Set the Confirmed status of the condition. Use current time as the transition time.

Since ConfirmedState is an optional node in the condition, the method will only set the value if the node is defined. If the node is not defined, the method will not do anything.

Note: When Acked is set to false, Confirmed will also be set to false automatically, since the combination of Acked=false, Confirmed=true is an invalid state in OPC UA.

Parameters:
confirmed - the value of confirmed to set
See Also:
confirm(ByteString, LocalizedText, DateTime, ByteString), setAcked(boolean)

setConfirmed

public void setConfirmed(boolean confirmed,
                         org.opcfoundation.ua.builtintypes.DateTime confirmTime)
Set the Confirmed status of the condition.

Since ConfirmedState is an optional node in the condition, the method will only set the value if the node is defined. If the node is not defined, the method will not do anything.

Note: When Acked is set to false, Confirmed will also be set to false automatically, since the combination of Acked=false, Confirmed=true is an invalid state in OPC UA.

Parameters:
confirmed - the value of confirmed to set
confirmTime - transitionTime for the change in confirmed state
See Also:
confirm(ByteString, LocalizedText, DateTime, ByteString), setAcked(boolean, DateTime)

onAcknowledge

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

onConfirm

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


Copyright © 2018. All rights reserved.