com.prosysopc.ua.server.nodes
Class UaViewNode

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.UaViewNode
All Implemented Interfaces:
UaNode, UaView

public class UaViewNode
extends BaseNode
implements UaView

Straight forward implementation of UaView.

It keeps all attributes in memory.


Field Summary
 
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
 
Constructor Summary
UaViewNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
           
UaViewNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, Locale locale)
           
 
Method Summary
 UaReference addProperty(UaProperty property)
          Add a new property node to the node.
protected  boolean beforeAddReference(UaReference reference)
           
 org.opcfoundation.ua.core.NodeAttributes getAttributes()
           
protected  org.opcfoundation.ua.core.NodeAttributes getAttributes(org.opcfoundation.ua.core.ViewAttributes attributes)
           
 Boolean getContainsNoLoops()
          If set to true this Attribute indicates that following References in the context of the View contains no loops, i.e. starting from a Node 'A' contained in the View and following the forward References in the context of the View Node 'A' will not be reached again.
 EnumSet<EventNotifierClass> getEventNotifier()
          Defines whether the node can be used to subscribe to events.
 org.opcfoundation.ua.core.NodeClass getNodeClass()
          The NodeClass Attribute identifies the NodeClass of a Node.
 UaProperty getViewVersion()
          The version number for the View.
protected  void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
           
protected  void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Read the value of an attribute.
 void setAttributes(org.opcfoundation.ua.core.NodeAttributes nodeAttributes)
           
 void setContainsNoLoops(Boolean containsNoLoops)
           
 void setEventNotifier(EnumSet<EventNotifierClass> eventNotifier)
           
protected  void setViewVersion(Integer viewVersion)
          Set the value of the ViewVersion property.
 String toString()
           
protected  void writeAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, Object value, org.opcfoundation.ua.builtintypes.StatusCode statusCode, org.opcfoundation.ua.builtintypes.DateTime sourceTime, org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
           
 
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, hasTypeDefinition, 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, addReference, addReference, addReference, addReference, addReference, addReference, afterAddReference, 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.nodes.UaNode
addComponent, addReference, addReference, addReference, deleteReference, deleteReference, deleteReference, deleteReference, getAddressSpace, getBrowseName, getComponent, getComponents, getDescription, getDisplayName, getForwardReferences, getInverseReferences, getMethod, getNodeId, getNodeVersion, getProperties, getProperty, getReference, getReferences, getReferences, getSupportedAttributes, getUserWriteMask, getWriteMask, hasUserWriteAccess, hasWriteAccess, readAttribute, readAttribute, removeComponent, removeProperty, setAttribute, setBrowseName, setDescription, setDisplayName, setReferences, setUserWriteMask, setWriteMask, supportsAttribute, writeAttribute
 

Constructor Detail

UaViewNode

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

UaViewNode

public UaViewNode(NodeManagerUaNode nodeManager,
                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                  String name,
                  Locale locale)
Method Detail

addProperty

public UaReference addProperty(UaProperty property)
Description copied from interface: UaNode
Add a new property node to the node. All other node types can have properties, except property nodes.

Adds a new forward HasProperty reference with target to the property node.

Specified by:
addProperty in interface UaNode
Overrides:
addProperty in class ServerNode
Parameters:
property - the property to add to the node
Returns:
the property reference that was added (or existed already) or null, if the reference type is not supported by the node (i.e. UaProperty may not have HasProperty references).

getAttributes

public org.opcfoundation.ua.core.NodeAttributes getAttributes()
Specified by:
getAttributes in interface UaNode
Specified by:
getAttributes in class BaseNode
Returns:
the current attribute values of the node in a NodeAttributes structure.

getContainsNoLoops

public Boolean getContainsNoLoops()
Description copied from interface: UaView
If set to true this Attribute indicates that following References in the context of the View contains no loops, i.e. starting from a Node 'A' contained in the View and following the forward References in the context of the View Node 'A' will not be reached again. It does not specify that there is only one path starting from the View Node to reach a Node contained in the View. If set to false this Attribute indicates that following References in the context of the View may lead to loops. (OPC UA Specification, Part 3.)

