com.prosysopc.ua.server.nodes
Class UaTypeNode

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.UaTypeNode
All Implemented Interfaces:
UaNode, UaType
Direct Known Subclasses:
UaDataTypeNode, UaObjectTypeNode, UaReferenceTypeNode, UaVariableTypeNode

public abstract class UaTypeNode
extends BaseNode
implements UaType

Generic type node. This is a base node type for all type nodes.

Note that the OPC UA Specification does not define or represent such a common "base class" for all type nodes. However, all type nodes support IsAbstract attribute, and the nodes exist in the Types section of the address space only.


Field Summary
protected  Class<?> javaClass
           
 
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
protected UaTypeNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
           
protected UaTypeNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, Locale locale)
          Create a new node with name to be used for browseName and displayName.
 
Method Summary
 void addSubType(UaType node)
          Add a new sub type for the type.
protected  void afterAddReference(UaReference reference)
           
protected  boolean beforeAddReference(UaReference reference)
           
 UaNode getComponent(org.opcfoundation.ua.builtintypes.QualifiedName componentName)
          Get the component, which has the specified name.
 UaTypeInstanceDeclarationHierarchy getInstanceDeclarationHierarchy()
           
 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.
 UaType getSuperType()
           
 boolean hasSuperType()
           
 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)
           
protected  void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Read the value of an attribute.
 void resetInstanceDeclarationHierarchy()
           
 void setIsAbstract(Boolean isAbstract)
           
 void setJavaClass(Class<?> javaClass)
           
 void setSuperType(UaType superType)
          Set the ModelParent reference.
 String toString()
           
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.BaseNode
addPlainProperty, addPlainVariable, assertTypeSupport, assertTypeSupport, createNodeId, createNodeId, createReflectiveInstanceProperty, createReflectiveInstanceProperty, deleteReference, deleteReference, doAddProperty, getAttributes, getAttributes, getBrowseName, getComponents, getDescription, getDescription, getDisplayName, getDisplayName, getMethod, getNodeClass, getNodeVersion, getNodeVersionValue, getProperties, getProperty, getPropertyValue, getReferencesAsList, getStandardBrowseName, getStandardDisplayText, getUserWriteMask, getWriteMask, hasProperty, hasReference, hasTypeDefinition, hasUserWriteAccess, hasWriteAccess, incNodeVersion, initNodeVersion, isChildOfType, readAttribute, readAttribute, registerCallbackProperty, registerPlainInstanceProperty, registerPlainInstanceProperty, registerPlainProperty, registerPlainProperty, registerPlainVariable, registerPlainVariable, registerReflectiveInstanceProperty, registerReflectiveInstanceVariable, registerReflectiveProperty, registerReflectiveVariable, removeProperty, setAccessLevelRecursively, setAccessLevelRecursively, setAttribute, setAttributes, setBrowseName, setDescription, setDisplayName, setNodeVersionValue, setPropertyValue, setUserWriteMask, setWriteMask, writeAttribute
 
Methods inherited from class com.prosysopc.ua.server.nodes.ServerNode
addComponent, addDataChangeListener, addEventListener, addNewReference, addNewReference, addOrganizes, addProperties, addProperty, addReference, addReference, addReference, addReference, addReference, addReference, afterDeleteReference, 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, 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
 
Methods inherited from interface com.prosysopc.ua.nodes.UaNode
addComponent, addProperty, addReference, addReference, addReference, deleteReference, deleteReference, deleteReference, deleteReference, getAddressSpace, getAttributes, getBrowseName, getComponents, getDescription, getDisplayName, getForwardReferences, getInverseReferences, getMethod, getNodeClass, getNodeId, getNodeVersion, getProperties, getProperty, getReference, getReferences, getReferences, getSupportedAttributes, getUserWriteMask, getWriteMask, hasUserWriteAccess, hasWriteAccess, readAttribute, readAttribute, removeComponent, removeProperty, setAttribute, setAttributes, setBrowseName, setDescription, setDisplayName, setReferences, setUserWriteMask, setWriteMask, supportsAttribute, writeAttribute
 

Field Detail

javaClass

protected Class<?> javaClass
Constructor Detail

UaTypeNode

protected UaTypeNode(NodeManagerUaNode nodeManager,
                     org.opcfoundation.ua.builtintypes.NodeId nodeId,
                     org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                     org.opcfoundation.ua.builtintypes.LocalizedText displayName)

UaTypeNode

protected UaTypeNode(NodeManagerUaNode nodeManager,
                     org.opcfoundation.ua.builtintypes.NodeId nodeId,
                     String name,
                     Locale locale)
Create a new node with name to be used for browseName and displayName.

Parameters:
nodeId -
name -
locale -
Method Detail

addSubType

public void addSubType(UaType node)
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:
node - the node to add.

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.

getInstanceDeclarationHierarchy

public UaTypeInstanceDeclarationHierarchy getInstanceDeclarationHierarchy()

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

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

hasSuperType

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

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

resetInstanceDeclarationHierarchy

public void resetInstanceDeclarationHierarchy()

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 superType)
Description copied from interface: UaType
Set the ModelParent reference.

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

toString

public String toString()
Overrides:
toString in class BaseNode

afterAddReference

protected void afterAddReference(UaReference reference)
Overrides:
afterAddReference in class ServerNode

beforeAddReference

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

initSupportedAttributes

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

readAttributeValue

protected void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                  org.opcfoundation.ua.builtintypes.DataValue dataValue)
                           throws StatusException
Description copied from class: BaseNode
Read the value of an attribute.

Overrides:
readAttributeValue in class BaseNode
Parameters:
attributeId - the ID of the attribute to read.
dataValue - the DataValue structure in which the value is set.
Throws:
StatusException

writeAttributeValue

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


Copyright © 2018. All rights reserved.