public abstract class UaVariableNode extends UaInstanceNode implements UaVariable
UaVariable for UA Server side.
It reserves fields for all variable specific attributes, except for the Value attribute. See
CacheVariable for a base non-abstract implementation.
UaNode.Parameters| Modifier and Type | Field and Description |
|---|---|
static boolean |
synchronizeStructures
This flag controls are structure values synchronized between parent and child nodes.
|
NODE_VERSION_PROPERTY_NAME, useQuickPropertyLookupeventListeners, INITIALIZATION_TIME, nodeManager, supportedAttributesMap| Modifier | Constructor and Description |
|---|---|
|
UaVariableNode(NodeManagerUaNode nodeManager,
NodeId nodeId,
QualifiedName browseName,
LocalizedText displayName)
Create a new variable with dataTypeId initialized to BaseDataType.
|
|
UaVariableNode(NodeManagerUaNode nodeManager,
NodeId nodeId,
String name,
Locale locale)
Create a new variable with a specific data type.
|
protected |
UaVariableNode(UaNode.Parameters parameters) |
| Modifier and Type | Method and Description |
|---|---|
UaReference |
addProperty(UaProperty property)
Add a new property node to the node.
|
protected ReflectiveVariable |
addReflectiveVariable(Object reflectedObject,
NodeId nodeId,
String fieldName,
int nameSpaceIndex,
NodeId typeDefinitionId) |
protected boolean |
beforeAddReference(UaReference reference) |
protected void |
checkPropertyType(ExpandedNodeId typeDefinition) |
protected void |
checkPropertyType(NodeId nodeId) |
protected DataValue |
createDataValue(Object value) |
protected abstract void |
doSetValue(DataValue value)
Perform the actual value set.
|
protected void |
exposeStructureWithReflectiveVariables(Structure structure,
int nameSpaceIndex,
NodeId typeDefinitionId) |
AccessLevelType |
getAccessLevel()
Defines the global read/write access of the Value attribute for all users.
|
UnsignedInteger[] |
getArrayDimensions()
This Attribute specifies the length of each dimension for an array value.
|
NodeAttributes |
getAttributes()
Returns the current attribute values of the node in a NodeAttributes structure.
|
protected VariableAttributes |
getAttributes(VariableAttributes attributes) |
protected void |
getAttributesMap(Map<UnsignedInteger,Object> map) |
UaDataType |
getDataType() |
NodeId |
getDataTypeId() |
protected ExpandedNodeId |
getDefaultTypeDefinition() |
Boolean |
getHistorizing() |
Double |
getMinimumSamplingInterval() |
NodeClass |
getNodeClass()
The NodeClass Attribute identifies the NodeClass of a Node.
|
UaProperty[] |
getProperties()
Returns all properties of the node or null if none defined.
|
StatusCode |
getStatus() |
AccessLevelType |
getUserAccessLevel()
Defines the user specific read/write access of the Value attribute.
|
Integer |
getValueRank()
This Attribute indicates whether the Value Attribute of the Variable is an array and how many
dimensions the array has.
|
boolean |
hasUserWriteAccess(UnsignedInteger attributeId)
Overrides the default to check access to Value attribute from AccessLevel.
|
boolean |
hasWriteAccess(UnsignedInteger attributeId)
Overrides the default to check access to Value attribute from AccessLevel.
|
protected void |
initSupportedAttributes(List<UnsignedInteger> l) |
protected boolean |
isPropertyType() |
protected void |
notifyValueChanging(DataValue newValue) |
void |
notifyValueChanging(Object newValue) |
protected void |
readAttributeValue(UnsignedInteger attributeId,
DataValue dataValue)
Read the value of an attribute.
|
protected void |
semanticsChanged()
Set the SemanticsChanged bit of statusCodeChangeBits (to be sent with the next notification)
and add an entry to the SemanticChangeEvent.
|
void |
setAccessLevel(AccessLevelType accessLevel) |
void |
setArrayDimensions(UnsignedInteger[] arrayDimensions)
This Attribute specifies the length of each dimension for an array value.
|
void |
setAttributes(NodeAttributes nodeAttributes)
Sets the attributes of the node.
|
void |
setDataType(UaDataType dataType)
Set the Data Type node.
|
void |
setDataTypeId(NodeId dataTypeId)
Set the Data Type.
|
void |
setHistorizing(Boolean historizing) |
void |
setMinimumSamplingInterval(Double minimumSamplingInterval) |
void |
setStatus(StatusCode status)
Set the status of the variable.
|
void |
setTypeDefinition(UaType type)
Sets the type of the node.
|
void |
setTypeDefinitionId(ExpandedNodeId typeDefinition)
Sets the type definition to an ExpandedNodeId.
|
void |
setUserAccessLevel(AccessLevelType userAccessLevel) |
void |
setValue(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.
|
protected void |
structureChanged()
Set the StructureChanged bit of statusCodeChangeBits (to be sent with the next notification).
|
String |
toString() |
void |
updateValue(Object newValue)
Update the current value and status.
|
protected void |
updateValue(Object newValue,
StatusCode status,
DateTime sourceTime,
UnsignedShort sourcePicoseconds)
Update the current value and status.
|
protected void |
writeAttributeValue(UnsignedInteger attributeId,
Object value,
StatusCode statusCode,
DateTime sourceTime,
UnsignedShort sourcePicoseconds) |
addModellingRule, getTypeDefinition, getTypeDefinitionId, hasTypeDefinition, registerOverridePlainMethod, setTypeDefinitionId, supportsTypeDefinitionNodeaddPlainProperty, addPlainVariable, assertTypeSupport, assertTypeSupport, createNodeId, createNodeId, createReflectiveInstanceProperty, createReflectiveInstanceProperty, deleteReference, deleteReference, doAddProperty, getAttributes, getAttributesMap, getBrowseName, getComponent, getComponents, getDescription, getDescription, getDisplayName, getDisplayName, getMethod, getNodeVersion, getNodeVersionNode, getProperty, getPropertyReference, getPropertyValue, getReferencesAsList, getStandardBrowseName, getStandardDisplayText, getUserWriteMask, getWriteMask, hasProperty, hasReference, incNodeVersion, initNodeVersion, isChildOfType, readAttribute, readAttribute, registerCallbackProperty, registerPlainInstanceProperty, registerPlainInstanceProperty, registerPlainProperty, registerPlainProperty, registerPlainVariable, registerPlainVariable, registerReflectiveInstanceProperty, registerReflectiveInstanceVariable, registerReflectiveProperty, registerReflectiveVariable, removeProperty, setAccessLevelRecursively, setAccessLevelRecursively, setAttribute, setBrowseName, setDescription, setDisplayName, setNodeVersion, setPropertyValue, setUserWriteMask, setWriteMask, writeAttributeaddComponent, 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, getNodeSetExtensions, getReference, getReferenceList, getReferences, getSupportedAttributes, getTargetNodes, getUaNodeId, hashCode, isAddNotifierReferencesToServerObject, isFalseOrNull, isMandatory, isMonitoredForEvents, isTrueOrNull, isType, referenceTypeInherits, removeComponent, removeDataChangeListener, removeEventListener, setAddNotifierReferencesToServerObject, setNodeSetExtensions, setReferences, supportsAttribute, translateBrowsePathToNodeIds, validateHasEventSourceChain, validateHasEventSourceChaingetForwardReferences, getInverseReferences, getReferences, getReferences, getUserData, referenceTypeInherits, setUserDataclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddDataChangeListener, removeDataChangeListenergetTypeDefinition, getTypeDefinitionId, setTypeDefinitionIdgetValueaddComponent, addOrganizes, addReference, addReference, addReference, addReference, addReference, addReference, deleteReference, deleteReference, deleteReference, deleteReference, getAddressSpace, getAttributesMap, getBrowseName, getBrowsePaths, getComponent, getComponents, getDescription, getDisplayName, getForwardReferences, getInverseReferences, getMethod, getNodeId, getNodeVersionNode, getOrganizedNode, getOrganizedNodes, getProperty, getReference, getReferences, getReferences, getSupportedAttributes, getUaBrowsePaths, getUaNodeId, getUserData, getUserWriteMask, getWriteMask, readAttribute, readAttribute, removeComponent, removeProperty, setAttribute, setBrowseName, setDescription, setDisplayName, setReferences, setUserData, setUserWriteMask, setWriteMask, supportsAttribute, writeAttributepublic static boolean synchronizeStructures
public UaVariableNode(NodeManagerUaNode nodeManager, NodeId nodeId, QualifiedName browseName, LocalizedText displayName)
nodeId - browseName - displayName - public UaVariableNode(NodeManagerUaNode nodeManager, NodeId nodeId, String name, Locale locale)
nodeId - The variable ID.name - The name used for browseName & displayNamelocale - The locale of displayNamedataTypeId - The variable data type as a NodeId.protected UaVariableNode(UaNode.Parameters parameters)
public UaReference addProperty(UaProperty property)
UaNodeAdds a new forward HasProperty reference with target to the property node.
addProperty in interface UaNodeaddProperty in class ServerNodeproperty - the property to add to the nodepublic AccessLevelType getAccessLevel()
UaVariableIn contrast to the WriteAccess this attribute only applies to the Value attribute.
getAccessLevel in interface UaVariableUaVariable.getUserAccessLevel()public UnsignedInteger[] getArrayDimensions()
UaValueNodeThe 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.
getArrayDimensions in interface UaValueNodeUaValueNode.setArrayDimensions(com.prosysopc.ua.stack.builtintypes.UnsignedInteger[])public NodeAttributes getAttributes()
UaNodegetAttributes in interface UaNodegetAttributes in class BaseNodepublic UaDataType getDataType()
getDataType in interface UaValueNodeUaValueNode.getDataTypeId()public NodeId getDataTypeId()
getDataTypeId in interface UaValueNodepublic Boolean getHistorizing()
getHistorizing in interface UaVariablepublic Double getMinimumSamplingInterval()
getMinimumSamplingInterval in interface UaVariablepublic final NodeClass getNodeClass()
UaNodegetNodeClass in interface UaNodegetNodeClass in class BaseNodepublic UaProperty[] getProperties()
UaNodegetProperties in interface UaNodegetProperties in class BaseNodepublic StatusCode getStatus()
public AccessLevelType getUserAccessLevel()
UaVariableIn contrast to the UserWriteAccess this attribute only applies to the Value attribute.
getUserAccessLevel in interface UaVariableUaVariable.getAccessLevel()public Integer getValueRank()
UaValueNodeIt may have the following values:
getValueRank in interface UaValueNodeUaValueNode.setValueRank(int)public boolean hasUserWriteAccess(UnsignedInteger attributeId)
hasUserWriteAccess in interface UaNodehasUserWriteAccess in class BaseNodeattributeId - public boolean hasWriteAccess(UnsignedInteger attributeId)
hasWriteAccess in interface UaNodehasWriteAccess in class BaseNodeattributeId - public void notifyValueChanging(Object newValue)
public void setAccessLevel(AccessLevelType accessLevel)
setAccessLevel in interface UaVariableaccessLevel - the access level to setUaVariable.getAccessLevel()public void setArrayDimensions(UnsignedInteger[] arrayDimensions)
UaValueNodeThe 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.
setArrayDimensions in interface UaValueNodepublic void setAttributes(NodeAttributes nodeAttributes)
UaNodesetAttributes in interface UaNodesetAttributes in class BaseNodepublic void setDataType(UaDataType dataType)
UaValueNodesetDataType in interface UaValueNodeUaValueNode.setDataTypeId(NodeId)public void setDataTypeId(NodeId dataTypeId)
UaValueNodesetDataTypeId in interface UaValueNodeUaValueNode.setDataTypeId(NodeId)public void setHistorizing(Boolean historizing)
setHistorizing in interface UaVariablehistorizing - define that the variable has history - or notpublic void setMinimumSamplingInterval(Double minimumSamplingInterval)
setMinimumSamplingInterval in interface UaVariableminimumSamplingInterval - define the minimum sampling intervalpublic void setStatus(StatusCode status)
The sourceTimestamp is set to null, and serverTimestamp is set to the current time.
status - the status to setpublic void setTypeDefinition(UaType type)
UaInstanceNodesetTypeDefinition in interface UaInstancesetTypeDefinition in class UaInstanceNodetype - The type to setUaInstance.getTypeDefinitionId(),
UaInstance.getTypeDefinition(),
UaInstance.setTypeDefinitionId(ExpandedNodeId),
UaInstance.setTypeDefinitionId(NodeId)public void setTypeDefinitionId(ExpandedNodeId typeDefinition)
UaInstancesetTypeDefinitionId in interface UaInstancesetTypeDefinitionId in class UaInstanceNodetypeDefinition - the type definition Id to setUaInstance.getTypeDefinitionId(),
UaInstance.getTypeDefinition(),
UaInstance.setTypeDefinition(UaType),
UaInstance.setTypeDefinitionId(NodeId)public void setUserAccessLevel(AccessLevelType userAccessLevel)
setUserAccessLevel in interface UaVariableuserAccessLevel - the user access level to setUaVariable.getUserAccessLevel()public void setValue(DataValue value) throws StatusException
UaValueNodesetValue in interface UaValueNodevalue - the default value to setStatusExceptionpublic void setValue(Object value) throws StatusException
setValue in interface UaValueNodevalue - a new valueStatusException - if the value is invalid for the Value attributepublic void setValueRank(int valueRank)
UaValueNodeIt may have the following values:
setValueRank in interface UaValueNodevalueRank - the value rank to setpublic String toString()
toString in class UaInstanceNodepublic void updateValue(Object newValue) throws StatusException
newValue - The new value for the variable. This should be of the correct DataType or a
Variant. Or it can be a DataValue, in which case, it is copied to value with a new
timestamp.StatusException - if newValue is not valid for the variableprotected ReflectiveVariable addReflectiveVariable(Object reflectedObject, NodeId nodeId, String fieldName, int nameSpaceIndex, NodeId typeDefinitionId) throws SecurityException, NoSuchMethodException
reflectedObject - nodeId - fieldName - nameSpaceIndex - typeDefinitionId - NoSuchMethodExceptionSecurityExceptionprotected boolean beforeAddReference(UaReference reference)
beforeAddReference in class UaInstanceNodeprotected void checkPropertyType(ExpandedNodeId typeDefinition)
protected void checkPropertyType(NodeId nodeId)
nodeId - IllegalArgumentExceptionprotected abstract void doSetValue(DataValue value) throws StatusException
value - StatusExceptionprotected void exposeStructureWithReflectiveVariables(Structure structure, int nameSpaceIndex, NodeId typeDefinitionId)
structure - a Structure type, auto-generated to the stack. It must define fields with
capitalized names, e.g. "FieldName"typeDefinitionId - SecurityExceptionRuntimeExceptionprotected VariableAttributes getAttributes(VariableAttributes attributes)
protected void getAttributesMap(Map<UnsignedInteger,Object> map)
getAttributesMap in class BaseNodeprotected ExpandedNodeId getDefaultTypeDefinition()
getDefaultTypeDefinition in class UaInstanceNodeprotected void initSupportedAttributes(List<UnsignedInteger> l)
initSupportedAttributes in class ServerNodeprotected boolean isPropertyType()
protected void notifyValueChanging(DataValue newValue)
protected void readAttributeValue(UnsignedInteger attributeId, DataValue dataValue) throws StatusException
BaseNodereadAttributeValue in class BaseNodeattributeId - the ID of the attribute to read.dataValue - the DataValue structure in which the value is set.StatusException - if the attributeId is not valid for this (base) node implementation.protected void semanticsChanged()
protected void structureChanged()
protected void updateValue(Object newValue, StatusCode status, DateTime sourceTime, UnsignedShort sourcePicoseconds) throws StatusException
newValue - The new value for the variable. This should be of the correct DataType or a
Variant. Or it can be a DataValue, in which case, it is copied to value with a new
timestamp.status - The new status for the variable.sourceTimestamp - source timestamp, if null current time is usedStatusException - if newValue is not valid for the variableprotected void writeAttributeValue(UnsignedInteger attributeId, Object value, StatusCode statusCode, DateTime sourceTime, UnsignedShort sourcePicoseconds) throws StatusException
writeAttributeValue in class BaseNodeStatusExceptionCopyright © 2026. All rights reserved.