com.prosysopc.ua.server.nodes
Class UaExternalNodeImpl

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
              extended by com.prosysopc.ua.server.nodes.UaExternalNodeImpl
All Implemented Interfaces:
UaNode, UaType, UaExternalNode

public class UaExternalNodeImpl
extends BaseNode
implements UaExternalNode

A server side implementation of the UaExternalNode.


Field Summary
protected static org.slf4j.Logger logger
           
 
Fields inherited from class com.prosysopc.ua.server.nodes.BaseNode
NODE_VERSION_PROPERTY_NAME
 
Fields inherited from class com.prosysopc.ua.server.nodes.ServerNode
eventListeners, INITIALIZATION_TIME, nodeManager, supportedAttributesMap
 
Constructor Summary
UaExternalNodeImpl(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 
Method Summary
 void addSubType(UaType type)
          Add a new sub type for the type.
 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.
 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 getIsAbstract()
          A boolean Attribute with the following values: true it is an abstract Type, i.e. no instances of this type shall exist, only of its subtypes.
 Class<?> getJavaClass()
          Defines a Java class which is used to keep data of the specified UA type.
 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()
           
 UaType getSuperType()
           
 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 hasSuperType()
           
 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.
 boolean inheritsFrom(org.opcfoundation.ua.builtintypes.NodeId typeId)
          Check if the type inherits from the specified type.
 boolean inheritsFrom(UaType type)
          Check if the type inherits from the specified type.
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.
 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)
           
 void setIsAbstract(Boolean isAbstract)
           
 void setJavaClass(Class<?> javaClass)
           
 void setSuperType(UaType parent)
          Set the ModelParent reference.
 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()
           
 
Methods inherited from class com.prosysopc.ua.server.nodes.BaseNode
addPlainProperty, addPlainVariable, assertTypeSupport, assertTypeSupport, createNodeId, createNodeId, createReflectiveInstanceProperty, createReflectiveInstanceProperty, deleteReference, deleteReference, doAddProperty, getAttributes, getComponents, getDescription, getDisplayName, getNodeVersionValue, getProperties, getProperty, getPropertyValue, getReferencesAsList, getStandardBrowseName, getStandardDisplayText, hasProperty, hasReference, hasTypeDefinition, incNodeVersion, initNodeVersion, isChildOfType, readAttribute, readAttributeValue, registerCallbackProperty, registerPlainInstanceProperty, registerPlainInstanceProperty, registerPlainProperty, registerPlainProperty, registerPlainVariable, registerPlainVariable, registerReflectiveInstanceProperty, registerReflectiveInstanceVariable, registerReflectiveProperty, registerReflectiveVariable, setAccessLevelRecursively, setAccessLevelRecursively, setNodeVersionValue, setPropertyValue, writeAttribute, writeAttributeValue
 
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, isAddNotifierReferencesToServerObject, isFalseOrNull, isMandatory, isMonitoredForEvents, isTrueOrNull, isType, referenceTypeInherits, removeComponent, removeDataChangeListener, removeEventListener, setAddNotifierReferencesToServerObject, setReferences, 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
 
Methods inherited from interface com.prosysopc.ua.nodes.UaNode
addComponent, addProperty, addReference, addReference, addReference, deleteReference, deleteReference, deleteReference, deleteReference, getAddressSpace, getComponents, getForwardReferences, getInverseReferences, getNodeId, getProperties, getProperty, getReference, getReferences, getReferences, getSupportedAttributes, readAttribute, removeComponent, setReferences, writeAttribute
 

Field Detail

logger

protected static final org.slf4j.Logger logger
Constructor Detail

UaExternalNodeImpl

public UaExternalNodeImpl(NodeManagerUaNode nodeManager,
                          org.opcfoundation.ua.builtintypes.NodeId nodeId)
Method Detail

addSubType

public void addSubType(UaType type)
Description copied from interface: UaType
Add a new sub type for the type.

Adds a new reference of type HasSubType to the node with target set to type.

Specified by:
addSubType in interface UaType
Parameters:
type - the node to add.

getAttributes

public org.opcfoundation.ua.core.NodeAttributes getAttributes()
Specified by:
getAttributes in interface UaNode
Specified by:
getAttributes in class BaseNode
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
Overrides:
getBrowseName in class BaseNode
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
Overrides:
getComponent in class BaseNode
Parameters:
componentName - the BrowseName of the component to get
Returns:
the component node or null, if no matching component is found.

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
Overrides:
getDescription in class BaseNode
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
Overrides:
getDisplayName in class BaseNode
Returns:
the DisplayName in the default locale

