com.prosysopc.ua.server
Class NodeManager

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

public abstract class NodeManager
extends ServiceManagerBase


Field Summary
protected  boolean initialized
           
protected  boolean started
           
 
Constructor Summary
NodeManager(UaServer server, String namespaceUri)
          The default constructor.
 
Method Summary
 void addListener(NodeManagerListener listener)
          Add a listener to get notifications of client actions on this Node Manager.
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 node)
          Adds a new node - unless it already exists in the node manager.
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.
protected  void afterCreateMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item)
           
protected  void afterCreateMonitoredEventItem(ServiceContext serviceContext, Subscription subscription, MonitoredEventItem item)
           
protected  void afterDeleteMonitoredItem(ServiceContext serviceContext, Subscription subscription, MonitoredItem item)
           
protected  void afterModifyMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item)
           
protected  void afterModifyMonitoredEventItem(ServiceContext serviceContext, Subscription subscription, MonitoredEventItem item)
           
protected  BrowseContinuationPoint browseNode(ServiceContext serviceContext, List<org.opcfoundation.ua.core.ReferenceDescription> referenceDescriptions, org.opcfoundation.ua.builtintypes.NodeId nodeId, int maxReferences, org.opcfoundation.ua.core.BrowseDirection browseDirection, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, Boolean includeSubTypes, org.opcfoundation.ua.builtintypes.QualifiedName browseName, EnumSet<org.opcfoundation.ua.core.NodeClass> nodeClassSet, EnumSet<org.opcfoundation.ua.core.BrowseResultMask> resultSet, org.opcfoundation.ua.core.ViewDescription viewDescription, int startIndex)
          Browse a single node and filter according to the parameters.
protected  org.opcfoundation.ua.builtintypes.Variant[] callMethod(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId objectId, org.opcfoundation.ua.builtintypes.NodeId methodId, org.opcfoundation.ua.builtintypes.Variant[] inputArguments, org.opcfoundation.ua.builtintypes.StatusCode[] inputArgumentResults, org.opcfoundation.ua.builtintypes.DiagnosticInfo[] inputArgumentDiagnosticInfos)
           
protected  void close()
          Close the node manager, when the serve closes.
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.
protected  void createMonitoredEventItem(ServiceContext serviceContext, Subscription subscription, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.core.EventFilter eventFilter, org.opcfoundation.ua.core.EventFilterResult eventFilterResult)
           
protected  org.opcfoundation.ua.core.ReferenceDescription createReferenceDescription(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, org.opcfoundation.ua.builtintypes.ExpandedNodeId targetId, UaNode target, boolean isInverse, org.opcfoundation.ua.core.NodeClass nodeClass, EnumSet<org.opcfoundation.ua.core.BrowseResultMask> resultSet)
          Creates a new reference description to be returned as a browse result.
protected  void deleteMonitoredItem(ServiceContext serviceContext, Subscription subscription, MonitoredItem item)
           
protected  void deleteNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, Boolean deleteTargetReferences)
           
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)
           
protected  UaNode findNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId)
          Find the UaNode corresponding to the nodeId, if the Node Manager supportsUaNode().
 UaNode findNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
          Find the UaNode corresponding to the nodeId, if the Node Manager supportsUaNode().
protected  org.opcfoundation.ua.core.NodeClass findNodeClass(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, UaNode node)
          Find the NodeClass of a node, using the NodeManagerTable to first locate the correct NodeManager.
protected  void fireAddNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId parentNodeId, UaNode parent, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.core.NodeAttributes attributes, UaReferenceType referenceType, org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId, UaNode typeDefinition)
           
protected  void fireAddReference(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId sourceNodeId, UaNode sourceNode, org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId, UaNode targetNode, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, UaReferenceType referenceType, boolean isForward)
           
protected  void fireAfterAddNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId parentNodeId, UaNode parent, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.core.NodeAttributes attributes, UaReferenceType referenceType, org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId, UaNode typeDefinition)
           
