com.prosysopc.ua.server.nodes
Class InstanceVariable

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.InstanceVariable
All Implemented Interfaces:
UaInstance, UaNode, UaValueNode, UaVariable
Direct Known Subclasses:
CallbackInstanceVariable, PlainInstanceVariable

public abstract class InstanceVariable
extends ServerNode
implements UaVariable

An instance variable is a light-weight implementation of an UaVariable, which actually refers to an InstanceDeclaration of a type node.

The variable will fetch most of the attribute values from the InstanceDeclaration, and only keeps the current value in an internal field. This helps to reduce memory consumption over 90% compared to the "heavy-weight" variables, such as CacheVariable.

The InstanceVariables are used in the complex type nodes, such as the Condition nodes and Data Access nodes, which are implementing the structures of OPC UA standard types.

InstanceVariable is an abstract base class: see the subclasses, CallbackInstanceVariable and PlainInstanceVariable for actual implementations.


Field Summary
 
Fields inherited from class com.prosysopc.ua.server.nodes.ServerNode
eventListeners, INITIALIZATION_TIME, nodeManager, supportedAttributesMap
 
Constructor Summary
InstanceVariable(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId)
          Create a new node, referring to an instance declaration node.
InstanceVariable(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaVariable instanceDeclaration)
          Create a new node, referring to an instance declaration node.
 
Method Summary
 UaReference addReference(UaNode targetNode, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isInverse)
          Add a reference to the node.
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.
protected abstract  void doSetValue(org.opcfoundation.ua.builtintypes.DataValue value)
          Perform the actual value set.
 EnumSet<org.opcfoundation.ua.core.AccessLevel> getAccessLevel()
          Defines the global read/write access of the Value attribute for all users.
 org.opcfoundation.ua.builtintypes.UnsignedInteger[] getArrayDimensions()
          This Attribute specifies the length of each dimension for an array value.
 org.opcfoundation.ua.core.NodeAttributes getAttributes()
           
 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.
 UaType getDataType()
           
 org.opcfoundation.ua.builtintypes.NodeId getDataTypeId()
           
 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 getDisplayName()
          The DisplayName Attribute contains the localised name of the Node.
 Boolean getHistorizing()
           
 UaMethod getMethod(org.opcfoundation.ua.builtintypes.QualifiedName methodName)
          Get the method, which has the specified name.
 Double getMinimumSamplingInterval()
           
 org.opcfoundation.ua.core.NodeClass getNodeClass()
          The NodeClass Attribute identifies the NodeClass of a Node.
 UaProperty getNodeVersion()
           
 UaProperty[] getProperties()
           
 UaProperty getProperty(org.opcfoundation.ua.builtintypes.QualifiedName name)
          Find the property with the specified name.
protected  UaType getPropertyTypeNode()
           
 UaReference getReference(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isInverse)
          Finds the first reference of the specified reference type.
protected  List<UaReference> getReferencesAsList(Boolean isInverse, org.opcfoundation.ua.builtintypes.NodeId... referenceTypeIds)
           
 org.opcfoundation.ua.builtintypes.StatusCode getStatus()
           
 UaType getTypeDefinition()
          The UaType object corresponding to TypeDefinitionId.
 org.opcfoundation.ua.builtintypes.ExpandedNodeId getTypeDefinitionId()
          Reference to the NodeId of the object's type definition.
