com.prosysopc.ua.nodes
Interface UaNodeFactory

All Known Implementing Classes:
UaClientNodeFactory, UaServerNodeFactory

public interface UaNodeFactory

Node Factory is used to create UaNode objects dynamically. You can first register the actual implementation types for different UA NodeClasses and even for specific UA TypeDefinitionIds.

The factory is used through the createNode(org.opcfoundation.ua.core.NodeClass, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText) methods, which construct the objects according to the NodeClass and TypeDefinition, using the previously registered UaNode classes.


Method Summary
 UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
          Create a new Node object based on the nodeClass (or typeDefinition).
 UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName, org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
          Create a new Node object based on the nodeClass (or typeDefinition).
 UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName, org.opcfoundation.ua.builtintypes.NodeId typeDefinition)
          Create a new Node object based on the nodeClass (or typeDefinition).
 UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, Locale locale)
          Create a new Node object based on the nodeClass (or typeDefinition).
 UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, Locale locale, org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId)
          Create a new Node object based on the nodeClass (or typeDefinition).
 UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, Locale locale, org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
           
 Class<? extends UaNode> getClassType(org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
          Return the object class corresponding to the NodeClass or Type.
 Class<? extends UaNode> getClassType(org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.NodeId typeDefinition)
          Return the object class corresponding to the NodeClass or Type.
 void registerNodeClass(org.opcfoundation.ua.core.NodeClass nodeClass, Class<? extends UaNode> clazz)
          Register an actual UaNode class to use when using createNode(org.opcfoundation.ua.core.NodeClass, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText) to create new nodes for a OPC UA NodeClass.
 void registerTypeDefinition(org.opcfoundation.ua.builtintypes.NodeId typeDefinition, Class<? extends UaNode> clazz)
          Register an actual UaNode class to use when using createNode(org.opcfoundation.ua.core.NodeClass, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText) to create new nodes for a OPC UA typeDefinition.
 

Method Detail

createNode

UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass,
                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                  org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                  org.opcfoundation.ua.builtintypes.LocalizedText displayName)
                  throws UaNodeFactoryException
Create a new Node object based on the nodeClass (or typeDefinition).

The method creates a new UaNode object. The class of the Node is selected depending on the nodeClass - or if typeDefinition is provided, also on that.

You can register new Node classes per nodeClass or typeDefinition using registerNodeClass(org.opcfoundation.ua.core.NodeClass, java.lang.Class).

Parameters:
nodeClass - The UA NodeClass
nodeId - The ID of the new node.
browseName - The BrowseName of the new node.
displayName - The DisplayName of the new node.
Returns:
a new UaNode of a concrete class type (UaNode is abstract itself).
Throws:
UaNodeFactoryException - if the class cannot be created.

createNode

UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass,
                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                  org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                  org.opcfoundation.ua.builtintypes.LocalizedText displayName,
                  org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
                  throws UaNodeFactoryException
Create a new Node object based on the nodeClass (or typeDefinition).

The method creates a new UaNode object. The class of the Node is selected depending on the nodeClass - or if typeDefinition is provided, also on that.

You can register new Node classes per nodeClass or typeDefinition using registerNodeClass(org.opcfoundation.ua.core.NodeClass, java.lang.Class).

Parameters:
nodeClass - The UA NodeClass
nodeId - The ID of the new node.
browseName - The BrowseName of the new node.
displayName - The DisplayName of the new node.
typeDefinition - Optional type definition to use for the class selection.
Returns:
a new UaNode of a concrete class type (UaNode is abstract itself).
Throws:
UaNodeFactoryException - if the class cannot be created.

createNode

UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass,
                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                  org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                  org.opcfoundation.ua.builtintypes.LocalizedText displayName,
                  org.opcfoundation.ua.builtintypes.NodeId typeDefinition)
                  throws UaNodeFactoryException
Create a new Node object based on the nodeClass (or typeDefinition).

The method creates a new UaNode object. The class of the Node is selected depending on the nodeClass - or if typeDefinition is provided, also on that.

You can register new Node classes per nodeClass or typeDefinition using registerNodeClass(org.opcfoundation.ua.core.NodeClass, java.lang.Class).

Parameters:
nodeClass - The UA NodeClass
nodeId - The ID of the new node.
browseName - The BrowseName of the new node.
displayName - The DisplayName of the new node.
typeDefinition - Optional type definition to use for the class selection.
Returns:
a new UaNode of a concrete class type (UaNode is abstract itself).
Throws:
UaNodeFactoryException - if the class cannot be created.

createNode

UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass,
                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                  String name,
                  Locale locale)
                  throws UaNodeFactoryException
Create a new Node object based on the nodeClass (or typeDefinition).

The method creates a new UaNode object. The class of the Node is selected depending on the nodeClass - or if typeDefinition is provided, also on that.

