com.prosysopc.ua.server.nodes
Class UaVariableTypeNode

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.UaTypeNode
                  extended by com.prosysopc.ua.server.nodes.UaVariableTypeNode
All Implemented Interfaces:
UaNode, UaType, UaValueNode, UaVariableType

public class UaVariableTypeNode
extends UaTypeNode
implements UaVariableType

Straight forward implementation of UaVariableType.

It keeps all attributes in memory.


Field Summary
 
Fields inherited from class com.prosysopc.ua.server.nodes.UaTypeNode
javaClass
 
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
UaVariableTypeNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
           
UaVariableTypeNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, Locale locale)
          Create a new node with name to be used for browseName and displayName.
 
Method Summary
 org.opcfoundation.ua.builtintypes.UnsignedInteger[] getArrayDimensions()
          This Attribute specifies the length of each dimension for an array value.
 org.opcfoundation.ua.core.NodeAttributes getAttributes()
           
protected  org.opcfoundation.ua.core.VariableTypeAttributes getAttributes(org.opcfoundation.ua.core.VariableTypeAttributes attributes)
           
 UaType getDataType()
           
 org.opcfoundation.ua.builtintypes.NodeId getDataTypeId()
           
 org.opcfoundation.ua.core.NodeClass getNodeClass()
          The NodeClass Attribute identifies the NodeClass of a Node.
 org.opcfoundation.ua.builtintypes.DataValue getValue()
           
 Integer getValueRank()
          This Attribute indicates whether the Value Attribute of the Variable is an array and how many dimensions the array has.
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 setArrayDimensions(org.opcfoundation.ua.builtintypes.UnsignedInteger[] ArrayDimensions)
          This Attribute specifies the length of each dimension for an array value.
 void setAttributes(org.opcfoundation.ua.core.NodeAttributes nodeAttributes)
           
 void setDataType(UaType dataType)
          Set the Data Type node.
 void setDataTypeId(org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
          Set the Data Type.
 void setValue(org.opcfoundation.ua.builtintypes.DataValue value)
          The default Value for instances of this type.
 void setValue(Object value)
          Set value.
 void setValueRank(int valueRank)
          This Attribute indicates whether the Value Attribute of the VariableType is an array and how many dimensions the array has.
 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.UaTypeNode
addSubType, afterAddReference, beforeAddReference, getComponent, getInstanceDeclarationHierarchy, getIsAbstract, getJavaClass, getSuperType, hasSuperType, inheritsFrom, inheritsFrom, resetInstanceDeclarationHierarchy, setIsAbstract, setJavaClass, setSuperType
 
Methods inherited from class com.prosysopc.ua.server.nodes.BaseNode
addPlainProperty, addPlainVariable, assertTypeSupport, assertTypeSupport, createNodeId, createNodeId, createReflectiveInstanceProperty, createReflectiveInstanceProperty, deleteReference, deleteReference, doAddProperty, getAttributes, getBrowseName, 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, 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.nodes.UaType
addSubType, getIsAbstract, getJavaClass, getSuperType, hasSuperType, inheritsFrom, inheritsFrom, setIsAbstract, setJavaClass, setSuperType
 
Methods inherited from interface com.prosysopc.ua.nodes.UaNode
addComponent, addProperty, 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

UaVariableTypeNode

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

UaVariableTypeNode

public UaVariableTypeNode(NodeManagerUaNode nodeManager,
                          org.opcfoundation.ua.builtintypes.NodeId nodeId,
                          String name,
                          Locale locale)
Create a new node with name to be used for browseName and displayName.

Parameters:
nodeId -
name -
locale -
Method Detail

getArrayDimensions

public org.opcfoundation.ua.builtintypes.UnsignedInteger[] getArrayDimensions()
Description copied from interface: UaValueNode
This Attribute specifies the length of each dimension for an array value. The Attribute is intended to describe the capability of the Variable, not the current size.

The number of elements shall be equal to the value of the ValueRank Attribute. Shall be null if ValueRank <= 0.

A value of 0 for an individual dimension indicates that the dimension has a variable length.

For example, if a Variable is defined by the following C array: Int32 myArray[346];

then this Variable's DataType would point to an Int32, the Variable's ValueRank has the value 1 and the ArrayDimensions is an array with one entry having the value 346.

Specified by:
getArrayDimensions in interface UaValueNode
Returns:
the array dimensions of the variable type or null if this is not a specific array type, i.e. ValueRank <= 0
See Also:
UaValueNode.setArrayDimensions(org.opcfoundation.ua.builtintypes.UnsignedInteger[])

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.

getDataType

public UaType getDataType()
Specified by:
getDataType in interface UaValueNode
Returns:
the DataType node, if set.
See Also:
UaValueNode.getDataTypeId()

getDataTypeId

public org.opcfoundation.ua.builtintypes.NodeId getDataTypeId()
Specified by:
getDataTypeId in interface UaValueNode
Returns:
NodeId of the data type definition for instances of this type.

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.

getValue

public org.opcfoundation.ua.builtintypes.DataValue getValue()
Specified by:
getValue in interface UaValueNode
Returns:
The default Value for instances of this type.

getValueRank

public Integer getValueRank()
Description copied from interface: UaValueNode
This Attribute indicates whether the Value Attribute of the Variable is an array and how many dimensions the array has.

It may have the following values:

Specified by:
getValueRank in interface UaValueNode
Returns:
the value rank
See Also:
UaValueNode.setValueRank(int)

setArrayDimensions

public void setArrayDimensions(org.opcfoundation.ua.builtintypes.UnsignedInteger[] ArrayDimensions)
Description copied from interface: UaValueNode
This Attribute specifies the length of each dimension for an array value. The Attribute is intended to describe the capability of the VariableType, not the current size.

The number of elements shall be equal to the value of the ValueRank Attribute. Shall be null if ValueRank <= 0.

A value of 0 for an individual dimension indicates that the dimension has a variable length.

For example, if a VariableType is defined by the following array:

Integer[] myArray = new Integer[346];

then this VariableType's DataType would point to the Int32 data type node, the VariableType's ValueRank has the value 1 and the ArrayDimensions is an array with one entry having the value 346.

Specified by:
setArrayDimensions in interface UaValueNode

setAttributes

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

setDataType

public void setDataType(UaType dataType)
Description copied from interface: UaValueNode
Set the Data Type node.

Specified by:
setDataType in interface UaValueNode
See Also:
UaValueNode.setDataTypeId(NodeId)

setDataTypeId

public void setDataTypeId(org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
Description copied from interface: UaValueNode
Set the Data Type.

Specified by:
setDataTypeId in interface UaValueNode
See Also:
UaValueNode.setDataTypeId(NodeId)

setValue

public void setValue(org.opcfoundation.ua.builtintypes.DataValue value)
Description copied from interface: UaValueNode
The default Value for instances of this type.

Specified by:
setValue in interface UaValueNode
Parameters:
value - the default value to set

setValue

public void setValue(Object value)
              throws StatusException
Set value.

Specified by:
setValue in interface UaValueNode
Parameters:
value - a new value. The value may be a DataValue, Variant or any "OPC UA compliant" value, i.e. value which can be used to initialize a Variant.
Throws:
StatusException - if the value is invalid for the Value attribute

setValueRank

public void setValueRank(int valueRank)
Description copied from interface: UaValueNode
This Attribute indicates whether the Value Attribute of the VariableType is an array and how many dimensions the array has.

It may have the following values:

Specified by:
setValueRank in interface UaValueNode
Parameters:
valueRank - the value rank to set

toString

public String toString()
Overrides:
toString in class UaTypeNode

getAttributes

protected org.opcfoundation.ua.core.VariableTypeAttributes getAttributes(org.opcfoundation.ua.core.VariableTypeAttributes attributes)

initSupportedAttributes

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

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 UaTypeNode
Parameters:
attributeId - the ID of the attribute to read.
dataValue - the DataValue structure in which the value is set.
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 UaTypeNode
Throws:
StatusException


Copyright © 2018. All rights reserved.