protected  void fireAfterAddReference(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId sourceNodeId, UaNode sourceNode, org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId, UaNode targetNode, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, UaReferenceType referenceType, boolean isForward)
           
protected  void fireAfterCreateMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item)
           
protected  void fireAfterDeleteMonitoredItem(ServiceContext serviceContext, Subscription subscription, MonitoredItem item)
           
protected  void fireAfterModifyMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item)
           
protected  boolean fireBrowseNode(ServiceContext serviceContext, org.opcfoundation.ua.core.ViewDescription view, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, UaReference reference)
           
protected  void fireCreateMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, 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)
           
protected  void fireDeleteMonitoredItem(ServiceContext serviceContext, Subscription subscription, MonitoredItem item)
           
protected  void fireDeleteNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, boolean deleteTargetReferences)
           
protected  void fireDeleteReference(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId sourceNodeId, UaNode sourceNode, org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId, UaNode targetNode, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, UaReferenceType referenceType, boolean isForward, boolean deleteBidirectional)
           
protected  void fireModifyMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item, UaNode node, org.opcfoundation.ua.core.MonitoringParameters requestedParameters, org.opcfoundation.ua.core.MonitoringFilter filter, org.opcfoundation.ua.core.AggregateFilterResult filterResult)
           
protected abstract  org.opcfoundation.ua.builtintypes.QualifiedName getBrowseName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, UaNode node)
          Get the BrowseName of a node.
 Locale getDefaultLocale()
           
protected abstract  org.opcfoundation.ua.builtintypes.LocalizedText getDisplayName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, UaNode targetNode, Locale locale)
          Find the DisplayName of a node.
 EventManager getEventManager()
           
protected  EventManager getEventManager(org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 HistoryManager getHistoryManager()
           
 IoManager getIoManager()
           
protected  boolean getIsOfType(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId, UaType typeDefinition, org.opcfoundation.ua.builtintypes.NodeId expectedTypeId, UaType expectedType)
           
 MethodManager getMethodManager()
           
 int getNamespaceIndex()
           
 org.opcfoundation.ua.common.NamespaceTable getNamespaceTable()
           
 String getNamespaceUri()
           
 UaNode getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId)
          Gets the node, corresponding to a nodeId, if it exists in the local server.
protected  org.opcfoundation.ua.core.NodeClass getNodeClass(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, UaNode node)
          Return the node class of a node, owned by this NodeManager.
