com.prosysopc.ua.server
Class NodeManagerUaNode

java.lang.Object
  extended by com.prosysopc.ua.server.ServiceManagerBase
      extended by com.prosysopc.ua.server.NodeManager
          extended by com.prosysopc.ua.server.NodeManagerUaNode
Direct Known Subclasses:
NodeManagerRoot, UaServer.NodeManagerUaServer

public class NodeManagerUaNode
extends NodeManager

Main implementation of the NodeManager. NodeManagerUaNode manages a part of the OPC UA Server's address space, consisting of UaNode instances.

Use addNode(UaNode) or addNodeAndReference(UaNode, UaNode, NodeId) to add your node objects into the NodeManager. You can add references to the nodes using addReference(org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.ExpandedNodeId, org.opcfoundation.ua.builtintypes.NodeId, boolean).


Field Summary
 
Fields inherited from class com.prosysopc.ua.server.NodeManager
initialized, started
 
Constructor Summary
NodeManagerUaNode(UaServer server, String namespaceUri)
          The default constructor
 
Method Summary
 void addComponent(UaNode parent, UaInstance component)
          Add a node as a component of another node into the address space.
protected  org.opcfoundation.ua.builtintypes.NodeId addNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.NodeId parentNodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId, org.opcfoundation.ua.core.NodeAttributes attributes, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
          Handle adding a new node.
 UaNode addNode(UaNode newNode)
          Adds a new node - unless it already exists in the node manager.
 UaNode addNodeAndReference(UaNode parent, UaNode newNode, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
           
 void addReference(org.opcfoundation.ua.builtintypes.NodeId sourceId, org.opcfoundation.ua.builtintypes.ExpandedNodeId targetId, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isInverse)
          Adds a Reference.
 void addReference(org.opcfoundation.ua.builtintypes.NodeId sourceId, org.opcfoundation.ua.builtintypes.NodeId targetId, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isInverse)
          Adds a reference to the Node Manager, if both the source and target are found.
protected  void addReference(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId sourceNodeId, org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isForward, org.opcfoundation.ua.core.NodeClass targetNodeClass, String targetServerUri)
          Handle adding a reference.
 void addReference(UaNode sourceNode, UaNode targetNode, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, boolean isInverse)
          Add a new reference between the source and target node.
<T extends UaType>
T
addType(org.opcfoundation.ua.builtintypes.ExpandedNodeId newTypeDefinitionId, String name, T baseType)
           
<T extends UaType>
T
addType(org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, T baseType)
          Add a new Object type Node to the Node Manager.
protected  void close()
          Close the node manager, when the serve closes.
<T extends BaseEventType>
T
createEvent(Class<T> clazz)
          Creates a new event instance to be triggered.
<T extends BaseEventType>
T
createEvent(org.opcfoundation.ua.builtintypes.ExpandedNodeId eventTypeId)
          Creates a new event instance to be triggered.
<T extends BaseEventType>
T
createEvent(org.opcfoundation.ua.builtintypes.NodeId eventTypeId)
          Creates a new event instance to be triggered.
 FolderType createFolder(String name, org.opcfoundation.ua.builtintypes.NodeId newNodeId)
          Convenience method for creating a FolderType UaObject
<T extends UaInstance>
T
createInstance(Class<T> clazz, org.opcfoundation.ua.builtintypes.NodeId newNodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
          Creates new UA instance.
<T extends UaInstance>
T
createInstance(Class<T> clazz, String name)
          Creates new UA instance.
<T extends UaInstance>
T
createInstance(Class<T> clazz, String name, org.opcfoundation.ua.builtintypes.NodeId newNodeId)
          Creates new UA instance.
 UaInstance createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId, org.opcfoundation.ua.builtintypes.NodeId newNodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
          Creates new UA instance.
 UaInstance createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId, String name)
          Creates new UA instance.
 UaInstance createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId, String name, org.opcfoundation.ua.builtintypes.NodeId newNodeId)
          Creates new UA instance.
 UaInstance createInstance(org.opcfoundation.ua.builtintypes.NodeId typeId, org.opcfoundation.ua.builtintypes.NodeId newNodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
          Creates new UA instance.
 UaInstance createInstance(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId, String name)
          Creates new UA instance.
 UaInstance createInstance(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId, String name, org.opcfoundation.ua.builtintypes.NodeId newNodeId)
          Creates new UA instance.
protected  void createMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.utils.NumericRange indexRange, org.opcfoundation.ua.core.MonitoringParameters params, org.opcfoundation.ua.core.MonitoringFilter filter, org.opcfoundation.ua.core.AggregateFilterResult filterResult, org.opcfoundation.ua.core.MonitoringMode monitoringMode)
          Check that the monitored item request is valid.
<T extends UaInstance>
NodeBuilder<T>
createNodeBuilder(Class<T> clazz)
          Creates a NodeBuilder for given type.
<T extends UaInstance>
NodeBuilder<T>
createNodeBuilder(Class<T> clazz, UaNodeBuilderConfiguration configuration)
          Creates a NodeBuilder for given type.
<T extends UaInstance>
NodeBuilder<T>
createNodeBuilder(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId)
          Creates a NodeBuilder for given type.
<T extends UaInstance>
NodeBuilder<T>
createNodeBuilder(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId, UaNodeBuilderConfiguration configuration)
          Creates a NodeBuilder for given type.