You can register new Node classes per nodeClass or typeDefinition using registerNodeClass(org.opcfoundation.ua.core.NodeClass, java.lang.Class).

Parameters:
nodeClass - The UA NodeClass
nodeId - The ID of the new node.
name - The name of the new node. The BrowseName and DisplayName are initialized to this.
locale - The locale to use for the DisplayName.
Returns:
a new UaNode of a concrete class type (UaNode is abstract itself).
Throws:
UaNodeFactoryException - if the class cannot be created.

createNode

UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass,
                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                  String name,
                  Locale locale,
                  org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId)
                  throws UaNodeFactoryException
Create a new Node object based on the nodeClass (or typeDefinition).

The method creates a new UaNode object. The class of the Node is selected depending on the nodeClass - or if typeDefinition is provided, also on that.

You can register new Node classes per nodeClass or typeDefinition using registerNodeClass(org.opcfoundation.ua.core.NodeClass, java.lang.Class).

Parameters:
nodeClass - The UA NodeClass
nodeId - The ID of the new node.
name - The name of the new node. The BrowseName and DisplayName are initialized to this.
locale - The locale to use for the DisplayName.
typeDefinitionId - The type definition of the node to create. If there is a specific class registered with the type, a node object of that type is created.
Returns:
a new UaNode of a concrete class type (UaNode is abstract itself).
Throws:
UaNodeFactoryException - if the class cannot be created.

createNode

UaNode createNode(org.opcfoundation.ua.core.NodeClass nodeClass,
                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                  String name,
                  Locale locale,
                  org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
                  throws UaNodeFactoryException
Parameters:
nodeClass -
nodeId -
name -
locale -
typeDefinitionId -
Returns:
Throws:
UaNodeFactoryException

getClassType

Class<? extends UaNode> getClassType(org.opcfoundation.ua.core.NodeClass nodeClass,
                                     org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
Return the object class corresponding to the NodeClass or Type. Type has precedence, if there is a class registered for it.

You can create objects of this type with newInstance.

Use registerNodeClass to register custom classes.

Parameters:
nodeClass - UA NodeClass
typeDefinition - UA Type
Returns:
UaNode class matching the nodeClass or typeDefinition

getClassType

Class<? extends UaNode> getClassType(org.opcfoundation.ua.core.NodeClass nodeClass,
                                     org.opcfoundation.ua.builtintypes.NodeId typeDefinition)
Return the object class corresponding to the NodeClass or Type. Type has precedence, if there is a class registered for it.

You can create objects of this type with newInstance.

Use registerNodeClass to register custom classes.

Parameters:
nodeClass - UA NodeClass
typeDefinition - UA Type
Returns:
UaNode class matching the nodeClass or typeDefinition

registerNodeClass

void registerNodeClass(org.opcfoundation.ua.core.NodeClass nodeClass,
                       Class<? extends UaNode> clazz)
                       throws UaNodeFactoryException
Register an actual UaNode class to use when using createNode(org.opcfoundation.ua.core.NodeClass, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText) to create new nodes for a OPC UA NodeClass.

These are registered by default

 registerNodeClass(NodeClass.Object, UaObject.class);
 registerNodeClass(NodeClass.Variable, UaVariable.class);
 registerNodeClass(NodeClass.Method, UaMethod.class);
 registerNodeClass(NodeClass.ObjectType, UaObjectType.class);
 registerNodeClass(NodeClass.VariableType, UaVariableType.class);
 registerNodeClass(NodeClass.ReferenceType, UaReferenceType.class);
 registerNodeClass(NodeClass.DataType, UaDataType.class);
 registerNodeClass(NodeClass.View, UaView.class);
 registerNodeClass(Identifiers.PropertyType, UaProperty.class);
 registerNodeClass(Identifiers.FolderType, UaFolder.class);
 

Parameters:
nodeClass - the UA NodeClass
clazz - the UaNode class to use for the nodeClass. The class must define a public constructor with the parameters (NodeId, QualifiedName, LocalizedText).
Throws:
UaNodeFactoryException - if the clazz does not contain the valid public constructor

registerTypeDefinition

void registerTypeDefinition(org.opcfoundation.ua.builtintypes.NodeId typeDefinition,
                            Class<? extends UaNode> clazz)
                            throws UaNodeFactoryException
Register an actual UaNode class to use when using createNode(org.opcfoundation.ua.core.NodeClass, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText) to create new nodes for a OPC UA typeDefinition.

Parameters:
typeDefinition - the UA type definition, e.g. Identifiers.FolderType
clazz - the UaNode class to use for the nodeClass. The class must define a public constructor with the parameters (NodeId, QualifiedName, LocalizedText).
Throws:
UaNodeFactoryException - if the clazz does not contain the valid public constructor


Copyright © 2018. All rights reserved.