public abstract class BaseNode extends ServerNode
UaNode.
It keeps all attributes in memory.
This is an abstract class, as the UA specification does not enable nodes of the generic class. The nodes must be one of the actual types for the specific node classes.
UaNode.Parameters| Modifier and Type | Field and Description |
|---|---|
static QualifiedName |
NODE_VERSION_PROPERTY_NAME |
static boolean |
useQuickPropertyLookup
Deprecated.
this flag will be removed in the future; If you use this let support know that this
functionality is still needed.
|
eventListeners, INITIALIZATION_TIME, nodeManager, supportedAttributesMap| Modifier | Constructor and Description |
|---|---|
protected |
BaseNode(NodeManagerUaNode nodeManager,
NodeId nodeId) |
|
BaseNode(NodeManagerUaNode nodeManager,
NodeId nodeId,
QualifiedName browseName,
LocalizedText displayName)
Create a new node.
|
|
BaseNode(NodeManagerUaNode nodeManager,
NodeId nodeId,
String name,
Locale locale) |
protected |
BaseNode(UaNode.Parameters parameters) |
| Modifier and Type | Method and Description |
|---|---|
protected <T> PlainProperty<T> |
addPlainProperty(NodeId nodeId,
String name)
Creates a new PlainProperty
|
protected <T> PlainVariable<T> |
addPlainVariable(NodeId nodeId,
String name)
Creates a new PlainVariable
|
protected void |
assertTypeSupport(ExpandedNodeId typeDefinition) |
protected void |
assertTypeSupport(NodeId typeDefinition) |
NodeId |
createNodeId(UaNode parent,
String name)
Create a new string type NodeId as "
|
protected NodeId |
createNodeId(UaNode parent,
String name,
int namespaceIndex)
Create a new string type NodeId as "
|
protected ReflectiveInstanceProperty |
createReflectiveInstanceProperty(String name,
NodeId instanceDeclarationId) |
protected ReflectiveInstanceProperty |
createReflectiveInstanceProperty(String name,
NodeId instanceDeclarationId,
NodeId nodeId) |
UaReference |
deleteReference(ExpandedNodeId targetNodeId,
NodeId referenceTypeId,
boolean isInverse)
Delete a reference from the node.
|
UaReference |
deleteReference(UaReference reference)
Delete a reference from the node.
|
protected boolean |
doAddProperty(UaProperty property) |
abstract NodeAttributes |
getAttributes()
Returns the current attribute values of the node in a NodeAttributes structure.
|
protected NodeAttributes |
getAttributes(NodeAttributes attributes) |
Map<UnsignedInteger,Object> |
getAttributesMap()
Returns an unmodifiable
Map containing the Attributes of the node. |
protected void |
getAttributesMap(Map<UnsignedInteger,Object> map) |
QualifiedName |
getBrowseName()
Nodes have a BrowseName Attribute that is used as a non-localised human-readable name when
browsing the AddressSpace to create paths out of BrowseNames.
|
UaNode |
getComponent(QualifiedName componentName)
Get the component, which has the specified name.
|
UaNode[] |
getComponents()
Get a list of components of this node, i.e.
|
LocalizedText |
getDescription()
The optional Description Attribute shall explain the meaning of the Node in a localized text
using the same mechanisms for localization as described for the DisplayName.
|
LocalizedText |
getDescription(Locale locale) |
LocalizedText |
getDisplayName()
The DisplayName Attribute contains the localised name of the Node.
|
LocalizedText |
getDisplayName(Locale locale) |
UaMethod |
getMethod(QualifiedName methodName)
Get the method, which has the specified name.
|
NodeClass |
getNodeClass()
The NodeClass Attribute identifies the NodeClass of a Node.
|
String |
getNodeVersion() |
UaProperty |
getNodeVersionNode()
Returns the NodeVersion property.
|
UaProperty[] |
getProperties()
Returns all properties of the node or null if none defined.
|
UaProperty |
getProperty(QualifiedName name)
Get the property with name.
|
protected UaReference |
getPropertyReference(QualifiedName propertyName)
This method should only be called by the SDK itself.
|
DataValue |
getPropertyValue(QualifiedName propertyName)
Get the value of a property.
|
protected List<UaReference> |
getReferencesAsList(Boolean isInverse,
NodeId... referenceTypeIds) |
protected static QualifiedName |
getStandardBrowseName(String name) |
protected static LocalizedText |
getStandardDisplayText(String name) |
AttributeWriteMask |
getUserWriteMask()
The optional UserWriteMask Attribute exposes the possibilities of a client to write the
Attributes of the Node taking user access rights into account.
|
AttributeWriteMask |
getWriteMask()
The optional WriteMask Attribute exposes the possibilities of a client to write the Attributes
of the Node.
|
boolean |
hasProperty(QualifiedName propertyName) |
protected UaReference |
hasReference(UaReference reference) |
boolean |
hasTypeDefinition() |
boolean |
hasUserWriteAccess(UnsignedInteger attributeId)
Checks additional user access rights to the node.
|
boolean |
hasWriteAccess(UnsignedInteger attributeId)
Check the common access rights of a node attribute.
|
void |
incNodeVersion()
Increment NodeVersion property to the next integer value.
|
void |
initNodeVersion()
Initializes NodeVersion property to version number "1".
|
protected boolean |
isChildOfType() |
DataValue |
readAttribute(UnsignedInteger attributeId)
Read the current value of an attribute.
|
void |
readAttribute(UnsignedInteger attributeId,
DataValue dataValue,
Locale locale) |
protected void |
readAttributeValue(UnsignedInteger attributeId,
DataValue dataValue)
Read the value of an attribute.
|
protected CallbackInstanceProperty |
registerCallbackProperty(String name,
NodeId dataTypeId,
NodeId typeDefinitionId,
UaVariableCallback callback) |
protected <T> PlainInstanceProperty<T> |
registerPlainInstanceProperty(String name,
NodeId instanceDecalarationId,
NodeId dataTypeId)
Register a new property node as a property of this node.
|
protected <T> PlainInstanceProperty<T> |
registerPlainInstanceProperty(String name,
NodeId instanceDecalarationId,
T initialValue)
Register a new property node as a property of this node.
|
protected <T> PlainProperty<T> |
registerPlainProperty(String name,
NodeId dataTypeId)
Register a new property node as a property of this node.
|
protected <T> PlainProperty<T> |
registerPlainProperty(String name,
T initialValue)
Register a new property node as a property of this node.
|
protected <T> PlainVariable<T> |
registerPlainVariable(String name,
NodeId typeDefinitionId,
NodeId dataTypeId)
Create a new variable as a component of this node.
|
protected <T> PlainVariable<T> |
registerPlainVariable(String name,
NodeId typeDefinitionId,
T initialValue)
Create a new variable as a component of this node.
|
protected void |
registerReflectiveInstanceProperty(String name,
NodeId instanceDeclarationId,
NodeId dataTypeId) |
protected ReflectiveInstanceVariable |
registerReflectiveInstanceVariable(NodeId nodeId,
String name,
NodeId instanceDecalarationId,
NodeId dataTypeId) |
protected ReflectiveProperty |
registerReflectiveProperty(NodeId nodeId,
String name,
NodeId dataTypeId) |
protected ReflectiveVariable |
registerReflectiveVariable(NodeId nodeId,
String name,
NodeId dataTypeId) |
UaProperty |
removeProperty(QualifiedName name)
Remove the property with the specified name.
|
protected void |
setAccessLevelRecursively(AccessLevelType accessLevel) |
static void |
setAccessLevelRecursively(UaNode node,
AccessLevelType accessLevel,
NodeId... referenceTypeIds)
Set the access level of the node and all "child nodes", which are referred to it using forward
references of the defined types.
|
void |
setAttribute(UnsignedInteger attributeId,
DataValue dataValue)
Unconditionally, set the value of the specified attribute.
|
void |
setAttributes(NodeAttributes nodeAttributes)
Sets the attributes of the node.
|
void |
setBrowseName(QualifiedName browseName)
Sets the BrowseName Attribute of the node.
|
void |
setDescription(LocalizedText description)
Sets the Description Attribute of the node.
|
void |
setDisplayName(LocalizedText displayName)
Sets the DisplayName Attribute of the node.
|
void |
setNodeVersion(String nodeVersion)
Set the value of the NodeVersion property.
|
void |
setPropertyValue(QualifiedName propertyName,
Object value)
Set the value of a property.
|
void |
setUserWriteMask(AttributeWriteMask userWriteMask)
Sets the UserWriteMask Attribute of the node.
|
void |
setWriteMask(AttributeWriteMask writeMask)
Sets the WriteMask Attribute of the node.
|
String |
toString() |
boolean |
writeAttribute(UnsignedInteger attributeId,
DataValue dataValue)
Write the attribute value in a node.
|
protected void |
writeAttributeValue(UnsignedInteger attributeId,
Object value,
StatusCode statusCode,
DateTime sourceTime,
UnsignedShort sourcePicoseconds) |
addComponent, addDataChangeListener, addEventListener, addNewReference, addNewReference, addOrganizes, addProperties, addProperty, addReference, addReference, addReference, addReference, addReference, addReference, afterAddReference, afterDeleteReference, beforeAddReference, dataChange, deleteReference, deleteReference, deleteReferences, doDeleteReference, equals, findPlaceholders, fireDataChange, fireEvent, fireEventInParents, getAddressSpace, getDefaultBrowseName, getNodeId, getNodeManager, getNodeSetExtensions, getReference, getReferenceList, getReferences, getSupportedAttributes, getTargetNodes, getUaNodeId, hashCode, initSupportedAttributes, 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, waitaddReference, addReference, addReference, getBrowsePaths, getOrganizedNode, getOrganizedNodes, getUaBrowsePathspublic static final QualifiedName NODE_VERSION_PROPERTY_NAME
@Deprecated public static boolean useQuickPropertyLookup
getProperty(QualifiedName) to check
all references for the purposes of the Property, not an internal look-up-map.public BaseNode(NodeManagerUaNode nodeManager, NodeId nodeId, QualifiedName browseName, LocalizedText displayName)
nodeId - browseName - displayName - public BaseNode(NodeManagerUaNode nodeManager, NodeId nodeId, String name, Locale locale)
protected BaseNode(NodeManagerUaNode nodeManager, NodeId nodeId)
nodeManager - protected BaseNode(UaNode.Parameters parameters)
public static void setAccessLevelRecursively(UaNode node, AccessLevelType accessLevel, NodeId... referenceTypeIds)
node - the node from which to start the recursive setting, if null this method does
nothingaccessLevel - the access level to set to all nodesreferenceTypeIds - the reference types to look for child nodes. Default is Aggregatesprotected static QualifiedName getStandardBrowseName(String name)
protected static LocalizedText getStandardDisplayText(String name)
public NodeId createNodeId(UaNode parent, String name)
parent - the parent node - must not be nullname - the name of the property, used for both BrowseName and DisplayNamepublic UaReference deleteReference(ExpandedNodeId targetNodeId, NodeId referenceTypeId, boolean isInverse)
UaNodedeleteReference in interface UaNodedeleteReference in class ServerNodetargetNodeId - The target node of the reference.referenceTypeId - The exact type of reference.isInverse - Whether to remove a forward reference. If false, deletes an inverse reference
only.public UaReference deleteReference(UaReference reference)
UaNodedeleteReference in interface UaNodedeleteReference in class ServerNodereference - public abstract NodeAttributes getAttributes()
UaNodepublic Map<UnsignedInteger,Object> getAttributesMap()
UaNodeMap containing the Attributes of the node. The key is the
AttributeId (listed in Attributes) and the value is the Attribute value. NOTE! For
mutable Attribute value types (e.g. Value, ArrayDimensions) the value is a clone of the
original.public QualifiedName getBrowseName()
UaNodeA BrowseName should never be used to display the name of a Node. The DisplayName should be used instead for this purpose.
Unlike NodeIds, the BrowseName cannot be used to unambiguously identify a Node. Different Nodes may have the same BrowseName.
public UaNode getComponent(QualifiedName componentName)
UaNodecomponentName - the BrowseName of the component to getpublic UaNode[] getComponents()
UaNodepublic LocalizedText getDescription()
UaNodepublic LocalizedText getDescription(Locale locale)
public LocalizedText getDisplayName()
UaNodeThe string part of the DisplayName is restricted to 512 characters.
public LocalizedText getDisplayName(Locale locale)
locale - The desired localepublic UaMethod getMethod(QualifiedName methodName)
UaNodemethodName - public NodeClass getNodeClass()
UaNodepublic String getNodeVersion()
public UaProperty getNodeVersionNode()
UaNodepublic UaProperty[] getProperties()
UaNodepublic UaProperty getProperty(QualifiedName name)
name - the name of the propertypublic DataValue getPropertyValue(QualifiedName propertyName) throws StatusException, IllegalArgumentException
propertyName - StatusException - If the property value cannot be setIllegalArgumentException - If the property does not existpublic AttributeWriteMask getUserWriteMask()
UaNodeThe UserWriteMask Attribute can only further restrict the WriteMask Attribute, when it is set to not writable in the general case that applies for every user.
public AttributeWriteMask getWriteMask()
UaNodepublic boolean hasProperty(QualifiedName propertyName)
public boolean hasTypeDefinition()
public boolean hasUserWriteAccess(UnsignedInteger attributeId)
UaNodeThe access rights are checked by default in writeAttribute.
attributeId - the attribute to checkpublic boolean hasWriteAccess(UnsignedInteger attributeId)
UaNodeThe access rights are checked by default in writeAttribute.
attributeId - the attribute to checkpublic void incNodeVersion()
throws NumberFormatException
The NodeVersion property must be initialized with initNodeVersion() before it can be
incremented (otherwise it will do nothing). The NodeManagerRoot will actually call
incNodeversion automatically for nodes that are part of a ModelChange that is ended with
NodeManagerRoot.endModelChange().
NumberFormatException - if the current nodeVersion string does not contain a parsable
integerpublic void initNodeVersion()
Node's that have the optional NodeVersion Property can participate in a
GeneralModelChangeEvent. See NodeManagerRoot.beginModelChange() for how to trigger
these events.
public DataValue readAttribute(UnsignedInteger attributeId)
attributeId - UaNode.supportsAttribute(UnsignedInteger)public final void readAttribute(UnsignedInteger attributeId, DataValue dataValue, Locale locale)
public UaProperty removeProperty(QualifiedName name)
UaNodename - the name of the propertypublic void setAttribute(UnsignedInteger attributeId, DataValue dataValue) throws StatusException
attributeId - dataValue - StatusExceptionpublic void setAttributes(NodeAttributes nodeAttributes)
UaNodepublic void setBrowseName(QualifiedName browseName)
UaNodepublic void setDescription(LocalizedText description)
UaNodepublic void setDisplayName(LocalizedText displayName)
UaNodepublic void setNodeVersion(String nodeVersion)
nodeVersion - a new string value for the version. Internally we try to use this as an
Integer, which is incremented, using incNodeVersion()public void setPropertyValue(QualifiedName propertyName, Object value) throws StatusException, IllegalArgumentException
propertyName - value - StatusException - If the property value cannot be setIllegalArgumentException - If the property does not existpublic void setUserWriteMask(AttributeWriteMask userWriteMask)
UaNodepublic void setWriteMask(AttributeWriteMask writeMask)
UaNodepublic String toString()
toString in class ServerNodepublic final boolean writeAttribute(UnsignedInteger attributeId, DataValue dataValue) throws StatusException
attributeId - the attributedataValue - the new value, if this is null, the status of the attribute is set to
StatusCode.BAD, otherwise the status and value are used from itStatusException - if the write is not accepted (for above mentioned reasons)UaNode.supportsAttribute(UnsignedInteger)protected <T> PlainProperty<T> addPlainProperty(NodeId nodeId, String name)
It also calls addProperty to add the variable to the current node.
nodeId - the Node ID used for the new propertyname - The name used initialize the propertyprotected <T> PlainVariable<T> addPlainVariable(NodeId nodeId, String name)
It also calls addComponent to add the variable to the current node.
nodeId - the Node ID used for the new variablename - The name used initialize the variable.protected void assertTypeSupport(ExpandedNodeId typeDefinition)
protected void assertTypeSupport(NodeId typeDefinition)
protected NodeId createNodeId(UaNode parent, String name, int namespaceIndex)
parent - the parent node - must not be nullname - the name of the property, used for both BrowseName and DisplayNamenamespaceIndex - the namespacIndex to use for the NodeId. If you omit it, the
namespaceIndex of parent is used.protected ReflectiveInstanceProperty createReflectiveInstanceProperty(String name, NodeId instanceDeclarationId) throws SecurityException, NoSuchMethodException, StatusException
name - instanceDeclarationId - StatusExceptionNoSuchMethodExceptionSecurityExceptionprotected ReflectiveInstanceProperty createReflectiveInstanceProperty(String name, NodeId instanceDeclarationId, NodeId nodeId) throws SecurityException, NoSuchMethodException, StatusException
name - instanceDeclarationId - SecurityExceptionNoSuchMethodExceptionStatusExceptionprotected boolean doAddProperty(UaProperty property)
doAddProperty in class ServerNodeproperty - protected NodeAttributes getAttributes(NodeAttributes attributes)
protected void getAttributesMap(Map<UnsignedInteger,Object> map)
protected UaReference getPropertyReference(QualifiedName propertyName)
protected List<UaReference> getReferencesAsList(Boolean isInverse, NodeId... referenceTypeIds)
getReferencesAsList in class AbstractUaNodeprotected UaReference hasReference(UaReference reference)
hasReference in class ServerNodeprotected boolean isChildOfType()
protected void readAttributeValue(UnsignedInteger attributeId, DataValue dataValue) throws StatusException
attributeId - 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 CallbackInstanceProperty registerCallbackProperty(String name, NodeId dataTypeId, NodeId typeDefinitionId, UaVariableCallback callback) throws StatusException
name - dataTypeId - typeDefinitionId - callback - StatusException - if instanceDecalarationId cannot be converted to a variable nodeprotected <T> PlainInstanceProperty<T> registerPlainInstanceProperty(String name, NodeId instanceDecalarationId, NodeId dataTypeId) throws StatusException
name - the name of the propertydataTypeId - The data type of the propertyStatusException - if instanceDecalarationId cannot be converted to a variableprotected <T> PlainInstanceProperty<T> registerPlainInstanceProperty(String name, NodeId instanceDecalarationId, T initialValue) throws StatusException
name - the name of the propertyinitialValue - initial value of the property. This may not be null. If you do not have a
valid initialValue, use the overload method, which takes the dataTypeId as parameter.
The value is used to determine the type.StatusException - if instanceDecalarationId cannot be converted to a variableprotected <T> PlainProperty<T> registerPlainProperty(String name, NodeId dataTypeId)
name - the name of the propertydataTypeId - The data type of the propertyprotected <T> PlainProperty<T> registerPlainProperty(String name, T initialValue)
name - the name of the propertyinitialValue - initial value of the property. This may not be null. If you do not have a
valid initialValue, use the overload method, which takes the dataTypeId as parameter.
The value is used to determine the type.protected <T> PlainVariable<T> registerPlainVariable(String name, NodeId typeDefinitionId, NodeId dataTypeId)
name - the name of the variabletypeDefinitionId - The type definition of the variabledataTypeId - The data type of the variableprotected <T> PlainVariable<T> registerPlainVariable(String name, NodeId typeDefinitionId, T initialValue)
name - the name of the variabletypeDefinitionId - The type definition of the variableinitialValue - initial value of the property. This may not be null. If you do not have a
valid initialValue, use the overload method, which takes the dataTypeId as parameter.
The value is used to determine the type.protected void registerReflectiveInstanceProperty(String name, NodeId instanceDeclarationId, NodeId dataTypeId) throws IllegalArgumentException
name - instanceDeclarationId - dataTypeId - SecurityExceptionNoSuchMethodExceptionStatusException - if instanceDecalarationId cannot be converted to a variable nodeIllegalArgumentExceptionprotected ReflectiveInstanceVariable registerReflectiveInstanceVariable(NodeId nodeId, String name, NodeId instanceDecalarationId, NodeId dataTypeId) throws SecurityException, NoSuchMethodException, StatusException
nodeId - name - dataTypeId - instanceDecalarationId - NoSuchMethodExceptionSecurityExceptionStatusException - if instanceDecalarationId cannot be converted to a variable nodeprotected ReflectiveProperty registerReflectiveProperty(NodeId nodeId, String name, NodeId dataTypeId) throws SecurityException, NoSuchMethodException
nodeId - name - dataTypeId - NoSuchMethodExceptionSecurityExceptionprotected ReflectiveVariable registerReflectiveVariable(NodeId nodeId, String name, NodeId dataTypeId) throws SecurityException, NoSuchMethodException
nodeId - name - dataTypeId - NoSuchMethodExceptionSecurityExceptionprotected void setAccessLevelRecursively(AccessLevelType accessLevel)
accessLevel - protected void writeAttributeValue(UnsignedInteger attributeId, Object value, StatusCode statusCode, DateTime sourceTime, UnsignedShort sourcePicoseconds) throws StatusException
writeAttributeValue in class ServerNodeStatusExceptionCopyright © 2026. All rights reserved.