getIsAbstract

public Boolean getIsAbstract()
Description copied from interface: UaType
A boolean Attribute with the following values:
true it is an abstract Type, i.e. no instances of this type shall exist, only of its subtypes.
false it is not an abstract Type, i.e. instances of this type can exist.

Specified by:
getIsAbstract in interface UaType
Returns:
the current value of IsAbstract

getJavaClass

public Class<?> getJavaClass()
Description copied from interface: UaType
Defines a Java class which is used to keep data of the specified UA type. Mostly used for UA DataTypes, but can also define classes for specific object and variable types.

For example, the node for UA DataType Int32 typically defines java.lang.Integer as the Java class.

Specified by:
getJavaClass in interface UaType
Returns:
the Java class used for the type

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
Overrides:
getMethod in class BaseNode
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

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
Overrides:
getNodeClass in class BaseNode
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
Overrides:
getNodeVersion in class BaseNode
Returns:
the NodeVersion property. This is an optional property, so it may be null, if the property is not defined.

getSuperType

public UaType getSuperType()
Specified by:
getSuperType in interface UaType
Returns:
the UA type that is defined as the ancestor of the type in the UA AddressSpace. Or null, if the type has no super type (e.g. BaseObjectType has no super type)
See Also:
UaType.hasSuperType()

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
Overrides:
getUserWriteMask in class BaseNode
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.

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

hasSuperType

public boolean hasSuperType()
Specified by:
hasSuperType in interface UaType
Returns:
whether the type has a super type. If not, UaType.getSuperType() returns null.

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
Overrides:
hasUserWriteAccess in class BaseNode
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
Overrides:
hasWriteAccess in class BaseNode
Parameters:
attributeId - the attribute to check
Returns:
true if the attribute may be written to

inheritsFrom

public boolean inheritsFrom(org.opcfoundation.ua.builtintypes.NodeId typeId)
Description copied from interface: UaType
Check if the type inherits from the specified type.

Specified by:
inheritsFrom in interface UaType
Parameters:
typeId - The NodeId of the type to check
Returns:
true if this type inherits from the specified type, i.e. it is itself or (recursively) has a modelParent that equals to typeId
See Also:
UaType.getSuperType()

inheritsFrom

public boolean inheritsFrom(UaType type)
Description copied from interface: UaType
Check if the type inherits from the specified type.

Specified by:
inheritsFrom in interface UaType
Parameters:
type - The NodeId of the type to check
Returns:
true if this type inherits from the specified type, i.e. it is itself or (recursively) has a modelParent that equals to typeId
See Also:
UaType.getSuperType()

readAttribute

public org.opcfoundation.ua.builtintypes.DataValue readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Description copied from class: BaseNode
Read the current value of an attribute.

Specified by:
readAttribute in interface UaNode
Overrides:
readAttribute in class BaseNode
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 data value
See Also:
UaNode.supportsAttribute(UnsignedInteger)

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
Overrides:
removeProperty in class BaseNode
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
Description copied from class: BaseNode
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
Overrides:
setAttribute in class BaseNode
Throws:
StatusException

setAttributes

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

setBrowseName

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

setDescription

public void setDescription(org.opcfoundation.ua.builtintypes.LocalizedText description)
Specified by:
setDescription in interface UaNode
Overrides:
setDescription in class BaseNode
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
Overrides:
setDisplayName in class BaseNode
Parameters:
displayName - the new DisplayName to set
See Also:
UaNode.getDisplayName()

setIsAbstract

public void setIsAbstract(Boolean isAbstract)
Specified by:
setIsAbstract in interface UaType
Parameters:
isAbstract - the value to set for IsAbstract
See Also:
UaType.getIsAbstract()

setJavaClass

public void setJavaClass(Class<?> javaClass)
Specified by:
setJavaClass in interface UaType
Parameters:
javaClass - the Java class to use for the type.
See Also:
UaType.getJavaClass()

setSuperType

public void setSuperType(UaType parent)
Description copied from interface: UaType
Set the ModelParent reference.

Specified by:
setSuperType in interface UaType
Parameters:
parent - the super type to set.

setUserWriteMask

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

setWriteMask

public void setWriteMask(EnumSet<WriteAccess> writeMask)
Specified by:
setWriteMask in interface UaNode
Overrides:
setWriteMask in class BaseNode
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).

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

initSupportedAttributes

protected void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
Overrides:
initSupportedAttributes in class ServerNode


Copyright © 2018. All rights reserved.