protected abstract  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.
 org.opcfoundation.ua.builtintypes.NodeId getNodeId(String namespace, String id)
          Returns NodeId from namespace and id.
 org.opcfoundation.ua.builtintypes.QualifiedName getQualifiedName(String namespace, String name)
           
 UaReference[] getReferences(org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
protected abstract  UaReference[] getReferences(org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node)
          Get all references of a node.
protected  UaReferenceType getReferenceType(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
           
protected abstract  org.opcfoundation.ua.builtintypes.ExpandedNodeId getTypeDefinition(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, UaNode node)
          Get the TypeDefinition of a node.
abstract  org.opcfoundation.ua.builtintypes.NodeId getVariableDataType(org.opcfoundation.ua.builtintypes.NodeId nodeId, UaValueNode valueNode)
          Get the data type of a variable node, managed by this node manager.
 boolean hasListener(NodeManagerListener listener)
          Check if the manager already has the specified listener.
abstract  boolean hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
          Check if the node manager has a certain node.
protected  void init()
          Initialize the NodeManager.
 boolean isInitialized()
           
 boolean isOfType(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId, UaType typeDefinition, org.opcfoundation.ua.builtintypes.NodeId expectedTypeId, UaType expectedType)
          Check if the given type is of the expectedType.
 boolean isStarted()
           
protected  void modifyMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item, org.opcfoundation.ua.core.MonitoringParameters requestedParameters, org.opcfoundation.ua.core.MonitoringFilter filter, org.opcfoundation.ua.core.AggregateFilterResult filterResult)
           
protected  void modifyMonitoredEventItem(ServiceContext serviceContext, Subscription subscription, MonitoredEventItem item, org.opcfoundation.ua.core.EventFilter eventFilter, org.opcfoundation.ua.core.EventFilterResult eventFilterResult)
           
protected  void queryFirst(ServiceContext serviceContext, org.opcfoundation.ua.core.QueryFirstRequest request, org.opcfoundation.ua.core.QueryFirstResponse response)
           
protected  void queryNext(ServiceContext serviceContext, org.opcfoundation.ua.core.QueryNextRequest request, org.opcfoundation.ua.core.QueryNextResponse response)
           
protected  boolean referenceMatchesRequest(UaReference reference, org.opcfoundation.ua.core.BrowseDirection browseDirection, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, UaReferenceType referenceType, Boolean includeSubTypes, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.NodeId sourceNodeId)
           
protected  org.opcfoundation.ua.builtintypes.NodeId registerNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 void removeListener(NodeManagerListener listener)
          Remove a notification listener from the Node Manager.
 void setDefaultLocale(Locale defaultLocale)
          Define the default locale to use for messages and other strings, whenever the locale is not defined or requested.
 void setEventManager(EventManager eventManager)
          Define the event manager that handles all event calls to the nodes of the node manager.
 void setHistoryManager(HistoryManager historyManager)
          Define the HistoryManager that should handle the history service for the nodes.
 void setIoManager(IoManager ioManager)
          Define the IO Manager that is handling attribute services, i.e. read and write calls, for the nodes.
 void setMethodManager(MethodManager methodManager)
          Define the MethodManager that is handling method calls for the nodes.
protected  void start()
          Start the NodeManager, i.e. make it available
 boolean supportsUaNode()
          Whether the NodeManager supports UaNode instances.
 String toString()
           
protected  org.opcfoundation.ua.core.BrowsePathTarget[] translateBrowsePath(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId startingNodeId, org.opcfoundation.ua.core.RelativePath relativePath)
           
protected  void unregisterNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 
Methods inherited from class com.prosysopc.ua.server.ServiceManagerBase
arrayDimensionsMatch, checkIsMethod, checkIsValueNode, checkIsVariable, checkIsVariableOrVariableType, dataTypeEquals, getNode, getNode, getNode, getNodeManagerTable, getServer, getSubscriptionManager, isValueNode, isVariable, listenerError, requireUaNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

initialized

protected boolean initialized

started

protected boolean started
Constructor Detail

NodeManager

public NodeManager(UaServer server,
                   String namespaceUri)
The default constructor.

Method Detail

addListener

public void addListener(NodeManagerListener listener)
Add a listener to get notifications of client actions on this Node Manager.

Parameters:
listener - the listener to add. Must not be null

addNode

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

Parameters:
node - 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 is invalid (i.e. null) or the NodeManager does not support UaNodes

findNode

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

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)

getDefaultLocale

public Locale getDefaultLocale()
Returns:
the default locale to use

getEventManager

public EventManager getEventManager()
Returns:
the EventManager that is handling event triggering and condition management.

getHistoryManager

public HistoryManager getHistoryManager()
Returns:
the HistoryManager that is handling the history service for the nodes.

getIoManager

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

getMethodManager

public MethodManager getMethodManager()
                               throws StatusException
Returns:
the MethodManager that is handling method calls for the nodes.
Throws:
StatusException

getNamespaceIndex

public int getNamespaceIndex()
Returns:
the NamespaceIndex of this NodeManager.
See Also:
getNamespaceUri()

getNamespaceTable

public org.opcfoundation.ua.common.NamespaceTable getNamespaceTable()
Returns:
the NamespaceTable which contains all namespaces managed by the UaServer. The table is used for conversions between NodeId and ExpandedNodeId types.

getNamespaceUri

public String getNamespaceUri()
Returns:
the URI of the namespace managed by the NodeManager.

getNode

public UaNode getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId)
               throws StatusException
Gets the node, corresponding to a nodeId, if it exists in the local server.

