com.prosysopc.ua.client.nodes
Class UaVariableTypeImpl

java.lang.Object
  extended by com.prosysopc.ua.nodes.AbstractUaNode
      extended by com.prosysopc.ua.client.nodes.UaNodeImpl
          extended by com.prosysopc.ua.client.nodes.UaTypeImpl
              extended by com.prosysopc.ua.client.nodes.UaVariableTypeImpl
All Implemented Interfaces:
UaNode, UaType, UaValueNode, UaVariableType

public class UaVariableTypeImpl
extends UaTypeImpl
implements UaVariableType

Straight forward implementation of UaVariableType.

It keeps all attributes in memory.


Field Summary
 
Fields inherited from class com.prosysopc.ua.client.nodes.UaTypeImpl
javaClass
 
Fields inherited from class com.prosysopc.ua.client.nodes.UaNodeImpl
addressSpace, logger, references, supportedAttributesMap
 
Constructor Summary
UaVariableTypeImpl(AddressSpace addressSpace, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
           
UaVariableTypeImpl(AddressSpace addressSpace, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName, org.opcfoundation.ua.builtintypes.LocalizedText description, EnumSet<WriteAccess> writeMask, EnumSet<WriteAccess> userWriteMask, UaClientReference[] references, UaProperty[] properties, org.opcfoundation.ua.builtintypes.DataValue value, org.opcfoundation.ua.builtintypes.NodeId dataType, Integer valueRank, org.opcfoundation.ua.builtintypes.UnsignedInteger[] arrayDimensions, Boolean isAbstract)
           
UaVariableTypeImpl(AddressSpace addressSpace, 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 setAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Unconditionally, set the value of the specified attribute.
 void setAttributes(org.opcfoundation.ua.core.VariableTypeAttributes variableTypeAttributes)
           
 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.
 boolean supportsAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
          Check if the node supports the specified attribute.
 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.client.nodes.UaTypeImpl
addSubType, getIsAbstract, getJavaClass, getSuperType, hasSuperType, inheritsFrom, inheritsFrom, setIsAbstract, setJavaClass, setSuperType
 
Methods inherited from class com.prosysopc.ua.client.nodes.UaNodeImpl
addComponent, addProperties, addProperty, addReference, addReference, addReference, addReference, afterAddReference, afterDeleteReference, assertTypeSupport, assertTypeSupport, beforeAddReference, deleteReference, deleteReference, deleteReference, deleteReference, deleteReferences, doAddProperty, equals, findPlaceholders, getAddressSpace, getAttributes, getBrowseName, getComponent, getComponents, getDescription, getDescription, getDisplayName, getDisplayName, getMethod, getNodeId, getNodeVersion, getNodeVersionString, getProperties, getProperty, getPropertyValue, getReference, getReferenceList, getReferences, getSupportedAttributes, getUserWriteMask, getWriteMask, hashCode, hasProperty, hasTypeDefinition, hasUserWriteAccess, hasWriteAccess, readAttribute, readAttribute, referenceTypeInherits, removeComponent, removeProperty, setAttributes, setBrowseName, setDescription, setDisplayName, setNodeVersion, setPropertyValue, setReferences, setUserWriteMask, setWriteMask, writeAttribute
 
Methods inherited from class com.prosysopc.ua.nodes.AbstractUaNode
getForwardReferences, getInverseReferences, getReferences, getReferences, getReferencesAsList, 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, setAttributes, setBrowseName, setDescription, setDisplayName, setReferences, setUserWriteMask, setWriteMask, writeAttribute
 

Constructor Detail

UaVariableTypeImpl

public UaVariableTypeImpl(AddressSpace addressSpace,
                          org.opcfoundation.ua.builtintypes.NodeId nodeId,
                          org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                          org.opcfoundation.ua.builtintypes.LocalizedText displayName)

UaVariableTypeImpl

public UaVariableTypeImpl(AddressSpace addressSpace,
                          org.opcfoundation.ua.builtintypes.NodeId nodeId,
                          org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                          org.opcfoundation.ua.builtintypes.LocalizedText displayName,
                          org.opcfoundation.ua.builtintypes.LocalizedText description,
                          EnumSet<WriteAccess> writeMask,
                          EnumSet<WriteAccess> userWriteMask,
                          UaClientReference[] references,
                          UaProperty[] properties,
                          org.opcfoundation.ua.builtintypes.DataValue value,
                          org.opcfoundation.ua.builtintypes.NodeId dataType,
                          Integer valueRank,
                          org.opcfoundation.ua.builtintypes.UnsignedInteger[] arrayDimensions,
                          Boolean isAbstract)

UaVariableTypeImpl

public UaVariableTypeImpl(AddressSpace addressSpace,
                          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
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 UaNodeImpl
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

setAttribute

public void setAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                         org.opcfoundation.ua.builtintypes.DataValue dataValue)
                  throws StatusException
Description copied from class: UaNodeImpl
Unconditionally, set the value of the specified attribute. To check the access rights and that the attribute is supported by the node, use writeAttribute. The method calls the internal, overridable, writeAttributeValue.

Specified by:
setAttribute in interface UaNode
Overrides:
setAttribute in class UaNodeImpl
Throws:
StatusException

setAttributes

public void setAttributes(org.opcfoundation.ua.core.VariableTypeAttributes variableTypeAttributes)

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

supportsAttribute

public boolean supportsAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Description copied from interface: UaNode
Check if the node supports the specified attribute.

Use the method to check if the node object you have is actually supporting a specific UA Attribute. The supported attributes are available from specific Java properties, and the values can also be read with UaNode.readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger).

Specified by:
supportsAttribute in interface UaNode
Overrides:
supportsAttribute in class UaNodeImpl
Parameters:
attributeId - the attribute to check - the valid values are defined in Attributes
Returns:
true if the node supports the attribute

toString

public String toString()
Overrides:
toString in class UaTypeImpl

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 UaTypeImpl

readAttributeValue

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

Overrides:
readAttributeValue in class UaTypeImpl
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 UaTypeImpl
Throws:
StatusException


Copyright © 2018. All rights reserved.