protected  UaServerReference getTypeDefinitionReference()
           
 EnumSet<org.opcfoundation.ua.core.AccessLevel> getUserAccessLevel()
          Defines the user specific read/write access of the Value attribute.
 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.
 Integer getValueRank()
          This Attribute indicates whether the Value Attribute of the Variable is an array and how many dimensions the array has.
 EnumSet<WriteAccess> getWriteMask()
          The optional WriteMask Attribute exposes the possibilities of a client to write the Attributes of the Node.
 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.
 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)
           
 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 setAccessLevel(EnumSet<org.opcfoundation.ua.core.AccessLevel> accessLevel)
           
 void setArrayDimensions(org.opcfoundation.ua.builtintypes.UnsignedInteger[] arrayDimensions)
          This Attribute specifies the length of each dimension for an array value.
 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 setDataType(UaType dataType)
          Set the Data Type node.
 void setDataTypeId(org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
          Set the Data Type.
 void setDescription(org.opcfoundation.ua.builtintypes.LocalizedText description)
           
 void setDisplayName(org.opcfoundation.ua.builtintypes.LocalizedText displayName)
           
 void setHistorizing(Boolean historizing)
           
 void setMinimumSamplingInterval(Double minimumSamplingInterval)
           
 void setReferences(UaReference[] references)
          Set all references of the node at one call.
 void setStatus(org.opcfoundation.ua.builtintypes.StatusCode status)
          Set the status of the variable.
 void setTypeDefinition(UaType type)
          Sets the type definition of the node using an UaType node.
 void setTypeDefinitionId(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId)
          Sets the type definition to an ExpandedNodeId.
 void setTypeDefinitionId(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
          Sets the type definition to a local NodeId.
 void setUserAccessLevel(EnumSet<org.opcfoundation.ua.core.AccessLevel> userAccessLevel)
           
 void setUserWriteMask(EnumSet<WriteAccess> userWriteMask)
           
 void setValue(org.opcfoundation.ua.builtintypes.DataValue value)
          The default Value for instances of this type.
 void setValue(Object value)
          Set value.
 void setValueRank(int valueRank)
          This Attribute indicates whether the Value Attribute of the VariableType is an array and how many dimensions the array has.
 void setWriteMask(EnumSet<WriteAccess> writeMask)
           
 boolean writeAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Write the attribute value in a node.
 
Methods inherited from class com.prosysopc.ua.server.nodes.ServerNode
addComponent, addDataChangeListener, addEventListener, addNewReference, addNewReference, addOrganizes, addProperties, addProperty, addReference, addReference, addReference, addReference, addReference, afterAddReference, afterDeleteReference, dataChange, deleteReference, deleteReference, deleteReference, deleteReferences, doAddProperty, doDeleteReference, equals, findPlaceholders, fireDataChange, fireEvent, fireEventInParents, getAddressSpace, getDefaultBrowseName, getNodeId, getNodeManager, getReferenceList, getReferences, getSupportedAttributes, getTargetNodes, hashCode, hasReference, initSupportedAttributes, isAddNotifierReferencesToServerObject, isFalseOrNull, isMandatory, isMonitoredForEvents, isTrueOrNull, isType, referenceTypeInherits, removeDataChangeListener, removeEventListener, setAddNotifierReferencesToServerObject, supportsAttribute, toString, translateBrowsePathToNodeIds, validateHasEventSourceChain, validateHasEventSourceChain, writeAttributeValue
 
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
 
Methods inherited from interface com.prosysopc.ua.nodes.UaVariable
addDataChangeListener, removeDataChangeListener
 
Methods inherited from interface com.prosysopc.ua.nodes.UaValueNode
getValue
 
Methods inherited from interface com.prosysopc.ua.nodes.UaNode
addComponent, addProperty, addReference, addReference, deleteReference, deleteReference, deleteReference, getAddressSpace, getForwardReferences, getInverseReferences, getNodeId, getReferences, getReferences, getSupportedAttributes, supportsAttribute
 

Constructor Detail

InstanceVariable

public InstanceVariable(NodeManagerUaNode nodeManager,
                        org.opcfoundation.ua.builtintypes.NodeId nodeId,
                        org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId)
                 throws StatusException
Create a new node, referring to an instance declaration node.

Parameters:
nodeManager - The node manager to which the node is created.
nodeId - The ID of the new node.
instanceDeclarationId - The ID of the instance declaration node, which this node is referring to. I.e. the same variable or property as this one, but under the type, instead of the instance.
Throws:
StatusException - if instanceDeclarationId cannot be converted to a variable node

InstanceVariable

public InstanceVariable(NodeManagerUaNode nodeManager,
                        org.opcfoundation.ua.builtintypes.NodeId nodeId,
                        UaVariable instanceDeclaration)
Create a new node, referring to an instance declaration node.

Parameters:
nodeManager - The node manager to which the node is created.
nodeId - The ID of the new node.
instanceDeclaration - The instance declaration node, which this node is referring to. I.e. the same variable or property as this one, but under the type, instead of the instance.
Method Detail

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.

Specified by:
addReference in interface UaNode
Overrides:
addReference in class ServerNode
Parameters:
targetNode - The target node where the reference points to.
referenceTypeId - The type of reference.
isInverse - Whether the reference is an inverse reference.
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).

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

getAccessLevel

public EnumSet<org.opcfoundation.ua.core.AccessLevel> getAccessLevel()
Description copied from interface: UaVariable
Defines the global read/write access of the Value attribute for all users.

In contrast to the WriteAccess this attribute only applies to the Value attribute.

Specified by:
getAccessLevel in interface UaVariable
Returns:
the current global access rights
See Also:
UaVariable.getUserAccessLevel()

getArrayDimensions

public org.opcfoundation.ua.builtintypes.UnsignedInteger[] getArrayDimensions()
Description copied from interface: UaValueNode
This Attribute specifies the length of each dimension for an array value. The Attribute is intended to describe the capability of the Variable, not the current size.

The number of elements shall be equal to the value of the ValueRank Attribute. Shall be null if ValueRank <= 0.

A value of 0 for an individual dimension indicates that the dimension has a variable length.

For example, if a Variable is defined by the following C array: Int32 myArray[346];

then this Variable's DataType would point to an Int32, the Variable's ValueRank has the value 1 and the ArrayDimensions is an array with one entry having the value 346.

Specified by:
getArrayDimensions in interface UaValueNode
Returns:
the array dimensions of the variable type or null if this is not a specific array type, i.e. ValueRank <= 0
See Also:
UaValueNode.setArrayDimensions(org.opcfoundation.ua.builtintypes.UnsignedInteger[])

getAttributes

public org.opcfoundation.ua.core.NodeAttributes getAttributes()
Specified by:
getAttributes in interface UaNode
Returns:
the current attribute values of the node in a NodeAttributes structure.

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.

Specified by:
getBrowseName in interface UaNode
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.

Specified by:
getComponent in interface UaNode
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.

Specified by:
getComponents in interface UaNode
Returns:
the component nodes.

getDataType

public UaType getDataType()
Specified by:
getDataType in interface UaValueNode
Returns:
the DataType node, if set.
See Also:
UaValueNode.getDataTypeId()

getDataTypeId

public org.opcfoundation.ua.builtintypes.NodeId getDataTypeId()
Specified by:
getDataTypeId in interface UaValueNode
Returns:
NodeId of the data type definition for instances of this type.

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.

Specified by:
getDescription in interface UaNode
Returns:
the Description of the node in the default locale. This may be null.

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.

Specified by:
getDisplayName in interface UaNode
Returns:
the DisplayName in the default locale.

getHistorizing

public Boolean getHistorizing()
Specified by:
getHistorizing in interface UaVariable
Returns:
whether the variable has history

getMethod

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

Specified by:
getMethod in interface UaNode
Parameters:
methodName - the BrowseName (in namespace 0) of the method to get
Returns:
the method node or null, if no matching method is found.
Throws:
ClassCastException - if the node is not a method node

getMinimumSamplingInterval

public Double getMinimumSamplingInterval()
Specified by:
getMinimumSamplingInterval in interface UaVariable
Returns:
the minimum sampling interval that the server supports for the variable

getNodeClass

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

Specified by:
getNodeClass in interface UaNode
Returns:
the Node Class of the node. This is hard-coded and cannot be changed.

getNodeVersion

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

getProperties

public UaProperty[] getProperties()
Specified by:
getProperties in interface UaNode
Returns:
all properties of the node or null if none defined.

getProperty

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

Specified by:
getProperty in interface UaNode
Parameters:
name - the name of the property
Returns:
the property or null, if there is no such property

getReference

public UaReference getReference(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                boolean isInverse)
Description copied from class: ServerNode
Finds the first reference of the specified reference type.

Specified by:
getReference in interface UaNode
Overrides:
getReference in class ServerNode
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

getStatus

public org.opcfoundation.ua.builtintypes.StatusCode getStatus()
Returns:
the current status of the variable value.

getTypeDefinition

public UaType getTypeDefinition()
Description copied from interface: UaInstance
The UaType object corresponding to TypeDefinitionId. Note that the TypeDefinition may be null at certain circumstances although TypeDefinitionId is defined (although it should be implemented generally such that the node is retrieved automatically using TypeDefinitionId).

Specified by:
getTypeDefinition in interface UaInstance
Returns:
the type of the node, if it has such, or null
See Also:
UaInstance.getTypeDefinitionId(), UaInstance.setTypeDefinition(UaType), UaInstance.setTypeDefinitionId(NodeId), UaInstance.setTypeDefinitionId(ExpandedNodeId)

getTypeDefinitionId

public org.opcfoundation.ua.builtintypes.ExpandedNodeId getTypeDefinitionId()
Description copied from interface: UaInstance
Reference to the NodeId of the object's type definition.

Specified by:
getTypeDefinitionId in interface UaInstance
Returns:
the type definition ID of the node. May be null, if no type is defined.
See Also:
UaInstance.getTypeDefinition(), UaInstance.setTypeDefinition(UaType), UaInstance.setTypeDefinitionId(NodeId), UaInstance.setTypeDefinitionId(ExpandedNodeId)

getUserAccessLevel

public EnumSet<org.opcfoundation.ua.core.AccessLevel> getUserAccessLevel()
Description copied from interface: UaVariable
Defines the user specific read/write access of the Value attribute.

In contrast to the UserWriteAccess this attribute only applies to the Value attribute.

Specified by:
getUserAccessLevel in interface UaVariable
Returns:
the current access rights for the user that requested it
See Also:
UaVariable.getAccessLevel()

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.

Specified by:
getUserWriteMask in interface UaNode
Returns:
the current WriteUserMask

getValueRank

public Integer getValueRank()
Description copied from interface: UaValueNode
This Attribute indicates whether the Value Attribute of the Variable is an array and how many dimensions the array has.

It may have the following values:

Specified by:
getValueRank in interface UaValueNode
Returns:
the value rank
See Also:
UaValueNode.setValueRank(int)

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.

Specified by:
getWriteMask in interface UaNode
Returns:
the current set of attributes, which are writeable.

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.

Specified by:
hasUserWriteAccess in interface UaNode
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.

Specified by:
hasWriteAccess in interface UaNode
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)
Description copied from interface: UaNode
Read the current value of an attribute. Note that the method reads the current value in this node object. It does not retrieve the value from the server or from the data source. So it equals to reading the respective property from the node.