Specified by:
getContainsNoLoops in interface UaView
Returns:
whether the view contains loops or not.

getEventNotifier

public EnumSet<EventNotifierClass> getEventNotifier()
Description copied from interface: UaView
Defines whether the node can be used to subscribe to events. The set can contain one or several of the following values.
Value Description
SubscribeToEvents Indicates if it can be used to subscribe to Events (0 means cannot be used to subscribe to Events, 1 means can be used to subscribe to Events).
HistoryRead Indicates if the history of the Events is readable (0 means not readable, 1 means readable).
HistoryWrite Indicates if the history of the Events is writable (0 means not writable, 1 means writable).
HistoryRead and HistoryWrite also indicate if the history of the Events is available via the OPC UA server.

Specified by:
getEventNotifier in interface UaView
Returns:
the current value of the EventNotifier attribute

getNodeClass

public final org.opcfoundation.ua.core.NodeClass getNodeClass()
Description copied from interface: UaNode
The NodeClass Attribute identifies the NodeClass of a Node.

Specified by:
getNodeClass in interface UaNode
Overrides:
getNodeClass in class BaseNode
Returns:
the Node Class of the node. This is hard-coded and cannot be changed.

getViewVersion

public UaProperty getViewVersion()
Description copied from interface: UaView
The version number for the View. When Nodes are added to or removed from a View, the value of the ViewVersion Property is updated. Clients may detect changes to the composition of a View using this Property. The value of the ViewVersion shall always be greater than 0. (OPC UA Specification, Part 3.)

Specified by:
getViewVersion in interface UaView
Returns:
the ViewVersion property. This is an optional property, so it may be null, if the property is not defined.

setAttributes

public void setAttributes(org.opcfoundation.ua.core.NodeAttributes nodeAttributes)
Specified by:
setAttributes in interface UaNode
Overrides:
setAttributes in class BaseNode

setContainsNoLoops

public void setContainsNoLoops(Boolean containsNoLoops)
Specified by:
setContainsNoLoops in interface UaView
Parameters:
containsNoLoops - the value of containsNoLoops to set
See Also:
UaView.getContainsNoLoops()

setEventNotifier

public void setEventNotifier(EnumSet<EventNotifierClass> eventNotifier)
Specified by:
setEventNotifier in interface UaView
Parameters:
eventNotifier - the value of Eventnotifier to set
See Also:
UaView.getEventNotifier()

toString

public String toString()
Overrides:
toString in class BaseNode

beforeAddReference

protected boolean beforeAddReference(UaReference reference)
Overrides:
beforeAddReference in class ServerNode
Returns:

getAttributes

protected org.opcfoundation.ua.core.NodeAttributes getAttributes(org.opcfoundation.ua.core.ViewAttributes attributes)

initSupportedAttributes

protected void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
Overrides:
initSupportedAttributes in class ServerNode

readAttributeValue

protected void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                  org.opcfoundation.ua.builtintypes.DataValue dataValue)
                           throws StatusException
Description copied from class: BaseNode
Read the value of an attribute.

Overrides:
readAttributeValue in class BaseNode
Parameters:
attributeId - the ID of the attribute to read.
dataValue - the DataValue structure in which the value is set.
Throws:
StatusException

setViewVersion

protected void setViewVersion(Integer viewVersion)
                       throws StatusException
Set the value of the ViewVersion property. Assumes that the property has already been defined.

Parameters:
viewVersion -
Throws:
StatusException

writeAttributeValue

protected void writeAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                   Object value,
                                   org.opcfoundation.ua.builtintypes.StatusCode statusCode,
                                   org.opcfoundation.ua.builtintypes.DateTime sourceTime,
                                   org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
                            throws StatusException
Overrides:
writeAttributeValue in class BaseNode
Throws:
StatusException


Copyright © 2018. All rights reserved.