Overrides:
getNode in class ServiceManagerBase
Parameters:
nodeId - the ID of the node to get
Returns:
the node object
Throws:
StatusException - if the node is not found (Bad_NodeIdUnknown), is null (Bad_NodeIdInvalid) or if the node cannot be converted to a local NodeId (Bad_ServerIndexInvalid)
See Also:
ServiceManagerBase.getNode(NodeId)

getNodeId

public org.opcfoundation.ua.builtintypes.NodeId getNodeId(String namespace,
                                                          String id)
Returns NodeId from namespace and id.

Parameters:
namespace - namespace url
id - identifier part of NodeId, e.g. "i=13"
Returns:

getQualifiedName

public org.opcfoundation.ua.builtintypes.QualifiedName getQualifiedName(String namespace,
                                                                        String name)

getReferences

public UaReference[] getReferences(org.opcfoundation.ua.builtintypes.NodeId nodeId)

getVariableDataType

public abstract org.opcfoundation.ua.builtintypes.NodeId getVariableDataType(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                                                             UaValueNode valueNode)
                                                                      throws StatusException
Get the data type of a variable node, managed by this node manager.

Parameters:
nodeId - The NodeId of the variable, whose data type is requested.
valueNode - the variable or variableType node, if such exists
Returns:
the data type
Throws:
StatusException

hasListener

public boolean hasListener(NodeManagerListener listener)
Check if the manager already has the specified listener.

Parameters:
listener - the listener to check
Returns:
true if the listener is already defined for the manager

hasNode

public abstract boolean hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Check if the node manager has a certain node.

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

Parameters:
nodeId -
Returns:

isInitialized

public boolean isInitialized()
Returns:
the initialized

isOfType

public final boolean isOfType(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
                              UaType typeDefinition,
                              org.opcfoundation.ua.builtintypes.NodeId expectedTypeId,
                              UaType expectedType)
                       throws StatusException
Check if the given type is of the expectedType. The method should check if the types are equal or if the type represented by typeId inherits from the expected type represented by expectedTypeId.

The method will call the internal getIsOfType(NodeId, UaType, NodeId, UaType), if the node is in this NodeManager (hasNode(NodeId) return true) or will find the respective NodeManager from NodeManagerTable.

Override getIsOfType() if you want to modify the default behavior.

Parameters:
typeDefinitionId - the ID of the type that is tested
typeDefinition - the type that is tested (or null if not available)
expectedTypeId - the ID of type against which the test is done
expectedType - the type against which the test is done (or null if not available)
Returns:
true if the typeIds are equal or if typeId is a sub type of expectedTypeId.
Throws:
StatusException - if typeDefinitionId does not refer to an existing node

isStarted

public boolean isStarted()
Returns:
the started

removeListener

public void removeListener(NodeManagerListener listener)
Remove a notification listener from the Node Manager.

Parameters:
listener - the listener to remove

setDefaultLocale

public void setDefaultLocale(Locale defaultLocale)
Define the default locale to use for messages and other strings, whenever the locale is not defined or requested.

Parameters:
defaultLocale -

setEventManager

public void setEventManager(EventManager eventManager)
Define the event manager that handles all event calls to the nodes of the node manager.

Parameters:
eventManager - the eventManager to set

setHistoryManager

public void setHistoryManager(HistoryManager historyManager)
Define the HistoryManager that should handle the history service for the nodes.

Parameters:
historyManager -

setIoManager

public void setIoManager(IoManager ioManager)
Define the IO Manager that is handling attribute services, i.e. read and write calls, for the nodes.

Parameters:
ioManager - the IO Manager to set

setMethodManager

public void setMethodManager(MethodManager methodManager)
Define the MethodManager that is handling method calls for the nodes.

Parameters:
methodManager - the methodManager to set

supportsUaNode

public boolean supportsUaNode()
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 findNode(ExpandedNodeId)!

Returns:
true if UaNode objects are supported.

toString

