com.prosysopc.ua.server.nodes
Class BaseNode

java.lang.Object
  extended by com.prosysopc.ua.nodes.AbstractUaNode
      extended by com.prosysopc.ua.server.nodes.ServerNode
          extended by com.prosysopc.ua.server.nodes.BaseNode
All Implemented Interfaces:
UaNode
Direct Known Subclasses:
UaExternalNodeImpl, UaInstanceNode, UaMethodNode, UaTypeNode, UaViewNode

public abstract class BaseNode
extends ServerNode

Straight forward, server side 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
static org.opcfoundation.ua.builtintypes.QualifiedName NODE_VERSION_PROPERTY_NAME
           
 
Fields inherited from class com.prosysopc.ua.server.nodes.ServerNode
eventListeners, INITIALIZATION_TIME, nodeManager, supportedAttributesMap
 
Constructor Summary
protected BaseNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
  BaseNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
          Create a new node.
  BaseNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, Locale locale)
           
 
Method Summary
protected
<T> PlainProperty<T>
addPlainProperty(org.opcfoundation.ua.builtintypes.NodeId nodeId, String name)
          Creates a new PlainProperty with the given NodeId and Name, which is used to initialize the BrowseName (using the namespaceIndex of the NodeId) and DisplayName (using LocalizedText.NO_LOCALE).
protected
<T> PlainVariable<T>
addPlainVariable(org.opcfoundation.ua.builtintypes.NodeId nodeId, String name)
          Creates a new PlainVariable with the given NodeId and Name, which is used to initialize the BrowseName (using the namespaceIndex of the NodeId) and DisplayName (using LocalizedText.NO_LOCALE).
protected  void assertTypeSupport(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
           
protected  void assertTypeSupport(org.opcfoundation.ua.builtintypes.NodeId typeDefinition)
           
 org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent, String name)
          Create a new string type NodeId as ".
protected  org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent, String name, int namespaceIndex)
          Create a new string type NodeId as "_", where ParentNodeId is the Node Id of the parent converted to string.
protected  ReflectiveInstanceProperty createReflectiveInstanceProperty(String name, org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId)
           
