public abstract class UaNodeImpl extends AbstractUaNode
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 |
|---|---|
protected AddressSpace |
addressSpace |
protected static org.slf4j.Logger |
logger |
protected Set<UaReference> |
references |
protected static Map<Class<? extends UaNode>,List<UnsignedInteger>> |
supportedAttributesMap |
| Modifier | Constructor and Description |
|---|---|
|
UaNodeImpl(AddressSpace addressSpace,
NodeId nodeId,
QualifiedName browseName,
LocalizedText displayName)
Create a new node.
|
|
UaNodeImpl(AddressSpace addressSpace,
NodeId nodeId,
QualifiedName browseName,
LocalizedText displayName,
LocalizedText description,
AttributeWriteMask writeMask,
AttributeWriteMask userWriteMask,
UaClientReference[] references,
UaProperty[] properties) |
|
UaNodeImpl(AddressSpace addressSpace,
NodeId nodeId,
String name,
Locale locale) |
protected |
UaNodeImpl(UaNode.Parameters parameters) |
| Modifier and Type | Method and Description |
|---|---|
UaReference |
addComponent(UaNode node)
Adds a new component to the Node.
|
void |
addProperties(UaProperty[] properties) |
UaReference |
addProperty(UaProperty property)
Add a new property node to the node.
|
UaReference |
addReference(ExpandedNodeId nodeId,
NodeId referenceTypeId,
boolean isInverse)
Convenience method for
UaNode.addReference(NodeId, NodeId, boolean) that uses ExpandedNodeId
instead of NodeId. |
UaReference |
addReference(NodeId nodeId,
NodeId referenceTypeId,
boolean isInverse)
Adds a new reference of the specified type to the specified node.
|
UaReference |
addReference(UaNode targetNode,
NodeId referenceTypeId,
boolean isInverse)
Add a reference to the node.
|
protected UaReference |
addReference(UaReference reference) |
protected void |
afterAddReference(UaReference reference) |
protected void |
afterDeleteReference(UaReference reference) |
protected void |
assertTypeSupport(ExpandedNodeId typeDefinition) |
protected void |
assertTypeSupport(NodeId typeDefinition) |
protected boolean |
beforeAddReference(UaReference reference) |
UaReference |
deleteReference(ExpandedNodeId targetNodeId,
NodeId referenceTypeId,
boolean isInverse)
Delete a reference from the node.
|
UaReference |
deleteReference(NodeId nodeId,
NodeId referenceTypeId,
boolean isInverse)
Delete a reference from the node.
|
UaReference |
deleteReference(UaNode targetNode,
NodeId referenceTypeId,
boolean isInverse)
Delete a reference from the node.
|
UaReference |
deleteReference(UaReference reference)
Delete a reference from the node.
|
void |
deleteReferences(NodeId targetId)
Delete all references to a target node.
|
protected boolean |
doAddProperty(UaProperty property) |
boolean |
equals(Object obj) |
protected <T extends UaNode> |
findPlaceholders(Class<T> clazz,
ExpandedNodeId placeholderId,
ExpandedNodeId referenceTypeId)
Searches UaNodes that match given Placeholder ModellingRule node.
|
AddressSpace |
getAddressSpace()
The address space in which the node resides.
|
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.
|
NodeId |
getNodeId()
Nodes are unambiguously identified using a constructed identifier called the NodeId.
|
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.
|
DataValue |
getPropertyValue(QualifiedName propertyName)
Get the value of a property.
|
UaReference |
getReference(NodeId referenceTypeId,
boolean isInverse)
Finds the first reference of the specified reference type.
|
protected Collection<UaReference> |
getReferenceList()
Returns all references the node has.
|
UaReference[] |
getReferences(NodeId referenceTypeId,
boolean isInverse)
Finds all references of the specified reference type.
|
UnsignedInteger[] |
getSupportedAttributes()
Returns the list of attributes supported by this node class.
|
UaNodeId |
getUaNodeId()
Returns
UaNode.getNodeId() as UaNodeId (which has the NamespaceUri instead of
NamespaceIndex). |
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.
|
int |
hashCode() |
boolean |
hasProperty(QualifiedName propertyName) |
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.
|
protected void |
initSupportedAttributes(List<UnsignedInteger> l) |
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 boolean |
referenceTypeInherits(NodeId typeId,
NodeId... referenceTypeIds)
Checks if the given reference type inherits from any of the defined types.
|
UaNode |
removeComponent(UaNode component)
Remove a component reference from the node.
|
UaProperty |
removeProperty(QualifiedName name)
Remove the property with the specified name.
|
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.
|
protected void |
setNodeVersion(String nodeVersion)
Set the value of the NodeVersion property.
|
void |
setPropertyValue(QualifiedName propertyName,
Object value)
Set the value of a property.
|
void |
setReferences(UaReference[] references)
Set all references of the node at one call.
|
void |
setUserWriteMask(AttributeWriteMask userWriteMask)
Sets the UserWriteMask Attribute of the node.
|
void |
setWriteMask(AttributeWriteMask writeMask)
Sets the WriteMask Attribute of the node.
|
boolean |
supportsAttribute(UnsignedInteger attributeId)
Check if the node supports the specified attribute.
|
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) |
getForwardReferences, getInverseReferences, getReferences, getReferences, getReferencesAsList, getUserData, referenceTypeInherits, setUserDataclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddOrganizes, addReference, addReference, addReference, getAttributes, getBrowsePaths, getOrganizedNode, getOrganizedNodes, getUaBrowsePathsprotected static final org.slf4j.Logger logger
protected static final Map<Class<? extends UaNode>,List<UnsignedInteger>> supportedAttributesMap
protected final AddressSpace addressSpace
protected Set<UaReference> references
public UaNodeImpl(AddressSpace addressSpace, NodeId nodeId, QualifiedName browseName, LocalizedText displayName)
nodeId - browseName - displayName - public UaNodeImpl(AddressSpace addressSpace, NodeId nodeId, QualifiedName browseName, LocalizedText displayName, LocalizedText description, AttributeWriteMask writeMask, AttributeWriteMask userWriteMask, UaClientReference[] references, UaProperty[] properties)
public UaNodeImpl(AddressSpace addressSpace, NodeId nodeId, String name, Locale locale)
protected UaNodeImpl(UaNode.Parameters parameters)
public UaReference addComponent(UaNode node)
UaNodeDepending on the background implementation, the component node may also get added.
This is a shortcut for
addReference(component, Identifiers.HasComponent, false);
node - the component nodeUaNode.addReference(UaNode, NodeId, boolean)public void addProperties(UaProperty[] properties)
properties - public UaReference addProperty(UaProperty property)
UaNodeAdds a new forward HasProperty reference with target to the property node.
property - the property to add to the nodepublic UaReference addReference(ExpandedNodeId nodeId, NodeId referenceTypeId, boolean isInverse)
UaNodeUaNode.addReference(NodeId, NodeId, boolean) that uses ExpandedNodeId
instead of NodeId.nodeId - The target nodereferenceTypeId - The reference typeisInverse - Whether the reference is an inverse reference (or forward, if isInverse=false)public UaReference addReference(NodeId nodeId, NodeId referenceTypeId, boolean isInverse)
UaNodenodeId - The target node of the referencereferenceTypeId - The reference typeisInverse - Whether the reference is an inverse reference (or forward, if isInverse=false)public UaReference addReference(UaNode targetNode, NodeId referenceTypeId, boolean isInverse)
UaNodetargetNode - referenceTypeId - isInverse - public UaReference deleteReference(ExpandedNodeId targetNodeId, NodeId referenceTypeId, boolean isInverse)
UaNodetargetNodeId - 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(NodeId nodeId, NodeId referenceTypeId, boolean isInverse)
UaNodenodeId - 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(UaNode targetNode, NodeId referenceTypeId, boolean isInverse)
UaNodetargetNode - 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)
UaNodereference - The reference to delete.public void deleteReferences(NodeId targetId)
targetId - NodeId of the target node to which the references should be removed.public AddressSpace getAddressSpace()
The address space is used to provide access to other nodes in the server.
public 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 - the BrowseName (in namespace 0) of the method to getpublic NodeClass getNodeClass()
UaNodepublic NodeId getNodeId()
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
propertyName - the property nameStatusException - If the property value cannot be setIllegalArgumentException - If the property does not existpublic UaReference getReference(NodeId referenceTypeId, boolean isInverse)
referenceTypeId - the reference type to search (or null to accept any)isInverse - To search for inverse reference, instead of non-inverse (applied also if null
referenceType is defined)public UaReference[] getReferences(NodeId referenceTypeId, boolean isInverse)
referenceTypeId - the reference type to search (or null to accept any)isInverse - To search for inverse reference, instead of non-inverse (applied also if null
referenceType is defined)public UnsignedInteger[] getSupportedAttributes()
UaNodepublic UaNodeId getUaNodeId()
UaNodeUaNode.getNodeId() as UaNodeId (which has the NamespaceUri instead of
NamespaceIndex).public 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 DataValue readAttribute(UnsignedInteger attributeId)
attributeId - UaNode.supportsAttribute(UnsignedInteger)public final void readAttribute(UnsignedInteger attributeId, DataValue dataValue, Locale locale)
public UaNode removeComponent(UaNode component)
UaNodeThis is a shortcut for
deleteReference(component, Identifiers.HasComponent, false);
Note that the method does not remove the component - it only removes the reference to it.
component - the component node to removeUaNode.deleteReference(UaNode, NodeId, boolean)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 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 setReferences(UaReference[] references)
UaNode
Use UaNode.addReference(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.NodeId) to add new references to the node.
references - the references to setUaNode.getReferences(),
UaNode.getReference(NodeId, boolean)public void setUserWriteMask(AttributeWriteMask userWriteMask)
UaNodepublic void setWriteMask(AttributeWriteMask writeMask)
UaNodepublic boolean supportsAttribute(UnsignedInteger attributeId)
UaNode
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(com.prosysopc.ua.stack.builtintypes.UnsignedInteger).
attributeId - the attribute to check - the valid values are defined in
Attributespublic 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 UaReference addReference(UaReference reference)
protected void afterAddReference(UaReference reference)
reference - protected void afterDeleteReference(UaReference reference)
reference - protected void assertTypeSupport(ExpandedNodeId typeDefinition)
protected void assertTypeSupport(NodeId typeDefinition)
protected boolean beforeAddReference(UaReference reference)
reference - protected boolean doAddProperty(UaProperty property)
property - protected <T extends UaNode> List<T> findPlaceholders(Class<T> clazz, ExpandedNodeId placeholderId, ExpandedNodeId referenceTypeId)
clazz - placeholderId - referenceTypeId - protected NodeAttributes getAttributes(NodeAttributes attributes)
protected void getAttributesMap(Map<UnsignedInteger,Object> map)
protected Collection<UaReference> getReferenceList()
AbstractUaNodegetReferenceList in class AbstractUaNodeprotected void initSupportedAttributes(List<UnsignedInteger> l)
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.locale - the locale for LocalizedTextsStatusException - on failureprotected boolean referenceTypeInherits(NodeId typeId, NodeId... referenceTypeIds)
AbstractUaNodereferenceTypeInherits in class AbstractUaNodeprotected void setNodeVersion(String nodeVersion) throws StatusException
nodeVersion - StatusExceptionprotected void writeAttributeValue(UnsignedInteger attributeId, Object value, StatusCode statusCode, DateTime sourceTime, UnsignedShort sourcePicoseconds) throws StatusException
StatusExceptionCopyright © 2026. All rights reserved.