public String toString()
Overrides:
toString in class Object
Returns:

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
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.

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
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.

Throws:
StatusException

afterCreateMonitoredDataItem

protected void afterCreateMonitoredDataItem(ServiceContext serviceContext,
                                            Subscription subscription,
                                            MonitoredDataItem item)
Parameters:
serviceContext -
subscription -
item -

afterCreateMonitoredEventItem

protected void afterCreateMonitoredEventItem(ServiceContext serviceContext,
                                             Subscription subscription,
                                             MonitoredEventItem item)
Parameters:
serviceContext -
subscription -
item -

afterDeleteMonitoredItem

protected void afterDeleteMonitoredItem(ServiceContext serviceContext,
                                        Subscription subscription,
                                        MonitoredItem item)
Parameters:
serviceContext -
subscription -
item -

afterModifyMonitoredDataItem

protected void afterModifyMonitoredDataItem(ServiceContext serviceContext,
                                            Subscription subscription,
                                            MonitoredDataItem item)
Parameters:
serviceContext -
subscription -
item -

afterModifyMonitoredEventItem

protected void afterModifyMonitoredEventItem(ServiceContext serviceContext,
                                             Subscription subscription,
                                             MonitoredEventItem item)
Parameters:
serviceContext -
subscription -
item -

browseNode

protected BrowseContinuationPoint browseNode(ServiceContext serviceContext,
                                             List<org.opcfoundation.ua.core.ReferenceDescription> referenceDescriptions,
                                             org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                             int maxReferences,
                                             org.opcfoundation.ua.core.BrowseDirection browseDirection,
                                             org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                             Boolean includeSubTypes,
                                             org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                             EnumSet<org.opcfoundation.ua.core.NodeClass> nodeClassSet,
                                             EnumSet<org.opcfoundation.ua.core.BrowseResultMask> resultSet,
                                             org.opcfoundation.ua.core.ViewDescription viewDescription,
                                             int startIndex)
                                      throws ServiceException,
                                             StatusException
Browse a single node and filter according to the parameters.

Parameters:
serviceContext -
referenceDescriptions -
nodeId -
maxReferences -
browseDirection -
referenceTypeId -
includeSubTypes -
browseName -
nodeClassSet -
resultSet -
viewDescription -
startIndex -
Returns:
Throws:
ServiceException
StatusException

callMethod

protected org.opcfoundation.ua.builtintypes.Variant[] callMethod(ServiceContext serviceContext,
                                                                 org.opcfoundation.ua.builtintypes.NodeId objectId,
                                                                 org.opcfoundation.ua.builtintypes.NodeId methodId,
                                                                 org.opcfoundation.ua.builtintypes.Variant[] inputArguments,
                                                                 org.opcfoundation.ua.builtintypes.StatusCode[] inputArgumentResults,
                                                                 org.opcfoundation.ua.builtintypes.DiagnosticInfo[] inputArgumentDiagnosticInfos)
                                                          throws StatusException
Parameters:
serviceContext -
objectId -
methodId -
inputArguments -
inputArgumentResults -
inputArgumentDiagnosticInfos -
Returns:
Throws:
StatusException

close

protected void close()
Close the node manager, when the serve closes.


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
Check that the monitored item request is valid.

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

createMonitoredEventItem

protected void createMonitoredEventItem(ServiceContext serviceContext,
                                        Subscription subscription,
                                        org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                        org.opcfoundation.ua.core.EventFilter eventFilter,
                                        org.opcfoundation.ua.core.EventFilterResult eventFilterResult)
                                 throws StatusException
Throws:
StatusException

createReferenceDescription

protected org.opcfoundation.ua.core.ReferenceDescription createReferenceDescription(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                                                                    org.opcfoundation.ua.builtintypes.ExpandedNodeId targetId,
                                                                                    UaNode target,
                                                                                    boolean isInverse,
                                                                                    org.opcfoundation.ua.core.NodeClass nodeClass,
                                                                                    EnumSet<org.opcfoundation.ua.core.BrowseResultMask> resultSet)