protected  ReflectiveInstanceProperty createReflectiveInstanceProperty(String name, org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId, org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 UaReference deleteReference(org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId, org.opcfoundation.ua.builtintypes.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  org.opcfoundation.ua.core.NodeAttributes getAttributes()
           
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.
 UaProperty getNodeVersion()
           
 String getNodeVersionValue()
           
 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.
protected  List<UaReference> getReferencesAsList(Boolean isInverse, org.opcfoundation.ua.builtintypes.NodeId... referenceTypeIds)
           
protected static org.opcfoundation.ua.builtintypes.QualifiedName getStandardBrowseName(String name)
           
protected static org.opcfoundation.ua.builtintypes.LocalizedText getStandardDisplayText(String name)
           
 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.
 boolean hasProperty(org.opcfoundation.ua.builtintypes.QualifiedName propertyName)
           
protected  UaReference hasReference(UaReference reference)
           
 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.
 void incNodeVersion()
          Increment NodeVersion property to the next integer value.
 void initNodeVersion()
          Initializes NodeVersion property to version number "1".
protected  boolean isChildOfType()
           
 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  CallbackInstanceProperty registerCallbackProperty(String name, org.opcfoundation.ua.builtintypes.NodeId dataTypeId, org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId, UaVariableCallback callback)
           
protected
<T> PlainInstanceProperty<T>
registerPlainInstanceProperty(String name, org.opcfoundation.ua.builtintypes.NodeId instanceDecalarationId, org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
          Register a new property node as a property of this node.
protected
<T> PlainInstanceProperty<T>
registerPlainInstanceProperty(String name, org.opcfoundation.ua.builtintypes.NodeId instanceDecalarationId, T initialValue)
          Register a new property node as a property of this node.
protected
<T> PlainProperty<T>
registerPlainProperty(String name, org.opcfoundation.ua.builtintypes.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, org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId, org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
          Create a new variable as a component of this node.
protected
<T> PlainVariable<T>
registerPlainVariable(String name, org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId, T initialValue)
          Create a new variable as a component of this node.
protected  void registerReflectiveInstanceProperty(String name, org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId, org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
           
protected  ReflectiveInstanceVariable registerReflectiveInstanceVariable(org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, org.opcfoundation.ua.builtintypes.NodeId instanceDecalarationId, org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
           
protected  ReflectiveProperty registerReflectiveProperty(org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
           
protected  ReflectiveVariable registerReflectiveVariable(org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
           
 UaProperty removeProperty(org.opcfoundation.ua.builtintypes.QualifiedName name)
          Remove the property with the specified name.
protected  void setAccessLevelRecursively(EnumSet<org.opcfoundation.ua.core.AccessLevel> accessLevel)
           
static void setAccessLevelRecursively(UaNode node, EnumSet<org.opcfoundation.ua.core.AccessLevel> accessLevel, org.opcfoundation.ua.builtintypes.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(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)
           
 void setNodeVersionValue(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 setUserWriteMask(EnumSet<WriteAccess> userWriteMask)
           
 void setWriteMask(EnumSet<WriteAccess> writeMask)
           
 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.server.nodes.ServerNode
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, getReference, getReferenceList, getReferences, getSupportedAttributes, getTargetNodes, hashCode, initSupportedAttributes, isAddNotifierReferencesToServerObject, isFalseOrNull, isMandatory, isMonitoredForEvents, isTrueOrNull, isType, referenceTypeInherits, removeComponent, removeDataChangeListener, removeEventListener, setAddNotifierReferencesToServerObject, setReferences, supportsAttribute, translateBrowsePathToNodeIds, validateHasEventSourceChain, validateHasEventSourceChain
 
Methods inherited from class com.prosysopc.ua.nodes.AbstractUaNode
getForwardReferences, getInverseReferences, getReferences, getReferences, referenceTypeInherits
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NODE_VERSION_PROPERTY_NAME

public static final org.opcfoundation.ua.builtintypes.QualifiedName NODE_VERSION_PROPERTY_NAME
Constructor Detail

BaseNode

public BaseNode(NodeManagerUaNode nodeManager,
                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 -

BaseNode

public BaseNode(NodeManagerUaNode nodeManager,
                org.opcfoundation.ua.builtintypes.NodeId nodeId,
                String name,
                Locale locale)

BaseNode

protected BaseNode(NodeManagerUaNode nodeManager,
                   org.opcfoundation.ua.builtintypes.NodeId nodeId)
Parameters:
nodeManager -
Method Detail

setAccessLevelRecursively

public static void setAccessLevelRecursively(UaNode node,
                                             EnumSet<org.opcfoundation.ua.core.AccessLevel> accessLevel,
                                             org.opcfoundation.ua.builtintypes.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.

Parameters:
node - the node from which to start the recursive setting
accessLevel - the access level to set to all nodes
referenceTypeIds - the reference types to look for child nodes. Default is Aggregates

getStandardBrowseName

protected static org.opcfoundation.ua.builtintypes.QualifiedName getStandardBrowseName(String name)

getStandardDisplayText

protected static org.opcfoundation.ua.builtintypes.LocalizedText getStandardDisplayText(String name)
Parameters:
name -
Returns:

createNodeId

public org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent,
                                                             String name)
Create a new string type NodeId as ".", where ParentNodeId is the Node Id of the parent converted to string. The NamespaceIndex will be the same as the parent's.

Parameters:
parent - the parent node - must not be null
name - the name of the property, used for both BrowseName and DisplayName
Returns:

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.

Specified by:
deleteReference in interface UaNode
Overrides:
deleteReference in class ServerNode
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(UaReference reference)
Description copied from interface: UaNode
Delete a reference from the node.

Specified by:
deleteReference in interface UaNode
Overrides:
deleteReference in class ServerNode
Parameters:
reference -

getAttributes

public abstract org.opcfoundation.ua.core.NodeAttributes getAttributes()
Returns:

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 -
Returns:

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.

getNodeVersion

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

getNodeVersionValue

public String getNodeVersionValue()

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,
                                                                    IllegalArgumentException
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

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.

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

incNodeVersion

public void incNodeVersion()
                    throws NumberFormatException
Increment NodeVersion property to the next integer value.

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

Throws:
NumberFormatException - if the current nodeVersion string does not contain a parsable integer

initNodeVersion

public void initNodeVersion()
Initializes NodeVersion property to version number "1".

Node's that have the optional NodeVersion Property can participate in a GeneralModelChangeEvent. See NodeManagerRoot.beginModelChange() for how to trigger these events.


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)

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

setNodeVersionValue

public void setNodeVersionValue(String nodeVersion)
Set the value of the NodeVersion property.

Parameters:
nodeVersion - a new string value for the version. Internally we try to use this as an Integer, which is incremented, using incNodeVersion()

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

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

toString

public String toString()
Overrides:
toString in class ServerNode

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)

addPlainProperty

protected <T> PlainProperty<T> addPlainProperty(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                                String name)
Creates a new PlainProperty with the given NodeId and Name, which is used to initialize the BrowseName (using the namespaceIndex of the NodeId) and DisplayName (using LocalizedText.NO_LOCALE).

It also calls addProperty to add the variable to the current node.

Parameters:
nodeId - the Node ID used for the new property
name - The name used initialize the property
Returns:
the new variable

addPlainVariable

protected <T> PlainVariable<T> addPlainVariable(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                                String name)
Creates a new PlainVariable with the given NodeId and Name, which is used to initialize the BrowseName (using the namespaceIndex of the NodeId) and DisplayName (using LocalizedText.NO_LOCALE).

It also calls addComponent to add the variable to the current node.

Parameters:
nodeId - the Node ID used for the new variable
name - The name used initialize the variable.
Returns:
the new variable

assertTypeSupport

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

assertTypeSupport

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

createNodeId

protected org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent,
                                                                String name,
                                                                int namespaceIndex)
Create a new string type NodeId as "_", where ParentNodeId is the Node Id of the parent converted to string. The NamespaceIndex will be the same as the parent's.

Parameters:
parent - the parent node - must not be null
name - the name of the property, used for both BrowseName and DisplayName
namespaceIndex - the namespacIndex to use for the NodeId. If you omit it, the namespaceIndex of parent is used.
Returns:

createReflectiveInstanceProperty

protected ReflectiveInstanceProperty createReflectiveInstanceProperty(String name,
                                                                      org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId)
                                                               throws SecurityException,
                                                                      NoSuchMethodException,
                                                                      StatusException
Parameters:
name -
instanceDeclarationId -
Returns:
Throws:
StatusException
NoSuchMethodException
SecurityException

createReflectiveInstanceProperty

protected ReflectiveInstanceProperty createReflectiveInstanceProperty(String name,
                                                                      org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId,
                                                                      org.opcfoundation.ua.builtintypes.NodeId nodeId)
                                                               throws SecurityException,
                                                                      NoSuchMethodException,
                                                                      StatusException
Parameters:
name -
instanceDeclarationId -
Returns:
Throws:
SecurityException
NoSuchMethodException
StatusException

doAddProperty

protected boolean doAddProperty(UaProperty property)
Overrides:
doAddProperty in class ServerNode
Parameters:
property -
Returns:

getAttributes

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

getReferencesAsList

protected List<UaReference> getReferencesAsList(Boolean isInverse,
                                                org.opcfoundation.ua.builtintypes.NodeId... referenceTypeIds)
Overrides:
getReferencesAsList in class AbstractUaNode

hasReference

protected UaReference hasReference(UaReference reference)
Overrides:
hasReference in class ServerNode

isChildOfType

protected boolean isChildOfType()

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.
Throws:
StatusException

registerCallbackProperty

protected CallbackInstanceProperty registerCallbackProperty(String name,
                                                            org.opcfoundation.ua.builtintypes.NodeId dataTypeId,
                                                            org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
                                                            UaVariableCallback callback)
                                                     throws StatusException
Parameters:
name -
dataTypeId -
typeDefinitionId -
callback -
Throws:
StatusException - if instanceDecalarationId cannot be converted to a variable node

registerPlainInstanceProperty

protected <T> PlainInstanceProperty<T> registerPlainInstanceProperty(String name,
                                                                     org.opcfoundation.ua.builtintypes.NodeId instanceDecalarationId,
                                                                     org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
                                                          throws StatusException
Register a new property node as a property of this node.

Parameters:
name - the name of the property
dataTypeId - The data type of the property
Returns:
the new property
Throws:
StatusException - if instanceDecalarationId cannot be converted to a variable

registerPlainInstanceProperty

protected <T> PlainInstanceProperty<T> registerPlainInstanceProperty(String name,
                                                                     org.opcfoundation.ua.builtintypes.NodeId instanceDecalarationId,
                                                                     T initialValue)
                                                          throws StatusException
Register a new property node as a property of this node.

Parameters:
name - the name of the property
initialValue - 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.
Returns:
the new property
Throws:
StatusException - if instanceDecalarationId cannot be converted to a variable

registerPlainProperty

protected <T> PlainProperty<T> registerPlainProperty(String name,
                                                     org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
Register a new property node as a property of this node.

Parameters:
name - the name of the property
dataTypeId - The data type of the property
Returns:
the new property

registerPlainProperty

protected <T> PlainProperty<T> registerPlainProperty(String name,
                                                     T initialValue)
Register a new property node as a property of this node.

Parameters:
name - the name of the property
initialValue - 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.
Returns:
the new property

registerPlainVariable

protected <T> PlainVariable<T> registerPlainVariable(String name,
                                                     org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
                                                     org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
Create a new variable as a component of this node.

Parameters:
name - the name of the variable
typeDefinitionId - The type definition of the variable
dataTypeId - The data type of the variable
Returns:
the new variable

registerPlainVariable

protected <T> PlainVariable<T> registerPlainVariable(String name,
                                                     org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
                                                     T initialValue)
Create a new variable as a component of this node.

Parameters:
name - the name of the variable
typeDefinitionId - The type definition of the variable
initialValue - 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.
Returns:
the new variable

registerReflectiveInstanceProperty

protected void registerReflectiveInstanceProperty(String name,
                                                  org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId,
                                                  org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
                                           throws IllegalArgumentException
Parameters:
name -
instanceDeclarationId -
dataTypeId -
Throws:
SecurityException
NoSuchMethodException
StatusException - if instanceDecalarationId cannot be converted to a variable node
IllegalArgumentException

registerReflectiveInstanceVariable

protected ReflectiveInstanceVariable registerReflectiveInstanceVariable(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                                                        String name,
                                                                        org.opcfoundation.ua.builtintypes.NodeId instanceDecalarationId,
                                                                        org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
                                                                 throws SecurityException,
                                                                        NoSuchMethodException,
                                                                        StatusException
Parameters:
nodeId -
name -
dataTypeId -
instanceDecalarationId -
Returns:
Throws:
NoSuchMethodException
SecurityException
StatusException - if instanceDecalarationId cannot be converted to a variable node

registerReflectiveProperty

protected ReflectiveProperty registerReflectiveProperty(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                                        String name,
                                                        org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
                                                 throws SecurityException,
                                                        NoSuchMethodException
Parameters:
nodeId -
name -
dataTypeId -
Returns:
Throws:
NoSuchMethodException
SecurityException

registerReflectiveVariable

protected ReflectiveVariable registerReflectiveVariable(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                                        String name,
                                                        org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
                                                 throws SecurityException,
                                                        NoSuchMethodException
Parameters:
nodeId -
name -
dataTypeId -
Returns:
Throws:
NoSuchMethodException
SecurityException

setAccessLevelRecursively

protected void setAccessLevelRecursively(EnumSet<org.opcfoundation.ua.core.AccessLevel> accessLevel)
Parameters:
accessLevel -

writeAttributeValue

protected void writeAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                   Object value,
                                   org.opcfoundation.ua.builtintypes.StatusCode statusCode,
                                   org.opcfoundation.ua.builtintypes.DateTime sourceTime,
                                   org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
                            throws StatusException
Overrides:
writeAttributeValue in class ServerNode
Throws:
StatusException


Copyright © 2018. All rights reserved.