com.prosysopc.ua.client.nodes
Class UaNodeImpl

java.lang.Object
  extended by com.prosysopc.ua.nodes.AbstractUaNode
      extended by com.prosysopc.ua.client.nodes.UaNodeImpl
All Implemented Interfaces:
UaNode
Direct Known Subclasses:
UaInstanceImpl, UaMethodImpl, UaTypeImpl, UaViewImpl

public abstract class UaNodeImpl
extends AbstractUaNode

Straight forward implementation of 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.


Field Summary
protected  AddressSpace addressSpace
           
protected static org.slf4j.Logger logger
           
protected  Set<UaReference> references
           
protected static Map<Class<? extends UaNode>,List<org.opcfoundation.ua.builtintypes.UnsignedInteger>> supportedAttributesMap
           
 
Constructor Summary
UaNodeImpl(AddressSpace addressSpace, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
          Create a new node.
UaNodeImpl(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)
           
UaNodeImpl(AddressSpace addressSpace, org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, Locale locale)
           
 
Method Summary
 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(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isInverse)
          Convenience method for UaNode.addReference(NodeId, NodeId, boolean) that uses ExpandedNodeId instead of NodeId.
 UaReference addReference(org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isInverse)
          Adds a new reference of the specified type to the specified node.
 UaReference addReference(UaNode targetNode, org.opcfoundation.ua.builtintypes.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(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
           
protected  void assertTypeSupport(org.opcfoundation.ua.builtintypes.NodeId typeDefinition)
           
protected  boolean beforeAddReference(UaReference reference)
           
 UaReference deleteReference(org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isInverse)
          Delete a reference from the node.
 UaReference deleteReference(org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isInverse)
          Delete a reference from the node.
 UaReference deleteReference(UaNode targetNode, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isInverse)
          Delete a reference from the node.
 UaReference deleteReference(UaReference reference)
          Delete a reference from the node.
 void deleteReferences(org.opcfoundation.ua.builtintypes.NodeId targetId)
          Delete all references to a target node.
protected  boolean doAddProperty(UaProperty property)
           
 boolean equals(Object obj)
           
protected
<T extends UaNode>
List<T>
findPlaceholders(Class<T> clazz, org.opcfoundation.ua.builtintypes.ExpandedNodeId placeholderId, org.opcfoundation.ua.builtintypes.ExpandedNodeId referenceTypeId)
          Searches UaNodes that match given Placeholder ModellingRule node.
 AddressSpace getAddressSpace()
          The address space in which the node resides.
protected  org.opcfoundation.ua.core.NodeAttributes getAttributes(org.opcfoundation.ua.core.NodeAttributes attributes)
           
 org.opcfoundation.ua.builtintypes.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(org.opcfoundation.ua.builtintypes.QualifiedName componentName)
          Get the component, which has the specified name.
 UaNode[] getComponents()
          Get a list of components of this node, i.e. target nodes of all forward HasComponent references.
 org.opcfoundation.ua.builtintypes.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.
 org.opcfoundation.ua.builtintypes.LocalizedText getDescription(Locale locale)
           
 org.opcfoundation.ua.builtintypes.LocalizedText getDisplayName()
          The DisplayName Attribute contains the localised name of the Node.
 org.opcfoundation.ua.builtintypes.LocalizedText getDisplayName(Locale locale)
           
 UaMethod getMethod(org.opcfoundation.ua.builtintypes.QualifiedName methodName)
          Get the method, which has the specified name.
 org.opcfoundation.ua.core.NodeClass getNodeClass()
          The NodeClass Attribute identifies the NodeClass of a Node.
 org.opcfoundation.ua.builtintypes.NodeId getNodeId()
          Nodes are unambiguously identified using a constructed identifier called the NodeId.
 UaProperty getNodeVersion()
           
 String getNodeVersionString()
           
 UaProperty[] getProperties()
           
 UaProperty getProperty(org.opcfoundation.ua.builtintypes.QualifiedName name)
          Get the property with name.
 org.opcfoundation.ua.builtintypes.DataValue getPropertyValue(org.opcfoundation.ua.builtintypes.QualifiedName propertyName)
          Get the value of a property.
 UaReference getReference(org.opcfoundation.ua.builtintypes.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(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isInverse)
          Finds all references of the specified reference type.
 org.opcfoundation.ua.builtintypes.UnsignedInteger[] getSupportedAttributes()
           
 EnumSet<WriteAccess> getUserWriteMask()
          The optional UserWriteMask Attribute exposes the possibilities of a client to write the Attributes of the Node taking user access rights into account.
 EnumSet<WriteAccess> getWriteMask()
          The optional WriteMask Attribute exposes the possibilities of a client to write the Attributes of the Node.
 int hashCode()
           
 boolean hasProperty(org.opcfoundation.ua.builtintypes.QualifiedName propertyName)
           
 boolean hasTypeDefinition()
           
 boolean hasUserWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
          Checks additional user access rights to the node.
 boolean hasWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
          Check the common access rights of a node attribute.
protected  void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
           
 org.opcfoundation.ua.builtintypes.DataValue readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
          Read the current value of an attribute.
 void readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.builtintypes.DataValue dataValue, Locale locale)
           
protected  void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Read the value of an attribute.
protected  boolean referenceTypeInherits(org.opcfoundation.ua.builtintypes.NodeId typeId, org.opcfoundation.ua.builtintypes.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(org.opcfoundation.ua.builtintypes.QualifiedName name)
          Remove the property with the specified name.
 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.NodeAttributes nodeAttributes)
           
 void setBrowseName(org.opcfoundation.ua.builtintypes.QualifiedName browseName)
           
 void setDescription(org.opcfoundation.ua.builtintypes.LocalizedText description)
           
 void setDisplayName(org.opcfoundation.ua.builtintypes.LocalizedText displayName)
           
protected  void setNodeVersion(String nodeVersion)
          Set the value of the NodeVersion property.
 void setPropertyValue(org.opcfoundation.ua.builtintypes.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(EnumSet<WriteAccess> userWriteMask)
           
 void setWriteMask(EnumSet<WriteAccess> writeMask)
           
 boolean supportsAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
          Check if the node supports the specified attribute.
 String toString()
           
 boolean writeAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Write the attribute value in a node.
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.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.UaNode
getAttributes
 

Field Detail

logger

protected static final org.slf4j.Logger logger

supportedAttributesMap

protected static final Map<Class<? extends UaNode>,List<org.opcfoundation.ua.builtintypes.UnsignedInteger>> supportedAttributesMap

addressSpace

protected final AddressSpace addressSpace

references

protected Set<UaReference> references
Constructor Detail

UaNodeImpl

public UaNodeImpl(AddressSpace addressSpace,
                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                  org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                  org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Create a new node.

Parameters:
nodeId -
browseName -
displayName -

UaNodeImpl

public UaNodeImpl(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)

UaNodeImpl

public UaNodeImpl(AddressSpace addressSpace,
                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                  String name,
                  Locale locale)
Method Detail

addComponent

public UaReference addComponent(UaNode node)
Description copied from interface: UaNode
Adds a new component to the Node. This is a convenience method that adds a new HasComponent reference with target set to the node. The node must be a data variable, object or method.

Depending on the background implementation, the component node may also get added.

This is a shortcut for

 addReference(component, Identifiers.HasComponent, false);
 

Parameters:
node - the component node
Returns:
the HasComponent reference that was added (or existed already)
See Also:
UaNode.addReference(UaNode, NodeId, boolean)

addProperties

public void addProperties(UaProperty[] properties)
Parameters:
properties -

addProperty

public UaReference addProperty(UaProperty property)
Description copied from interface: UaNode
Add a new property node to the node. All other node types can have properties, except property nodes.

Adds a new forward HasProperty reference with target to the property node.

Parameters:
property - the property to add to the node
Returns:
the property reference that was added (or existed already) or null, if the reference type is not supported by the node (i.e. UaProperty may not have HasProperty references).

addReference

public UaReference addReference(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                                org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                boolean isInverse)
Description copied from interface: UaNode
Convenience method for UaNode.addReference(NodeId, NodeId, boolean) that uses ExpandedNodeId instead of NodeId.

Parameters:
nodeId - The target node
referenceTypeId - The reference type
isInverse - Whether the reference is an inverse reference (or forward, if isInverse=false)
Returns:
the reference that was added (or existed already) or null, if the reference type is not supported by the node (i.e. UaProperty may only have inverse HasProperty references).

addReference

public UaReference addReference(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                boolean isInverse)
Description copied from interface: UaNode
Adds a new reference of the specified type to the specified node. If a similar reference already exists, does not add a new, but returns a reference to the existing reference.

Parameters:
nodeId - The target node of the reference
referenceTypeId - The reference type
isInverse - Whether the reference is an inverse reference (or forward, if isInverse=false)
Returns:
the reference that was added (or existed already) or null, if the reference type is not supported by the node (i.e. UaProperty may only have inverse HasProperty references).

addReference

public UaReference addReference(UaNode targetNode,
                                org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                boolean isInverse)
Description copied from interface: UaNode
Add a reference to the node. If the node already has a similar reference, it simply returns the existing reference.

Parameters:
targetNode -
referenceTypeId -
isInverse -
Returns:
true if the reference was added, false indicates that a similar reference already existed

deleteReference

public UaReference deleteReference(org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
                                   org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                   boolean isInverse)
Description copied from interface: UaNode
Delete a reference from the node.

Parameters:
targetNodeId - 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.
Returns:
the reference that was deleted or null if it did not exist

deleteReference

public UaReference deleteReference(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                   org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                   boolean isInverse)
Description copied from interface: UaNode
Delete a reference from the node.

Parameters:
nodeId - 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.

deleteReference

public UaReference deleteReference(UaNode targetNode,
                                   org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                   boolean isInverse)
Description copied from interface: UaNode
Delete a reference from the node.

Parameters:
targetNode - 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.

deleteReference

public UaReference deleteReference(UaReference reference)
Description copied from interface: UaNode
Delete a reference from the node.

Parameters:
reference - The reference to delete.

deleteReferences

public void deleteReferences(org.opcfoundation.ua.builtintypes.NodeId targetId)
Delete all references to a target node.

Parameters:
targetId - NodeId of the target node to which the references should be removed.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getAddressSpace

public AddressSpace getAddressSpace()
The address space in which the node resides.

The address space is used to provide access to other nodes in the server.

Returns:
the addressSpace

getBrowseName

public org.opcfoundation.ua.builtintypes.QualifiedName getBrowseName()
Description copied from interface: UaNode
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. The TranslateBrowsePathsToNodeIds Service can be used to follow a path constructed of BrowseNames.

A 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.

Returns:
the Browse Name of the node.
See Also:
AddressSpace.translateBrowsePathsToNodeIds(org.opcfoundation.ua.core.BrowsePath...)

getComponent

public UaNode getComponent(org.opcfoundation.ua.builtintypes.QualifiedName componentName)
Description copied from interface: UaNode
Get the component, which has the specified name. The method goes through all references of type HasComponent and returns the node with the matching BrowseName.

Parameters:
componentName - the BrowseName of the component to get
Returns:
the component node or null, if no matching component is found.

getComponents

public UaNode[] getComponents()
Description copied from interface: UaNode
Get a list of components of this node, i.e. target nodes of all forward HasComponent references.

Returns:
the component nodes.

getDescription

public org.opcfoundation.ua.builtintypes.LocalizedText getDescription()
Description copied from interface: UaNode
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.

Returns:
the Description of the node in the default locale. This may be null.

getDescription

public org.opcfoundation.ua.builtintypes.LocalizedText getDescription(Locale locale)

getDisplayName

public org.opcfoundation.ua.builtintypes.LocalizedText getDisplayName()
Description copied from interface: UaNode
The DisplayName Attribute contains the localised name of the Node. Clients should use this Attribute if they want to display the name of the Node to the user. They should not use the BrowseName for this purpose. The server may maintain one or more localised representations for each DisplayName. Clients negotiate the locale to be returned when they open a session with the OPC Unified Architecture server. Refer to Part 4 of the specification for a description of session establishment and locales.

The string part of the DisplayName is restricted to 512 characters.

Returns:
the DisplayName in the default locale

getDisplayName

public org.opcfoundation.ua.builtintypes.LocalizedText getDisplayName(Locale locale)
Parameters:
locale - The desired locale
Returns:
DisplayName with the specified locale - or default locale, if there is no specific name in the desired locale.

getMethod

public UaMethod getMethod(org.opcfoundation.ua.builtintypes.QualifiedName methodName)
Description copied from interface: UaNode
Get the method, which has the specified name. Calls getComponent, and converts the node to UaMethod.

Parameters:
methodName - the BrowseName (in namespace 0) of the method to get
Returns:
the method node or null, if no matching method is found.

getNodeClass

public org.opcfoundation.ua.core.NodeClass getNodeClass()
Description copied from interface: UaNode
The NodeClass Attribute identifies the NodeClass of a Node.

Returns:
the Node Class of the node. This is hard-coded and cannot be changed.

getNodeId

public org.opcfoundation.ua.builtintypes.NodeId getNodeId()
Description copied from interface: UaNode
Nodes are unambiguously identified using a constructed identifier called the NodeId. Some servers may accept alternative NodeIds in addition to the canonical NodeId represented in this Attribute.

Returns:
the ID of the node.

getNodeVersion

public UaProperty getNodeVersion()
Returns:
the NodeVersion property. This is an optional property, so it may be null, if the property is not defined.

getNodeVersionString

public String getNodeVersionString()

getProperties

public UaProperty[] getProperties()
Returns:
all properties of the node or null

getProperty

public UaProperty getProperty(org.opcfoundation.ua.builtintypes.QualifiedName name)
Get the property with name.

Parameters:
name - the name of the property
Returns:
the property or null, if there is no such property

getPropertyValue

public org.opcfoundation.ua.builtintypes.DataValue getPropertyValue(org.opcfoundation.ua.builtintypes.QualifiedName propertyName)
                                                             throws StatusException
Get the value of a property.

Parameters:
propertyName -
Returns:
the property value
Throws:
StatusException - If the property value cannot be set
IllegalArgumentException - If the property does not exist

getReference

public UaReference getReference(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                boolean isInverse)
Finds the first reference of the specified reference type.

Parameters:
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)
Returns:
the reference or null if no reference is found

getReferences

public UaReference[] getReferences(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                   boolean isInverse)
Finds all references of the specified reference type.

Parameters:
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)
Returns:
the references; if no references are found an empty array is returned

getSupportedAttributes

public org.opcfoundation.ua.builtintypes.UnsignedInteger[] getSupportedAttributes()
Returns:
list of attributes supported by this node class

getUserWriteMask

public EnumSet<WriteAccess> getUserWriteMask()
Description copied from interface: UaNode
The optional UserWriteMask Attribute exposes the possibilities of a client to write the Attributes of the Node taking user access rights into account.

The 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.

Returns:
the current WriteUserMask

getWriteMask

public EnumSet<WriteAccess> getWriteMask()
Description copied from interface: UaNode
The optional WriteMask Attribute exposes the possibilities of a client to write the Attributes of the Node. The WriteMask Attribute does not take any user access rights into account, i.e. although an Attribute is writable this may be restricted to a certain user / user group. If the OPC UA server does not have the ability to get the WriteMask information for a specific Attribute from the underlying system, it should state that it is writable. If a write operation is called on the Attribute, the server should transfer this request and return the corresponding StatusCode if such a request is rejected.

Returns:
the current set of attributes, which are writeable.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

hasProperty

public boolean hasProperty(org.opcfoundation.ua.builtintypes.QualifiedName propertyName)

hasTypeDefinition

public boolean hasTypeDefinition()
Returns:

hasUserWriteAccess

public boolean hasUserWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Description copied from interface: UaNode
Checks additional user access rights to the node. Always check the common rights first with hasWriteAccess. The access rights are checked by default in writeAttribute.

Parameters:
attributeId - the attribute to check
Returns:
true if the attribute may be written to

hasWriteAccess

public boolean hasWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Description copied from interface: UaNode
Check the common access rights of a node attribute. Note: Value is not included in WriteMask - should be checked from AccessLevel The access rights are checked by default in writeAttribute.

Parameters:
attributeId - the attribute to check
Returns:
true if the attribute may be written to

readAttribute

public org.opcfoundation.ua.builtintypes.DataValue readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Read the current value of an attribute.

Parameters:
attributeId -
Returns:
the current data value
See Also:
UaNode.supportsAttribute(UnsignedInteger)

readAttribute

public final void readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                org.opcfoundation.ua.builtintypes.DataValue dataValue,
                                Locale locale)

removeComponent

public UaNode removeComponent(UaNode component)
Description copied from interface: UaNode
Remove a component reference from the node.

This 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.

Parameters:
component - the component node to remove
See Also:
UaNode.deleteReference(UaNode, NodeId, boolean)

removeProperty

public UaProperty removeProperty(org.opcfoundation.ua.builtintypes.QualifiedName name)
Description copied from interface: UaNode
Remove the property with the specified name.

Parameters:
name - the name of the property
Returns:
the property that was removed or null, if there was no such property

setAttribute

public void setAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                         org.opcfoundation.ua.builtintypes.DataValue dataValue)
                  throws StatusException
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.

Parameters:
attributeId -
dataValue -
Throws:
StatusException

setAttributes

public void setAttributes(org.opcfoundation.ua.core.NodeAttributes nodeAttributes)

setBrowseName

public void setBrowseName(org.opcfoundation.ua.builtintypes.QualifiedName browseName)
Parameters:
browseName - the new BrowseName to set
See Also:
UaNode.getBrowseName()

setDescription

public void setDescription(org.opcfoundation.ua.builtintypes.LocalizedText description)
Parameters:
description - the new description to set
See Also:
UaNode.getDescription()

setDisplayName

public void setDisplayName(org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Parameters:
displayName - the new DisplayName to set
See Also:
UaNode.getDisplayName()

setPropertyValue

public void setPropertyValue(org.opcfoundation.ua.builtintypes.QualifiedName propertyName,
                             Object value)
                      throws StatusException,
                             IllegalArgumentException
Set the value of a property.

Parameters:
propertyName -
value -
Throws:
StatusException - If the property value cannot be set
IllegalArgumentException - If the property does not exist

setReferences

public void setReferences(UaReference[] references)
Description copied from interface: UaNode
Set all references of the node at one call. Note that this will replace all previously set references.

Use UaNode.addReference(org.opcfoundation.ua.builtintypes.ExpandedNodeId, org.opcfoundation.ua.builtintypes.NodeId, boolean) to add new references to the node.

Parameters:
references - the references to set
See Also:
UaNode.getReferences(), UaNode.getReference(NodeId, boolean)

setUserWriteMask

public void setUserWriteMask(EnumSet<WriteAccess> userWriteMask)
Parameters:
userWriteMask - the new UserWriteMask to set
See Also:
UaNode.getUserWriteMask()

setWriteMask

public void setWriteMask(EnumSet<WriteAccess> writeMask)
Parameters:
writeMask - the new WriteMask to set
See Also:
UaNode.getWriteMask()

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).

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 Object

writeAttribute

public final boolean writeAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                    org.opcfoundation.ua.builtintypes.DataValue dataValue)
                             throws StatusException