Creates a new reference description to be returned as a browse result.

Parameters:
targetId -
target -
nodeClass -
resultSet -
r -
Returns:

deleteMonitoredItem

protected void deleteMonitoredItem(ServiceContext serviceContext,
                                   Subscription subscription,
                                   MonitoredItem item)
                            throws StatusException
Throws:
StatusException

deleteNode

protected void deleteNode(ServiceContext serviceContext,
                          org.opcfoundation.ua.builtintypes.NodeId nodeId,
                          Boolean deleteTargetReferences)
                   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
Throws:
StatusException

findNode

protected UaNode findNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId)
                   throws org.opcfoundation.ua.common.ServiceResultException
Find the UaNode corresponding to the nodeId, if the Node Manager supportsUaNode(). You should use hasNode(org.opcfoundation.ua.builtintypes.NodeId) to check if the Node Manager has a node.

The method simply converts nodeId to a NodeId using getNamespaceTable() and calls findNode(NodeId).

Parameters:
nodeId - the ID of the node to look for.
Returns:
the respective UaNode or null, if the Node Manager does not have the node or does not support UaNodes
Throws:
org.opcfoundation.ua.common.ServiceResultException - if the nodeId cannot be converted to NodeId using the NamespaceTable of the server.
See Also:
getNode(ExpandedNodeId)

findNodeClass

protected org.opcfoundation.ua.core.NodeClass findNodeClass(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                                                            UaNode node)
Find the NodeClass of a node, using the NodeManagerTable to first locate the correct NodeManager.

Parameters:
nodeId -
node -
Returns:

fireAddNode

protected void fireAddNode(ServiceContext serviceContext,
                           org.opcfoundation.ua.builtintypes.NodeId parentNodeId,
                           UaNode parent,
                           org.opcfoundation.ua.builtintypes.NodeId nodeId,
                           org.opcfoundation.ua.core.NodeClass nodeClass,
                           org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                           org.opcfoundation.ua.core.NodeAttributes attributes,
                           UaReferenceType referenceType,
                           org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
                           UaNode typeDefinition)
                    throws StatusException
Throws:
StatusException

fireAddReference

protected void fireAddReference(ServiceContext serviceContext,
                                org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
                                UaNode sourceNode,
                                org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
                                UaNode targetNode,
                                org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                UaReferenceType referenceType,
                                boolean isForward)
                         throws StatusException
Throws:
StatusException

fireAfterAddNode

protected void fireAfterAddNode(ServiceContext serviceContext,
                                org.opcfoundation.ua.builtintypes.NodeId parentNodeId,
                                UaNode parent,
                                org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                UaNode node,
                                org.opcfoundation.ua.core.NodeClass nodeClass,
                                org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                org.opcfoundation.ua.core.NodeAttributes attributes,
                                UaReferenceType referenceType,
                                org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
                                UaNode typeDefinition)
                         throws StatusException
Throws:
StatusException

fireAfterAddReference

protected void fireAfterAddReference(ServiceContext serviceContext,
                                     org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
                                     UaNode sourceNode,
                                     org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
                                     UaNode targetNode,
                                     org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                     UaReferenceType referenceType,
                                     boolean isForward)
                              throws StatusException
Throws:
StatusException

fireAfterCreateMonitoredDataItem

protected void fireAfterCreateMonitoredDataItem(ServiceContext serviceContext,
                                                Subscription subscription,
                                                MonitoredDataItem item)
Parameters:
serviceContext -
subscription -
item -

fireAfterDeleteMonitoredItem

protected void fireAfterDeleteMonitoredItem(ServiceContext serviceContext,
                                            Subscription subscription,
                                            MonitoredItem item)
Parameters:
serviceContext -
subscription -
item -

fireAfterModifyMonitoredDataItem

protected void fireAfterModifyMonitoredDataItem(ServiceContext serviceContext,
                                                Subscription subscription,
                                                MonitoredDataItem item)
Parameters:
serviceContext -
subscription -
item -