<T extends UaInstance>
NodeBuilder<T>
createNodeBuilder(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
          Creates a NodeBuilder for given type.
<T extends UaInstance>
NodeBuilder<T>
createNodeBuilder(org.opcfoundation.ua.builtintypes.NodeId typeId, UaNodeBuilderConfiguration configuration)
          Creates a NodeBuilder for given type.
protected  UaNode createNodeForAddNodesRequest(org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
          Create node(s) for a single AddNodesRequest.
protected  UaNode createNodeForNodeSet2(org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
          Create a node for ModelParser loading NodeSet2.
 org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent, org.opcfoundation.ua.builtintypes.QualifiedName name)
          Convenience method for createNodeId(UaNode, QualifiedName, int) that uses this NodeManager's NamespaceIndex.
 org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent, org.opcfoundation.ua.builtintypes.QualifiedName name, int namespaceIndex)
          Creates a new string type NodeId as , where ParentNodeId is the NodeId of the parent converted to string.
 org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent, String name)
          Create a new string type NodeId as ".
 org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent, String name, int namespaceIndex)
          Create a new string type NodeId as "[ParentNodeId].
protected  NodeMap createNodeMap()
           
 UaNode deleteNode(org.opcfoundation.ua.builtintypes.NodeId nodeId, boolean deleteTargetReferences, boolean deleteChildren)
          Delete a node from the node manager.
protected  void deleteNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, Boolean deleteTargetReferences)
           
 UaNode deleteNode(UaNode node, boolean deleteTargetReferences, boolean deleteChildren)
          Delete a node from the node manager.
protected  UaNode deleteNode(UaNode node, boolean deleteTargetReferences, boolean deleteChildren, boolean doNotDeleteIfInverseHierarchicalRefs)
           
 void deleteReference(org.opcfoundation.ua.builtintypes.NodeId sourceNodeId, org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
          Delete a reference between the source and target node.
protected  void deleteReference(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId sourceNodeId, org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, Boolean isForward, Boolean deleteBidirectional)
           
 void deleteReference(UaNode sourceNode, org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
          Delete a reference between the source and target node.
 void deleteReference(UaNode sourceNode, UaNode targetNode, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
          Delete a reference between the source and target node.
 UaNode findNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
          Find the UaNode corresponding to the nodeId, if the Node Manager NodeManager.supportsUaNode().
protected  org.opcfoundation.ua.builtintypes.QualifiedName getBrowseName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, UaNode node)
          Get the BrowseName of a node.
protected  org.opcfoundation.ua.builtintypes.LocalizedText getDisplayName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, UaNode node, Locale locale)
          Find the DisplayName of a node.
 IoManagerUaNode getIoManager()
           
protected  UaNode getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, org.opcfoundation.ua.builtintypes.UnsignedInteger errorCode)
          Get the node or return a specific error.
protected  UaNode getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.UnsignedInteger errorCode)
          Get the node or return a specific error.
 UaNodeBuilderConfiguration getNodeBuilderConfiguration()
          Get the NodeBuilder configuration that this manager uses.