Write the attribute value in a node. The methods checks the access rights and that the node type supports the specified attribute before writing the value to the node.

Parameters:
attributeId - the attribute
dataValue - 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 it
Returns:
true if the write was completed, false if it will complete later, asynchronously
Throws:
StatusException - if the write is not accepted (for above mentioned reasons)
See Also:
UaNode.supportsAttribute(UnsignedInteger)

addReference

protected UaReference addReference(UaReference reference)

afterAddReference

protected void afterAddReference(UaReference reference)
Parameters:
reference -

afterDeleteReference

protected void afterDeleteReference(UaReference reference)
Parameters:
reference -

assertTypeSupport

protected void assertTypeSupport(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)

assertTypeSupport

protected void assertTypeSupport(org.opcfoundation.ua.builtintypes.NodeId typeDefinition)

beforeAddReference

protected boolean beforeAddReference(UaReference reference)
Parameters:
reference -
Returns:

doAddProperty

protected boolean doAddProperty(UaProperty property)
Parameters:
property -
Returns:

findPlaceholders

protected <T extends UaNode> List<T> findPlaceholders(Class<T> clazz,
                                                      org.opcfoundation.ua.builtintypes.ExpandedNodeId placeholderId,
                                                      org.opcfoundation.ua.builtintypes.ExpandedNodeId referenceTypeId)