fireBrowseNode

protected boolean fireBrowseNode(ServiceContext serviceContext,
                                 org.opcfoundation.ua.core.ViewDescription view,
                                 org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                 UaNode node,
                                 UaReference reference)
Parameters:
serviceContext -
node -
view -
nodeId -
reference -
Returns:

fireCreateMonitoredDataItem

protected void fireCreateMonitoredDataItem(ServiceContext serviceContext,
                                           Subscription subscription,
                                           org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                           UaNode node,
                                           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
Parameters:
serviceContext -
subscription -
nodeId -
node -
attributeId -
indexRange -
params -
filter -
filterResult -
monitoringMode -
Throws:
StatusException

fireDeleteMonitoredItem

protected void fireDeleteMonitoredItem(ServiceContext serviceContext,
                                       Subscription subscription,
                                       MonitoredItem item)
Parameters:
serviceContext -
subscription -
item -

fireDeleteNode

protected void fireDeleteNode(ServiceContext serviceContext,
                              org.opcfoundation.ua.builtintypes.NodeId nodeId,
                              UaNode node,
                              boolean deleteTargetReferences)
                       throws StatusException
Parameters:
serviceContext -
nodeId -
node -
deleteTargetReferences -
Throws:
StatusException

fireDeleteReference

protected void fireDeleteReference(ServiceContext serviceContext,
                                   org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
                                   UaNode sourceNode,
                                   org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
                                   UaNode targetNode,
                                   org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                   UaReferenceType referenceType,
                                   boolean isForward,
                                   boolean deleteBidirectional)
                            throws StatusException
Parameters:
serviceContext -
sourceNodeId -
sourceNode -
targetNodeId -
targetNode -
referenceTypeId -
referenceType -
isForward -
deleteBidirectional -
Throws:
StatusException

fireModifyMonitoredDataItem

protected void fireModifyMonitoredDataItem(ServiceContext serviceContext,
                                           Subscription subscription,
                                           MonitoredDataItem item,
                                           UaNode node,
                                           org.opcfoundation.ua.core.MonitoringParameters requestedParameters,
                                           org.opcfoundation.ua.core.MonitoringFilter filter,
                                           org.opcfoundation.ua.core.AggregateFilterResult filterResult)
                                    throws StatusException
Parameters:
serviceContext -
subscription -
item -
node -
requestedParameters -
filter -
filterResult -
Throws:
StatusException

getBrowseName

protected abstract org.opcfoundation.ua.builtintypes.QualifiedName getBrowseName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                                                                                 UaNode node)
Get the BrowseName of a node.

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

For custom NodeManagers this must be implemented.

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 abstract org.opcfoundation.ua.builtintypes.LocalizedText getDisplayName(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                                                                                  UaNode targetNode,
                                                                                  Locale locale)
Find the DisplayName of a node.

NodeManagerUaNode implements the method by getting the DisplayName from the targetNode

For custom NodeManagers this must be implemented.

Parameters:
nodeId - the ID of the node
node - the node, if it is a UaNode. May be null.
locale - The locale in which the name is requested. May be null.
Returns:
the DisplayName of node

getEventManager