Specified by:
readAttribute in interface UaNode
Parameters:
attributeId - the attribute to read - the valid values are defined in Attributes. Also check UaNode.supportsAttribute(UnsignedInteger) whether the node actually supports this attribute type.
Returns:
the current value of the attribute
See Also:
UaNode.supportsAttribute(UnsignedInteger)

readAttribute

public void readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                          org.opcfoundation.ua.builtintypes.DataValue dataValue,
                          Locale locale)
Specified by:
readAttribute in interface UaNode

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.

Specified by:
removeComponent in interface UaNode
Overrides:
removeComponent in class ServerNode
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.

Specified by:
removeProperty in interface UaNode
Parameters:
name - the name of the property
Returns:
the property that was removed or null, if there was no such property

setAccessLevel

public void setAccessLevel(EnumSet<org.opcfoundation.ua.core.AccessLevel> accessLevel)
Specified by:
setAccessLevel in interface UaVariable
Parameters:
accessLevel - the access level to set
See Also:
UaVariable.getAccessLevel()

setArrayDimensions

public void setArrayDimensions(org.opcfoundation.ua.builtintypes.UnsignedInteger[] arrayDimensions)
Description copied from interface: UaValueNode
This Attribute specifies the length of each dimension for an array value. The Attribute is intended to describe the capability of the VariableType, not the current size.