Searches UaNodes that match given Placeholder ModellingRule node. Returns all nodes that are reference by same or subtype ReferenceType and have same TypeDefinition or subtype than the given placeholder InstanceDeclaration. Note! If the placeholder does not have a TypeDefinition (e.g. it is Method), then the comparison is done using NodeClass only.

Parameters:
clazz -
placeholderId -
referenceTypeId -
Returns:
nodes that match given conditions or empty if none match. Returns null if exception encountered.

getAttributes

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

getReferenceList

protected Collection<UaReference> getReferenceList()
Description copied from class: AbstractUaNode
Returns all references the node has.

Specified by:
getReferenceList in class AbstractUaNode

initSupportedAttributes

protected void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)

readAttributeValue

protected void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                  org.opcfoundation.ua.builtintypes.DataValue dataValue)
                           throws StatusException
Read the value of an attribute.

Parameters:
attributeId - the ID of the attribute to read.
dataValue - the DataValue structure in which the value is set.
locale - the locale for LocalizedTexts
Throws:
StatusException

referenceTypeInherits

protected boolean referenceTypeInherits(org.opcfoundation.ua.builtintypes.NodeId typeId,
                                        org.opcfoundation.ua.builtintypes.NodeId... referenceTypeIds)
Description copied from class: AbstractUaNode
Checks if the given reference type inherits from any of the defined types.

Specified by:
referenceTypeInherits in class AbstractUaNode

setNodeVersion

protected void setNodeVersion(String nodeVersion)
                       throws StatusException
Set the value of the NodeVersion property.

Parameters:
nodeVersion -
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
Throws:
StatusException


Copyright © 2018. All rights reserved.