protected EventManager getEventManager(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Parameters:
nodeId -
Returns:

getIsOfType

protected boolean getIsOfType(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
                              UaType typeDefinition,
                              org.opcfoundation.ua.builtintypes.NodeId expectedTypeId,
                              UaType expectedType)
                       throws StatusException
Parameters:
typeDefinitionId -
typeDefinition -
expectedTypeId -
expectedType -
Returns:
Throws:
StatusException

getNodeClass

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

Parameters:
nodeId - The ID of the node.
node - The UaNode object, if the node manager supports them, or null
Returns:
the NodeClass of the node

getNodeClass

protected abstract 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. Use findNodeClass(ExpandedNodeId, UaNode) to search for the NodeClass of any node, possibly owned by some other NodeManager.

Parameters:
nodeId - The ID of the node.
node - The UaNode object, if the node manager supports them, or null
Returns:
the NodeClass of the node

getReferences

protected abstract UaReference[] getReferences(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                               UaNode node)
Get all references of a node.

Parameters:
nodeId - the ID of the node
node - the node object, if available
Returns:
all references for the node

getReferenceType

protected UaReferenceType getReferenceType(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
                                    throws StatusException
Parameters:
referenceTypeId -
Returns:
Throws:
StatusException

getTypeDefinition

protected abstract org.opcfoundation.ua.builtintypes.ExpandedNodeId getTypeDefinition(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                                                                                      UaNode node)
Get the TypeDefinition of a node.

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

For custom NodeManagers this must be implemented.

Parameters:
nodeId - the ID of the node
node - the node, if it is a UaNode. May be null.
Returns:
the BrowseName of node

init

protected void init()
             throws StatusException,
                    UaNodeFactoryException
Initialize the NodeManager.

Throws:
StatusException
UaNodeFactoryException

modifyMonitoredDataItem

protected void modifyMonitoredDataItem(ServiceContext serviceContext,
                                       Subscription subscription,
                                       MonitoredDataItem item,
                                       org.opcfoundation.ua.core.MonitoringParameters requestedParameters,
                                       org.opcfoundation.ua.core.MonitoringFilter filter,
                                       org.opcfoundation.ua.core.AggregateFilterResult filterResult)
                                throws StatusException
Throws:
StatusException

modifyMonitoredEventItem

protected void modifyMonitoredEventItem(ServiceContext serviceContext,
                                        Subscription subscription,
                                        MonitoredEventItem item,
                                        org.opcfoundation.ua.core.EventFilter eventFilter,
                                        org.opcfoundation.ua.core.EventFilterResult eventFilterResult)
                                 throws StatusException
Parameters:
serviceContext -
subscription -
item -
eventFilter -
Throws:
StatusException
EventFilterException

queryFirst

protected void queryFirst(ServiceContext serviceContext,
                          org.opcfoundation.ua.core.QueryFirstRequest request,
                          org.opcfoundation.ua.core.QueryFirstResponse response)
                   throws ServiceException
Parameters:
serviceContext -
request -
response -
Throws:
ServiceException

queryNext

protected void queryNext(ServiceContext serviceContext,
                         org.opcfoundation.ua.core.QueryNextRequest request,
                         org.opcfoundation.ua.core.QueryNextResponse response)
                  throws ServiceException
Parameters:
serviceContext -
request -
response -
Throws:
ServiceException

referenceMatchesRequest

protected boolean referenceMatchesRequest(UaReference reference,
                                          org.opcfoundation.ua.core.BrowseDirection browseDirection,
                                          org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                          UaReferenceType referenceType,
                                          Boolean includeSubTypes,
                                          org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                          org.opcfoundation.ua.builtintypes.NodeId sourceNodeId)
Parameters:
reference -
browseDirection -
referenceTypeId -
referenceType -
includeSubTypes -
browseName -
Returns:

registerNode

protected org.opcfoundation.ua.builtintypes.NodeId registerNode(ServiceContext serviceContext,
                                                                org.opcfoundation.ua.builtintypes.NodeId nodeId)
                                                         throws StatusException
Throws:
StatusException

start

protected void start()
              throws StatusException,
                     UaNodeFactoryException
Start the NodeManager, i.e. make it available

Throws:
StatusException
UaNodeFactoryException

translateBrowsePath

protected org.opcfoundation.ua.core.BrowsePathTarget[] translateBrowsePath(ServiceContext serviceContext,
                                                                           org.opcfoundation.ua.builtintypes.NodeId startingNodeId,
                                                                           org.opcfoundation.ua.core.RelativePath relativePath)
                                                                    throws StatusException,
                                                                           ServiceException
Throws:
StatusException
ServiceException

unregisterNode

protected void unregisterNode(ServiceContext serviceContext,
                              org.opcfoundation.ua.builtintypes.NodeId nodeId)


Copyright © 2018. All rights reserved.