protected  org.opcfoundation.ua.core.NodeClass getNodeClass(org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node)
          Return the node class of a node, owned by this NodeManager.
 UaNodeFactory getNodeFactory()
           
 char getNodeIdDelimiter()
           
 String getNodeIdFormat()
          The current format for new nodeIds created for internal nodes of UA objects, such as the ConditionType objects.
 UaNode getNodeOrExternal(org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 NodeMap getNodes()
           
protected  UaReference[] getReferences(org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node)
          Get all references of a node.
 UaType getType(org.opcfoundation.ua.builtintypes.NodeId typeId)
          Find the type node with a specific Id
protected  org.opcfoundation.ua.builtintypes.ExpandedNodeId getTypeDefinition(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, UaNode node)
          Get the TypeDefinition of a node.
 org.opcfoundation.ua.builtintypes.NodeId getVariableDataType(org.opcfoundation.ua.builtintypes.NodeId nodeId, UaValueNode variable)
          Get the data type of a variable node, managed by this node manager.
 boolean hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
          Check if the node manager has a certain node.
protected  void replaceExternalNode(UaExternalNode oldNode, UaNode newNode)
           
protected  boolean requireUaNode()
           
 void setNodeBuilderConfiguration(UaNodeBuilderConfiguration nodeBuilderConfiguration)
          Override the NodeBuilder configuration for this manager.
 void setNodeFactory(UaNodeFactory nodeFactory)
          Define the NodeFactory to use for creating new nodes.
 void setNodeIdDelimiter(char nodeIdDelimiter)
           
 boolean supportsUaNode()
          Whether the NodeManager supports UaNode instances.
 
Methods inherited from class com.prosysopc.ua.server.NodeManager
addListener, afterCreateMonitoredDataItem, afterCreateMonitoredEventItem, afterDeleteMonitoredItem, afterModifyMonitoredDataItem, afterModifyMonitoredEventItem, browseNode, callMethod, createMonitoredEventItem, createReferenceDescription, deleteMonitoredItem, findNode, findNodeClass, fireAddNode, fireAddReference, fireAfterAddNode, fireAfterAddReference, fireAfterCreateMonitoredDataItem, fireAfterDeleteMonitoredItem, fireAfterModifyMonitoredDataItem, fireBrowseNode, fireCreateMonitoredDataItem, fireDeleteMonitoredItem, fireDeleteNode, fireDeleteReference, fireModifyMonitoredDataItem, getDefaultLocale, getEventManager, getEventManager, getHistoryManager, getIsOfType, getMethodManager, getNamespaceIndex, getNamespaceTable, getNamespaceUri, getNode, getNodeClass, getNodeId, getQualifiedName, getReferences, getReferenceType, hasListener, init, isInitialized, isOfType, isStarted, modifyMonitoredDataItem, modifyMonitoredEventItem, queryFirst, queryNext, referenceMatchesRequest, registerNode, removeListener, setDefaultLocale, setEventManager, setHistoryManager, setIoManager, setMethodManager, start, toString, translateBrowsePath, unregisterNode
 
Methods inherited from class com.prosysopc.ua.server.ServiceManagerBase
arrayDimensionsMatch, checkIsMethod, checkIsValueNode, checkIsVariable, checkIsVariableOrVariableType, dataTypeEquals, getNode, getNode, getNode, getNodeManagerTable, getServer, getSubscriptionManager, isValueNode, isVariable, listenerError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeManagerUaNode

public NodeManagerUaNode(UaServer server,
                         String namespaceUri)
The default constructor

Parameters:
server -
namespaceUri -
Method Detail

addComponent

public void addComponent(UaNode parent,
                         UaInstance component)
                  throws StatusException
Add a node as a component of another node into the address space.

This is actually a shortcut to running addNodeAndReference(parent, variable, Identifiers.HasComponent);

Parameters:
parent -
component -
Throws:
StatusException

addNode

public UaNode addNode(UaNode newNode)
               throws StatusException
Adds a new node - unless it already exists in the node manager.

Overrides:
addNode in class NodeManager
Parameters:
newNode - the node to add. The NodeId of the node must have the same namepsaceIndex as the node manager.
Returns:
newNode, if it was added or the node with the same NodeId if such was already in the address space.
Throws:
StatusException - if the NodeId exists or is invalid (i.e. null)
NullPointerException - if the newNode parameter is null

addNodeAndReference

public UaNode addNodeAndReference(UaNode parent,
                                  UaNode newNode,
                                  org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
                           throws StatusException
Parameters:
parent -
newNode -
referenceTypeId -
Returns:
newNode
Throws:
StatusException

addReference

public void addReference(org.opcfoundation.ua.builtintypes.NodeId sourceId,
                         org.opcfoundation.ua.builtintypes.ExpandedNodeId targetId,
                         org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                         boolean isInverse)
                  throws StatusException
Adds a Reference. Source must obtainable as UaNode, target may point to another server.

Parameters:
sourceId - id for the source
targetId - id for the target, may contain ServerIndex
referenceTypeId - id of the ReferenceType
isInverse - Is the reference inverse
Throws:
StatusException - if the source node cannot be found

addReference

public void addReference(org.opcfoundation.ua.builtintypes.NodeId sourceId,
                         org.opcfoundation.ua.builtintypes.NodeId targetId,
                         org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                         boolean isInverse)
                  throws StatusException
Adds a reference to the Node Manager, if both the source and target are found.

Parameters:
sourceId - Id for source
targetId - Id for target
referenceTypeId - Id for reference type
isInverse - Is this an inverse reference
Throws:
StatusException - If the source node cannot be found.

addReference

public void addReference(UaNode sourceNode,
                         UaNode targetNode,
                         org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                         boolean isInverse)
Add a new reference between the source and target node. Note that you can also use uaNode.addReference to do the same.

Parameters:
sourceNode - the source node
targetNode - the target node
referenceTypeId - the reference type
isInverse - is this an inverse reference

addType

public <T extends UaType> T addType(org.opcfoundation.ua.builtintypes.ExpandedNodeId newTypeDefinitionId,
                                    String name,
                                    T baseType)
                         throws UaNodeFactoryException,
                                StatusException
Throws:
UaNodeFactoryException
StatusException

addType

public <T extends UaType> T addType(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                    String name,
                                    T baseType)
                         throws StatusException,
                                UaNodeFactoryException
Add a new Object type Node to the Node Manager. The node is attached using the HasSubtype reference to the baseType.

The method uses the NodeFactory to create a new node of type T (a subtype of UaType).

Parameters:
nodeId - The ID of the node. May not be a Null NodeId (or you get StatusException)
name - The Node Name, which is used to initialize the BrowseName and DisplayName (with defaultLocale)
baseType - The "parent" type in the address space. Must be defined.
Returns:
the new node
Throws:
StatusException - if the NodeId exists or is null.
UaNodeFactoryException - if the new node cannot be created. Check NodeFactory that it defines a proper type for the type nodes.

createEvent

public <T extends BaseEventType> T createEvent(Class<T> clazz)
Creates a new event instance to be triggered.

After you have created the event, you need to set the field values and call BaseEventTypeNode.triggerEvent(org.opcfoundation.ua.builtintypes.ByteString) for the object.

Parameters:
clazz - The event class
Returns:
The new event instance.

createEvent

public <T extends BaseEventType> T createEvent(org.opcfoundation.ua.builtintypes.ExpandedNodeId eventTypeId)
Creates a new event instance to be triggered.

After you have created the event, you need to set the field values and call BaseEventTypeNode.triggerEvent(org.opcfoundation.ua.builtintypes.ByteString) for the object.

Parameters:
eventTypeId - The event type to create
Returns:
The new event instance.

createEvent

public <T extends BaseEventType> T createEvent(org.opcfoundation.ua.builtintypes.NodeId eventTypeId)
Creates a new event instance to be triggered.

After you have created the event, you need to set the field values and call BaseEventTypeNode.triggerEvent(org.opcfoundation.ua.builtintypes.ByteString) for the object.

Parameters:
eventTypeId - The event type to create
Returns:
The new event instance.

createFolder

public FolderType createFolder(String name,
                               org.opcfoundation.ua.builtintypes.NodeId newNodeId)
Convenience method for creating a FolderType UaObject


createInstance

public <T extends UaInstance> T createInstance(Class<T> clazz,
                                               org.opcfoundation.ua.builtintypes.NodeId newNodeId,
                                               org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                               org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Creates new UA instance. The method uses the NodeBuilder to construct a complete object or variable with the structure as defined in the type adddress space.

The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.

If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(YourClass.class, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
clazz - The instance class to create. It must have the TypeDefinitionId annotation.
newNodeId - The requested NodeId of the new instance. This is also used as a basis for the sub-nodes of the instance.
browseName - The browse name for the instance.
displayName - The localizable display name for the instance.
Returns:
The new node
Throws:
UaInstantiationException - if the instance cannot be created.
See Also:
createNodeBuilder(java.lang.Class)

createInstance

public <T extends UaInstance> T createInstance(Class<T> clazz,
                                               String name)
Creates new UA instance. The method uses the NodeBuilder to construct a complete object or variable with the structure as defined in the type adddress space.

The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.

NodeId of the new instance will be generated from the name. You can use the other (overloaded) versions of the method to provide a specific NodeId instead.

If you wish to parameterize the node builder more, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(typeDefinitionId, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
clazz - The instance class to create. It must have the TypeDefinitionId annotation.
name - Name of the new instance: this is used to create the NodeId and as a basis for the BrowseName and DisplayName.
Returns:
The new node
Throws:
UaInstantiationException - if the instance cannot be created.
See Also:
createNodeBuilder(java.lang.Class)

createInstance

public <T extends UaInstance> T createInstance(Class<T> clazz,
                                               String name,
                                               org.opcfoundation.ua.builtintypes.NodeId newNodeId)
Creates new UA instance. The method uses the NodeBuilder to construct a complete object or variable with the structure as defined in the type adddress space.

The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.

If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(YourClass.class, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
clazz - The instance class to create. It must have the TypeDefinitionId annotation.
name - Name of the new instance: this is used as a basis for the BrowseName and DisplayName.
newNodeId - The NodeId of the new instance.
Returns:
The new node
Throws:
UaInstantiationException - if the instance cannot be created.
See Also:
createNodeBuilder(java.lang.Class)

createInstance

public UaInstance createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
                                 org.opcfoundation.ua.builtintypes.NodeId newNodeId,
                                 org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                 org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Creates new UA instance. The method uses the NodeBuilder to construct a complete object or variable with the structure as defined in the type adddress space.

The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.

If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(YourClass.class, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
clazz - The instance class to create. It must have the TypeDefinitionId annotation.
name - Name of the new instance: this is used to create the NodeId and as a basis for the BrowseName and DisplayName.
Returns:
The new node
Throws:
UaInstantiationException - if the instance cannot be created.
See Also:
createNodeBuilder(java.lang.Class)

createInstance

public UaInstance createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
                                 String name)
Creates new UA instance. The method uses the NodeBuilder to construct a complete object or variable with the structure as defined in the type adddress space.

The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.

NodeId of the new instance will be generated from the name. You can use the other (overloaded) versions of the method to provide a specific NodeId instead.

If you wish to parameterize the node builder more, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(typeDefinitionId, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
clazz - The instance class to create. It must have the TypeDefinitionId annotation.
name - Name of the new instance: this is used to create the NodeId and as a basis for the BrowseName and DisplayName.
Returns:
The new node
Throws:
UaInstantiationException - if the instance cannot be created.
See Also:
createNodeBuilder(java.lang.Class)

createInstance

public UaInstance createInstance(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
                                 String name,
                                 org.opcfoundation.ua.builtintypes.NodeId newNodeId)
Creates new UA instance. The method uses the NodeBuilder to construct a complete object or variable with the structure as defined in the type adddress space.

The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.

If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(YourClass.class, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
clazz - The instance class to create. It must have the TypeDefinitionId annotation.
name - Name of the new instance: this is used as a basis for the BrowseName and DisplayName.
newNodeId - The NodeId of the new instance.
Returns:
The new node
Throws:
UaInstantiationException - if the instance cannot be created.
See Also:
createNodeBuilder(java.lang.Class)

createInstance

public UaInstance createInstance(org.opcfoundation.ua.builtintypes.NodeId typeId,
                                 org.opcfoundation.ua.builtintypes.NodeId newNodeId,
                                 org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                 org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Creates new UA instance. The method uses the NodeBuilder to construct a complete object or variable with the structure as defined in the type adddress space.

The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.

If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(YourClass.class, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
clazz - The instance class to create. It must have the TypeDefinitionId annotation.
newNodeId - The requested NodeId of the new instance. This is also used as a basis for the sub-nodes of the instance.
browseName - The browse name for the instance.
displayName - The localizable display name for the instance.
Returns:
The new node
Throws:
UaInstantiationException - if the instance cannot be created.
See Also:
createNodeBuilder(java.lang.Class)

createInstance

public UaInstance createInstance(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
                                 String name)
Creates new UA instance. The method uses the NodeBuilder to construct a complete object or variable with the structure as defined in the type adddress space.

The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.

NodeId of the new instance will be generated from the name. You can use the other (overloaded) versions of the method to provide a specific NodeId instead.

If you wish to parameterize the node builder more, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(typeDefinitionId, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
typeDefinitionId - The UA type of the instance to create. Will use this to determine the respective instance class to create.
name - Name of the new instance: this is used to create the NodeId and as a basis for the BrowseName and DisplayName.
Returns:
The new node
Throws:
UaInstantiationException - if the instance cannot be created.
See Also:
createNodeBuilder(java.lang.Class)

createInstance

public UaInstance createInstance(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
                                 String name,
                                 org.opcfoundation.ua.builtintypes.NodeId newNodeId)
Creates new UA instance. The method uses the NodeBuilder to construct a complete object or variable with the structure as defined in the type adddress space.

The type of the instance is determined from the TypeDefinitionId annotation of the class, which must be defined.

If you wish to parameterize the node builder, for example to define which optional elements should be created, you should use the NodeBuilder, e.g.:

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(typeDefinitionId, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
typeDefinitionId - The UA type of the instance to create. Will use this to determine the respective instance class to create.
name - Name of the new instance: this is used as a basis for the BrowseName and DisplayName.
newNodeId - The NodeId of the new instance.
Returns:
The new node
Throws:
UaInstantiationException - if the instance cannot be created.
See Also:
createNodeBuilder(java.lang.Class)

createNodeBuilder

public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(Class<T> clazz)
Creates a NodeBuilder for given type. The default namespace index of the builder is set to the namespace index of this NodeManager.

Parameters:
clazz - The class of the instance to build. It must have the TypeDefinitionId annotation.
Returns:
The created NodeBuilder.
Throws:
UaInstantiationException - if the type node does not exist or it is invalid for instantiation.
See Also:
createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)

createNodeBuilder

public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(Class<T> clazz,
                                                               UaNodeBuilderConfiguration configuration)
Creates a NodeBuilder for given type. The default namespace index of the builder is set to the namespace index of this NodeManager.

Used to customize the node to be built more than what is possible with createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(YourClass.class, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
clazz - The class of the instance to build. It must have the TypeDefinitionId annotation.
configuration - The configuration to use for the builder.
Returns:
The created NodeBuilder.
Throws:
UaInstantiationException - if the type node does not exist or it is invalid for instantiation.
See Also:
createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)

createNodeBuilder

public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId)
Creates a NodeBuilder for given type. The default namespace index of the builder is set to the namespace index of this NodeManager.

Parameters:
typeDefinitionId - The ExpandedNodeId of the instantiated type.
Returns:
The created NodeBuilder.
Throws:
UaInstantiationException - if the type node does not exist or it is invalid for instantiation.
See Also:
createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)

createNodeBuilder

public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeId,
                                                               UaNodeBuilderConfiguration configuration)
Creates a NodeBuilder for given type. The default namespace index of the builder is set to the namespace index of this NodeManager.

Used to customize the node to be built more than what is possible with createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(typeDefinitionId, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
typeDefinitionId - The ExpandedNodeId of the instantiated type.
configuration - The configuration to use for the builder.
Returns:
The created NodeBuilder.
Throws:
UaInstantiationException - if the type node does not exist or it is invalid for instantiation.
See Also:
createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)

createNodeBuilder

public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
Creates a NodeBuilder for given type. The default namespace index of the builder is set to the namespace index of this NodeManager.

Parameters:
typeDefinitionId - The NodeId of the instantiated type.
Returns:
The created NodeBuilder.
Throws:
UaInstantiationException - if the type node does not exist or it is invalid for instantiation.
See Also:
createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)

createNodeBuilder

public <T extends UaInstance> NodeBuilder<T> createNodeBuilder(org.opcfoundation.ua.builtintypes.NodeId typeId,
                                                               UaNodeBuilderConfiguration configuration)
Creates a NodeBuilder for given type. The default namespace index of the builder is set to the namespace index of this NodeManager.

Used to customize the node to be built more than what is possible with createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)

 UaNodeBuilderConfiguration conf = new NodeBuilderConfiguration();
 conf.addOptional(...);
 NodeBuilder nb = createNodeBuilder(typeDefinitionId, conf);
 nb.setBrowseName(browseName);
 nb.setDisplayName(displayName);
 nb.setNodeId(newNodeId);
 YourClass instance = nb.build();
 

Parameters:
typeDefinitionId - The NodeId of the instantiated type.
configuration - The configuration to use for the builder.
Returns:
The created NodeBuilder.
Throws:
UaInstantiationException - if the type node does not exist or it is invalid for instantiation.
See Also:
createInstance(java.lang.Class, org.opcfoundation.ua.builtintypes.NodeId, org.opcfoundation.ua.builtintypes.QualifiedName, org.opcfoundation.ua.builtintypes.LocalizedText)

createNodeId

public org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent,
                                                             org.opcfoundation.ua.builtintypes.QualifiedName name)
Convenience method for createNodeId(UaNode, QualifiedName, int) that uses this NodeManager's NamespaceIndex.

See Also:
createNodeId(UaNode, QualifiedName, int)

createNodeId

public org.opcfoundation.ua.builtintypes.NodeId createNodeId(UaNode parent,
                                                             org.opcfoundation.ua.builtintypes.QualifiedName name,
                                                             int namespaceIndex)
Creates a new string type NodeId as , where ParentNodeId is the NodeId of the parent converted to string.

Parameters:
parent - the parent node, must not be null
name - the name of the sub-node
namespaceIndex - the namespacIndex to use for the NodeId
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 this NodeManager's.

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

createNodeId

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

If the parent's NodeId is NULL, a new random UUID is used for the NodeId.

The delimiter char used between "[ParentNodeId]" and "[Name]" is defined, by the property NodeIdDelimiter.

Parameters:
parent - the parent node - must not be null
name - the [Name] to append to the ID of the parent
namespaceIndex - the namespacIndex to use for the NodeId. If you omit it, the namespaceIndex of the NodeManager is used.
Returns:
the new NodeId

deleteNode

public UaNode deleteNode(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                         boolean deleteTargetReferences,
                         boolean deleteChildren)
                  throws StatusException
Delete a node from the node manager.

Parameters:
nodeId - the node to delete
deleteTargetReferences - whether to also delete references in which this node is the target
deleteChildren - whether to also remove all child nodes, i.e.those that are connected to this node using a forward HasChild reference.
Returns:
the node that was removed.
Throws:
StatusException - if the deletion fails. Possible status codes: Bad_NodeIdInvalid, Bad_NodeIdUnknown, Bad_UserAccessDenied, Bad_NoDeleteRights, Uncertain_ReferenceNotDeleted

deleteNode

public UaNode deleteNode(UaNode node,
                         boolean deleteTargetReferences,
                         boolean deleteChildren)
                  throws StatusException
Delete a node from the node manager.

Parameters:
node - the node to delete, if null, null is returned
deleteTargetReferences - whether to also delete references in which this node is the target. If this cannot be done, a StatusException(Uncertain_ReferenceNotDeleted) is thrown.
deleteChildren - whether to also remove all child nodes, i.e. those that are connected to this node using a forward HasChild reference. The removal of children works for nodes that are in the same NodeManager or on some other NodeManagerUaNode.
Returns:
the node, if it was removed or null, if the node was not in the node manager.
Throws:
StatusException - if the deletion fails. Possible status codes: Bad_NodeIdInvalid, Bad_NodeIdUnknown, Bad_UserAccessDenied, Bad_NoDeleteRights, Uncertain_ReferenceNotDeleted

deleteReference

public void deleteReference(org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
                            org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
                            org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
                     throws StatusException
Delete a reference between the source and target node.

Parameters:
sourceNodeId - the source node of the reference
targetNodeId - the target of the reference
referenceTypeId - reference type
Throws:
StatusException - if targetNodeId refers to a local node, which does not exist

deleteReference

public void deleteReference(UaNode sourceNode,
                            org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
                            org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
                     throws StatusException
Delete a reference between the source and target node.

Parameters:
sourceNode - the source node of the reference
targetNodeId - the target of the reference
referenceTypeId - reference type
Throws:
StatusException - if targetNodeId refers to a local node, which does not exist

deleteReference

public void deleteReference(UaNode sourceNode,
                            UaNode targetNode,
                            org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
                     throws StatusException
Delete a reference between the source and target node.

Parameters:
sourceNode - the source node of the reference
targetNode - the target of the reference
referenceTypeId - reference type
Throws:
StatusException - if targetNodeId refers to a local node, which does not exist

findNode

public UaNode findNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Description copied from class: NodeManager
Find the UaNode corresponding to the nodeId, if the Node Manager NodeManager.supportsUaNode(). You should use NodeManager.hasNode(org.opcfoundation.ua.builtintypes.NodeId) to check if the Node Manager has a node

Overrides:
findNode in class NodeManager
Parameters:
nodeId - the nodeId to look for
Returns:
The respective UaNode or null, if the Node Manager does not have the node or does not support UaNodes
See Also:
ServiceManagerBase.getNode(NodeId)

getIoManager

public IoManagerUaNode getIoManager()
Overrides:
getIoManager in class NodeManager
Returns:
the IO Manager that is handling attribute services, i.e. read and write calls, for the nodes.

getNodeBuilderConfiguration

public UaNodeBuilderConfiguration getNodeBuilderConfiguration()
Get the NodeBuilder configuration that this manager uses. NOTE! by default the NodeManagerUaNode uses the configuration from NodeManagerTable.getNodeBuilderConfiguration(), therefore unless this has been overridden by calling setNodeBuilderConfiguration(UaNodeBuilderConfiguration), this method will return the configuration defined in NodeManagerTable.

Returns:
the nodeBuilderConfiguration that this manager uses

getNodeFactory

public UaNodeFactory getNodeFactory()
Returns:
the nodeFactory used to create new nodes.

getNodeIdDelimiter

public char getNodeIdDelimiter()
Returns:
the nodeIdDelimiter

getNodeIdFormat

public String getNodeIdFormat()
The current format for new nodeIds created for internal nodes of UA objects, such as the ConditionType objects. The format is defined by concatenating "%s"+nodeIdDelimiter+"%s";

Returns:
the nodeIdFormat

getNodeOrExternal

public UaNode getNodeOrExternal(org.opcfoundation.ua.builtintypes.NodeId nodeId)

getNodes

public NodeMap getNodes()
Returns:
the nodes

getType

public UaType getType(org.opcfoundation.ua.builtintypes.NodeId typeId)
               throws StatusException
Find the type node with a specific Id

Parameters:
typeId - the NodeId of the type
Returns:
the type node
Throws:
StatusException - if the node is not found

getVariableDataType

public org.opcfoundation.ua.builtintypes.NodeId getVariableDataType(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                                                    UaValueNode variable)
                                                             throws StatusException
Description copied from class: NodeManager
Get the data type of a variable node, managed by this node manager.

Specified by:
getVariableDataType in class NodeManager
Parameters:
nodeId - The NodeId of the variable, whose data type is requested.
variable - the variable or variableType node, if such exists
Returns:
the data type
Throws:
StatusException

hasNode

public boolean hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Description copied from class: NodeManager
Check if the node manager has a certain node.

Override in your own NodeManager to return true for your own nodes.

Specified by:
hasNode in class NodeManager
Returns:

setNodeBuilderConfiguration

public void setNodeBuilderConfiguration(UaNodeBuilderConfiguration nodeBuilderConfiguration)
Override the NodeBuilder configuration for this manager. NOTE! in most cases, it is easier to override the configuration by calling NodeManagerTable.setNodeBuilderConfiguration(UaNodeBuilderConfiguration), so it affects all managers. Use this only when you need different configuration per manager. NOTE! calling with null parameter resets this manager to default to the configuration defined in NodeManagerTable.

Parameters:
nodeBuilderConfiguration - the nodeBuilderConfiguration to set

setNodeFactory

public void setNodeFactory(UaNodeFactory nodeFactory)
Define the NodeFactory to use for creating new nodes.

By default the NodeFactory is the same as DefaultNodeFactory. If you wish to use a custom NodeFactory only for this node manager, you can create your own and use this method to change it.

If you wish to modify the default NodeFactory used by all node managers, it is better to just modify the DefaultNodeFactory.

Parameters:
nodeFactory - the nodeFactory to set

setNodeIdDelimiter

public void setNodeIdDelimiter(char nodeIdDelimiter)
Parameters:
nodeIdDelimiter - the nodeIdDelimiter to set

supportsUaNode

public boolean supportsUaNode()
Description copied from class: NodeManager
Whether the NodeManager supports UaNode instances. The flag is used internally, to check if the services should be called with NodeId only or if UaNode should also be available.

Change in your own node manager, if you want to use UaNode. In that case, also consider inheriting your NodeManager from NodeManagerUaNode instead.

Note: If you define supportsUaNode = true, you must also implement NodeManager.findNode(ExpandedNodeId)!

Overrides:
supportsUaNode in class NodeManager
Returns:
true if UaNode objects are supported.

addNode

protected org.opcfoundation.ua.builtintypes.NodeId addNode(ServiceContext serviceContext,
                                                           org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                                           org.opcfoundation.ua.builtintypes.NodeId parentNodeId,
                                                           org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                                           org.opcfoundation.ua.core.NodeClass nodeClass,
                                                           org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
                                                           org.opcfoundation.ua.core.NodeAttributes attributes,
                                                           org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
                                                    throws StatusException
Description copied from class: NodeManager
Handle adding a new node. NOTE! you should call fireBeforeAddNode before adding the node to check permissions from added listeners and fireAfterAddNode after the node is added. Default implementation throws Bad_NotImplemented.

Overrides:
addNode in class NodeManager
Throws:
StatusException

addReference

protected void addReference(ServiceContext serviceContext,
                            org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
                            org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
                            org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                            boolean isForward,
                            org.opcfoundation.ua.core.NodeClass targetNodeClass,
                            String targetServerUri)
                     throws StatusException
Description copied from class: NodeManager
Handle adding a reference. NOTE! you should call fireBeforeAddReference before adding the reference to check permissions from added listeners and fireAfterAddReference after the reference is added. Default implementation throws Bad_NotImplemented.

Overrides:
addReference in class NodeManager
Throws:
StatusException

close

protected void close()
Description copied from class: NodeManager
Close the node manager, when the serve closes.

Overrides:
close in class NodeManager

createMonitoredDataItem

protected void createMonitoredDataItem(ServiceContext serviceContext,
                                       Subscription subscription,
                                       org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                       org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                       org.opcfoundation.ua.utils.NumericRange indexRange,
                                       org.opcfoundation.ua.core.MonitoringParameters params,
                                       org.opcfoundation.ua.core.MonitoringFilter filter,
                                       org.opcfoundation.ua.core.AggregateFilterResult filterResult,
                                       org.opcfoundation.ua.core.MonitoringMode monitoringMode)
                                throws StatusException
Description copied from class: NodeManager
Check that the monitored item request is valid.

Overrides:
createMonitoredDataItem in class NodeManager
Parameters:
serviceContext - the client calling context
subscription - the subscription in which the item is being created.
nodeId - the node ID: get the respective node from from the nodeManager.
attributeId - the attribute ID: check from the node that it supports the attribute.
indexRange - the index range specification
params - the monitoring parameters
filter - an optional filter for the item. This may be a DataChangeFilter or AggregateFilterResult
filterResult - results for the aggregateFilter, if such is provided
monitoringMode - the requested MonitoringMode
Throws:
StatusException - if the node is invalid (Bad_NodeIdUnknown) or the attributeId is not supported by the node (Bad_AttributeIdInvalid).

createNodeForAddNodesRequest

protected UaNode createNodeForAddNodesRequest(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                              org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                              org.opcfoundation.ua.core.NodeClass nodeClass,
                                              org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
                                              org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Create node(s) for a single AddNodesRequest. This implementation uses NodeBuilder if the given NodeClass is Variable or Object, otherwise it uses NodeFactory of the manager.


createNodeForNodeSet2

protected UaNode createNodeForNodeSet2(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                       org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                       org.opcfoundation.ua.core.NodeClass nodeClass,
                                       org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
                                       org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Create a node for ModelParser loading NodeSet2. This implementation uses NodeFactory of the manager.


createNodeMap

protected NodeMap createNodeMap()

deleteNode

protected void deleteNode(ServiceContext serviceContext,
                          org.opcfoundation.ua.builtintypes.NodeId nodeId,
                          Boolean deleteTargetReferences)
                   throws StatusException
Overrides:
deleteNode in class NodeManager
Throws:
StatusException

deleteNode

protected UaNode deleteNode(UaNode node,
                            boolean deleteTargetReferences,
                            boolean deleteChildren,
                            boolean doNotDeleteIfInverseHierarchicalRefs)
                     throws StatusException
Throws:
StatusException

deleteReference

protected void deleteReference(ServiceContext serviceContext,
                               org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
                               org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
                               org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                               Boolean isForward,
                               Boolean deleteBidirectional)
                        throws StatusException
Overrides:
deleteReference in class NodeManager
Throws:
StatusException

getBrowseName

protected org.opcfoundation.ua.builtintypes.QualifiedName getBrowseName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                                                                        UaNode node)
Description copied from class: NodeManager
Get the BrowseName of a node.

NodeManagerUaNode implements the method by getting the BrowseName from the targetNode.

For custom NodeManagers this must be implemented.

Specified by:
getBrowseName in class NodeManager
Parameters:
nodeId - the ID of the node
node - the node, if it is a UaNode. May be null.
Returns:
the BrowseName of node

getDisplayName

protected org.opcfoundation.ua.builtintypes.LocalizedText getDisplayName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                                                                         UaNode node,
                                                                         Locale locale)
Description copied from class: NodeManager
Find the DisplayName of a node.

NodeManagerUaNode implements the method by getting the DisplayName from the targetNode

For custom NodeManagers this must be implemented.

Specified by:
getDisplayName in class NodeManager
Parameters:
nodeId - the ID of the node
locale - The locale in which the name is requested. May be null.
Returns:
the DisplayName of node

getNode

protected UaNode getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                         org.opcfoundation.ua.builtintypes.UnsignedInteger errorCode)
                  throws StatusException
Get the node or return a specific error.

Parameters:
nodeId - the ID of the node
errorCode - The error code to return, instead of Bad_NodeIdUnknown, if the node is not found
Returns:
the node with the specified ID
Throws:
StatusException - if the node is not found or the ID is invalid

getNode

protected UaNode getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                         org.opcfoundation.ua.builtintypes.UnsignedInteger errorCode)
                  throws StatusException
Get the node or return a specific error.

Parameters:
nodeId - the ID of the node
errorCode - The error code to return, instead of Bad_NodeIdUnknown, if the node is not found
Returns:
the node with the specified ID
Throws:
StatusException - if the node is not found or the ID is invalid

getNodeClass

protected org.opcfoundation.ua.core.NodeClass getNodeClass(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                                           UaNode node)
Description copied from class: NodeManager
Return the node class of a node, owned by this NodeManager. Use NodeManager.findNodeClass(ExpandedNodeId, UaNode) to search for the NodeClass of any node, possibly owned by some other NodeManager.

Specified by:
getNodeClass in class NodeManager
Parameters:
nodeId -
node -
Returns:

getReferences

protected UaReference[] getReferences(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                      UaNode node)
Description copied from class: NodeManager
Get all references of a node.

Specified by:
getReferences in class NodeManager
Parameters:
nodeId - the ID of the node
node - the node object, if available
Returns:
all references for the node

getTypeDefinition

protected org.opcfoundation.ua.builtintypes.ExpandedNodeId getTypeDefinition(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                                                                             UaNode node)
Description copied from class: NodeManager
Get the TypeDefinition of a node.

NodeManagerUaNode implements the method by getting the TypeDefinitionId from the node.

For custom NodeManagers this must be implemented.

Specified by:
getTypeDefinition in class NodeManager
Parameters:
nodeId - the ID of the node
node - the node, if it is a UaNode. May be null.
Returns:
the BrowseName of node

replaceExternalNode

protected void replaceExternalNode(UaExternalNode oldNode,
                                   UaNode newNode)
                            throws StatusException
Parameters:
oldNode -
newNode -
Throws:
StatusException

requireUaNode

protected boolean requireUaNode()
Overrides:
requireUaNode in class ServiceManagerBase


Copyright © 2018. All rights reserved.