The number of elements shall be equal to the value of the ValueRank Attribute. Shall be null if ValueRank <= 0.

A value of 0 for an individual dimension indicates that the dimension has a variable length.

For example, if a VariableType is defined by the following array:

Integer[] myArray = new Integer[346];

then this VariableType's DataType would point to the Int32 data type node, the VariableType's ValueRank has the value 1 and the ArrayDimensions is an array with one entry having the value 346.

Specified by:
setArrayDimensions in interface UaValueNode

setAttribute

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

Specified by:
setAttribute in interface UaNode
Throws:
StatusException

setAttributes

public void setAttributes(org.opcfoundation.ua.core.NodeAttributes nodeAttributes)
Specified by:
setAttributes in interface UaNode

setBrowseName

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

setDataType

public void setDataType(UaType dataType)
Description copied from interface: UaValueNode
Set the Data Type node.

Specified by:
setDataType in interface UaValueNode
See Also:
UaValueNode.setDataTypeId(NodeId)

setDataTypeId

public void setDataTypeId(org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
Description copied from interface: UaValueNode
Set the Data Type.

Specified by:
setDataTypeId in interface UaValueNode
See Also:
UaValueNode.setDataTypeId(NodeId)

setDescription

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

setDisplayName

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

setHistorizing

public void setHistorizing(Boolean historizing)
Specified by:
setHistorizing in interface UaVariable
Parameters:
historizing - define that the variable has history - or not

setMinimumSamplingInterval

public void setMinimumSamplingInterval(Double minimumSamplingInterval)
Specified by:
setMinimumSamplingInterval in interface UaVariable
Parameters:
minimumSamplingInterval - define the minimum sampling interval

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.

Specified by:
setReferences in interface UaNode
Overrides:
setReferences in class ServerNode
Parameters:
references - the references to set
See Also:
UaNode.getReferences(), UaNode.getReference(NodeId, boolean)

setStatus

public void setStatus(org.opcfoundation.ua.builtintypes.StatusCode status)
Set the status of the variable. If Status is a Bad status, Value is set to null.

The sourceTimestamp is set to null, and serverTimestamp is set to the current time.

Parameters:
status - the status to set

setTypeDefinition

public void setTypeDefinition(UaType type)
Description copied from interface: UaInstance
Sets the type definition of the node using an UaType node.

Specified by:
setTypeDefinition in interface UaInstance
Parameters:
type - The type to set
See Also:
UaInstance.getTypeDefinitionId(), UaInstance.getTypeDefinition(), UaInstance.setTypeDefinitionId(ExpandedNodeId), UaInstance.setTypeDefinitionId(NodeId)

setTypeDefinitionId

public void setTypeDefinitionId(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId)
Description copied from interface: UaInstance
Sets the type definition to an ExpandedNodeId.

Specified by:
setTypeDefinitionId in interface UaInstance
Parameters:
typeDefinitionId - the type definition Id to set
See Also:
UaInstance.getTypeDefinitionId(), UaInstance.getTypeDefinition(), UaInstance.setTypeDefinition(UaType), UaInstance.setTypeDefinitionId(NodeId)

setTypeDefinitionId

public void setTypeDefinitionId(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
Description copied from interface: UaInstance
Sets the type definition to a local NodeId.

If

Specified by:
setTypeDefinitionId in interface UaInstance
Parameters:
typeDefinitionId - the type definition Id to set
See Also:
UaInstance.getTypeDefinitionId(), UaInstance.getTypeDefinition(), UaInstance.setTypeDefinition(UaType), UaInstance.setTypeDefinitionId(ExpandedNodeId)

setUserAccessLevel

public void setUserAccessLevel(EnumSet<org.opcfoundation.ua.core.AccessLevel> userAccessLevel)
Specified by:
setUserAccessLevel in interface UaVariable
Parameters:
userAccessLevel - the user access level to set
See Also:
UaVariable.getUserAccessLevel()

setUserWriteMask

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

setValue

public void setValue(org.opcfoundation.ua.builtintypes.DataValue value)
              throws StatusException
Description copied from interface: UaValueNode
The default Value for instances of this type.

Specified by:
setValue in interface UaValueNode
Parameters:
value - the default value to set
Throws:
StatusException

setValue

public void setValue(Object value)
              throws StatusException
Description copied from interface: UaValueNode
Set value.

Specified by:
setValue in interface UaValueNode
Parameters:
value - a new value
Throws:
StatusException - if the value is invalid for the Value attribute

setValueRank

public void setValueRank(int valueRank)
Description copied from interface: UaValueNode
This Attribute indicates whether the Value Attribute of the VariableType is an array and how many dimensions the array has.

It may have the following values:

Specified by:
setValueRank in interface UaValueNode
Parameters:
valueRank - the value rank to set

setWriteMask

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

writeAttribute

public boolean writeAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                              org.opcfoundation.ua.builtintypes.DataValue dataValue)
                       throws StatusException
Description copied from interface: UaNode
Write the attribute value in a node. The method checks the WriteAccess (and UserWriteAccess) and that the node type supports the specified attribute before writing the value to the node.

Specified by:
writeAttribute in interface UaNode
Parameters:
attributeId - the attribute to write - the valid values are defined in Attributes
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)

beforeAddReference

protected boolean beforeAddReference(UaReference reference)
Overrides:
beforeAddReference in class ServerNode
Returns:

doSetValue

protected abstract void doSetValue(org.opcfoundation.ua.builtintypes.DataValue value)
                            throws StatusException
Perform the actual value set.

Parameters:
value -
Throws:
StatusException

getPropertyTypeNode

protected UaType getPropertyTypeNode()
Returns:
Throws:
StatusException

getReferencesAsList

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

getTypeDefinitionReference

protected UaServerReference getTypeDefinitionReference()
Returns:


Copyright © 2018. All rights reserved.