com.prosysopc.ua.server
Interface NodeManagerListener

All Known Implementing Classes:
NodeManagerAdapter

public interface NodeManagerListener

Event listener interface to handle calls to the node manager.


Method Summary
 void onAddNode(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)
          A notification of an AddNode request to add a new node into the node manager.
 void onAddReference(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)
          A notification of an AddReference request to add a new reference into the node manager.
 void onAfterAddNode(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)
          Called after a node is added as a result of an AddNodes call.
 void onAfterAddReference(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)
          Called after a reference is added as a result of an AddReferences call.
 void onAfterCreateMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item)
          Notification after a new MonitoredDataItem was added to a subscription.
 void onAfterDeleteMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item)
          Notification after a MonitoredDataItem was deleted.
 void onAfterModifyMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item)
          Notification after a MonitoredDataItem was modified.
 boolean onBrowseNode(ServiceContext serviceContext, org.opcfoundation.ua.core.ViewDescription view, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, UaReference reference)
          Handle a browse request.
 void onCreateMonitoredDataItem(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)
          Notification of a new MonitoredDataItem request from a client application.
 void onDeleteMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item)
          Notification of a data item being removed from a client subscription.
 void onDeleteNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, boolean deleteTargetReferences)
          Confirm a request to delete a node permanently from the address space of the node manager.
 void onDeleteReference(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)
          Confirm a request to delete a reference permanently from the address space of the node manager.
 void onGetReferences(ServiceContext serviceContext, org.opcfoundation.ua.core.ViewDescription viewDescription, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, List<UaReference> references)
          Provide the references for a node in the browse request.
 void onModifyMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item, UaNode node, org.opcfoundation.ua.core.MonitoringParameters params, org.opcfoundation.ua.core.MonitoringFilter filter, org.opcfoundation.ua.core.AggregateFilterResult filterResult)
          Notification of a modify request on the monitoring parameters of a monitored item.
 

Method Detail

onAfterAddNode

void onAfterAddNode(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
Called after a node is added as a result of an AddNodes call. NOTE! the node(s) is already added when this method is called, therefore any user validation should be done in onAddNode(ServiceContext, NodeId, UaNode, NodeId, NodeClass, QualifiedName, NodeAttributes, UaReferenceType, ExpandedNodeId, UaNode) instead of this method.

Parameters:
serviceContext - The client calling context. serviceContext.isInternal() is true if the request is coming from a server internal operation.
parentNodeId - NodeId of the parent node
parent - Parent node if available
nodeId - Requested ID for the new node
node - The added node (if TypeDefinition has subnodes, they are added as a reference to this node, i.e. this node is the top node)
nodeClass - NodeClass of the new node to add
browseName - BrowseName of the new node
attributes - Other attribute values of the new node
referenceType - Reference used to add the node to parent
typeDefinitionId - Type Definition ID of the new node
typeDefinition - TypeDefinition node if available
Throws:
StatusException

onAfterAddReference

void onAfterAddReference(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
Called after a reference is added as a result of an AddReferences call. NOTE! the reference is already added when this method is called, therefore any user validation should be done in onAddReference(ServiceContext, NodeId, UaNode, ExpandedNodeId, UaNode, NodeId, UaReferenceType, boolean) instead.

Parameters:
serviceContext - The client calling context. serviceContext.isInternal() is true if the request is coming from a server internal operation.
sourceNodeId - The NodeId of the source node
sourceNode - The source node of the reference, if available as a UaNode
targetNodeId - The NodeId of the target node
targetNode - The target node of the reference, if available as a UaNode
referenceTypeId - The NodeId of the type of reference to add
referenceType - The type of reference to add as an UaReferenceType node
isForward - Whether to add a forward reference - if false, add an inverse reference, i.e. from target to source
Throws:
StatusException

onAfterCreateMonitoredDataItem

void onAfterCreateMonitoredDataItem(ServiceContext serviceContext,
                                    Subscription subscription,
                                    MonitoredDataItem item)
Notification after a new MonitoredDataItem was added to a subscription.

Parameters:
serviceContext - The client calling context.
subscription - The subscription
item - The item that was added

onAfterDeleteMonitoredDataItem

void onAfterDeleteMonitoredDataItem(ServiceContext serviceContext,
                                    Subscription subscription,
                                    MonitoredDataItem item)
Notification after a MonitoredDataItem was deleted.

Parameters:
serviceContext - The client calling context.
subscription - The subscription
item - The item that was modified

onAfterModifyMonitoredDataItem

void onAfterModifyMonitoredDataItem(ServiceContext serviceContext,
                                    Subscription subscription,
                                    MonitoredDataItem item)
Notification after a MonitoredDataItem was modified.

The method is called whenever the item parameters or filter is changed or if the MonitoringMode is changed. The parameter and filter changes are also notified in onModifyMonitoredDataItem(ServiceContext, Subscription, MonitoredDataItem, UaNode, MonitoringParameters, MonitoringFilter, AggregateFilterResult) where you can validate them. MonitoringMode is only notified here after it has been changed.

Parameters:
serviceContext - The client calling context.
subscription - The subscription
item - The item that was modified

onAddNode

void onAddNode(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
A notification of an AddNode request to add a new node into the node manager. The method gets called for every node that is received in an AddNodes request from a client application (or in some cases internally from the server, identifiable from serviceContext).

You should use the method to check if the user has rights to add the node to the server. If not, throw StatusException with StatusCode=Bad_UserAccessDenied.

Parameters:
serviceContext - The client calling context. serviceContext.isInternal() is true if the request is coming from a server internal operation.
parentNodeId - NodeId of the parent node
parent - Parent node if available
nodeId - Requested ID for the new node
nodeClass - NodeClass of the new node to add
browseName - BrowseName of the new node
attributes - Other attribute values of the new node
referenceType - Reference used to add the node to parent
typeDefinitionId - Type Definition ID of the new node
typeDefinition - TypeDefinition node if available
Throws:
StatusException - with StatusCode=Bad_UserAccessDenied, if the user is not allowed to perform the operation

onAddReference

void onAddReference(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
A notification of an AddReference request to add a new reference into the node manager. The method gets called for every reference that is received in an AddReferences request from a client application (or in some cases internally from the server, identifiable from serviceContext).

You should use the method to check if the user has rights to add the reference to the server. If not, throw StatusException with StatusCode=Bad_UserAccessDenied.

Parameters:
serviceContext - The client calling context. serviceContext.isInternal() is true if the request is coming from a server internal operation.
sourceNodeId - The NodeId of the source node
sourceNode - The source node of the reference, if available as a UaNode
targetNodeId - The NodeId of the target node
targetNode - The target node of the reference, if available as a UaNode
referenceTypeId - The NodeId of the type of reference to add
referenceType - The type of reference to add as an UaReferenceType node
isForward - Whether to add a forward reference - if false, add an inverse reference, i.e. from target to source
Throws:
StatusException - with StatusCode=Bad_UserAccessDenied, if the user is not allowed to perform the operation

onBrowseNode

boolean onBrowseNode(ServiceContext serviceContext,
                     org.opcfoundation.ua.core.ViewDescription view,
                     org.opcfoundation.ua.builtintypes.NodeId nodeId,
                     UaNode node,
                     UaReference reference)
Handle a browse request. Use the handler to provide, for example, user based filtering on the browse results. The method is being called for references that will be returned to the client, unless they have already been filtered out by the default criteria.

Parameters:
serviceContext - The client calling context
view - The view being browsed
nodeId - The ID of the node being browsed
node - The node being browsed
reference - The reference about to be included in the browse results
Returns:
true, if the result may be included in the browse results
See Also:
onGetReferences(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.ViewDescription, org.opcfoundation.ua.builtintypes.NodeId, com.prosysopc.ua.nodes.UaNode, java.util.List)

onCreateMonitoredDataItem

void onCreateMonitoredDataItem(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
Notification of a new MonitoredDataItem request from a client application.

Note that the event items are being notified by the EventManager.

Parameters:
serviceContext - The client calling context.
subscription - The subscription to which the item is being added
nodeId - The NodeId for the node to monitor
node - The node to monitor. Can be null if listening a NodeManager that does not support UaNodes.
attributeId - The attribute to monitor.
indexRange - A possible index range for array values.
params - The requested monitoring parameters.
filter - An optional filter for the item. This may be a DataChangeFilter or AggregateFilterResult
filterResult - The results for an AggregateFilterResult. Fill the object with your results, if there are problems in using the defined filter. For DataChangeFilters the parameter is not used (and will be null).
monitoringMode - The requested MonitoringMode for the item being added.
Throws:
StatusException - with StatusCode=Bad_UserAccessDenied, if the user is not allowed to perform the operation

onDeleteMonitoredDataItem

void onDeleteMonitoredDataItem(ServiceContext serviceContext,
                               Subscription subscription,
                               MonitoredDataItem item)
Notification of a data item being removed from a client subscription.

Parameters:
serviceContext - The client calling context.
subscription - The subscription from which the item is being removed
item - The monitored item to remove

onDeleteNode

void onDeleteNode(ServiceContext serviceContext,
                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                  UaNode node,
                  boolean deleteTargetReferences)
                  throws StatusException
Confirm a request to delete a node permanently from the address space of the node manager. Use the handler to provide, for example, user based filtering on the operation.

Parameters:
serviceContext - The client calling context.
nodeId - The ID of the node to delete
node - The node being deleted, if available
deleteTargetReferences - Whether the references in which this node is the target, should also be deleted.
Throws:
StatusException - If the reference may not be deleted, with a specific status code. Use either one of these: Bad_UserAccessDenied, Bad_NoDeleteRights

onDeleteReference

void onDeleteReference(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
Confirm a request to delete a reference permanently from the address space of the node manager. Use the handler to provide, for example, user based filtering on the operation.

Parameters:
serviceContext - The client calling context.
sourceNodeId - The NodeId of the source node
sourceNode - The source node of the reference, if available as a UaNode
targetNodeId - The NodeId of the target node
targetNode - The target node of the reference, if available as a UaNode
referenceTypeId - The NodeId of the type of reference to remove
referenceType - The type of reference to remove as an UaReferenceType node
isForward - Whether to remove a forward reference - if false, delete the inverse reference, i.e. from target to source
deleteBidirectional - Whether to remove a reference to both directions
Throws:
StatusException - If the reference may not be deleted, with a specific status code. Use either one of these: Bad_UserAccessDenied, Bad_NoDeleteRights

onGetReferences

void onGetReferences(ServiceContext serviceContext,
                     org.opcfoundation.ua.core.ViewDescription viewDescription,
                     org.opcfoundation.ua.builtintypes.NodeId nodeId,
                     UaNode node,
                     List<UaReference> references)
Provide the references for a node in the browse request. This method is most useful for providing custom references that are not defined in the node objects. So you can add here references that are not in the references list by default.

Parameters:
serviceContext - The client calling context.
viewDescription - The view being browsed
nodeId - The node id of the node that is browsed
node - The node that is browsed
references - The initial references of the node. Modify the list as required, for example to add custom references to the list. The list may get filtered later in onBrowseNode(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.ViewDescription, org.opcfoundation.ua.builtintypes.NodeId, com.prosysopc.ua.nodes.UaNode, com.prosysopc.ua.nodes.UaReference).

onModifyMonitoredDataItem

void onModifyMonitoredDataItem(ServiceContext serviceContext,
                               Subscription subscription,
                               MonitoredDataItem item,
                               UaNode node,
                               org.opcfoundation.ua.core.MonitoringParameters params,
                               org.opcfoundation.ua.core.MonitoringFilter filter,
                               org.opcfoundation.ua.core.AggregateFilterResult filterResult)
                               throws StatusException
Notification of a modify request on the monitoring parameters of a monitored item.

Parameters:
serviceContext - The client calling context.
subscription - The subscription to which the item is being added
item - The monitoring item to modify
node - The node being monitored (as given by getNode(item.getNodeId())).
params - The requested monitoring parameters.
filter - An optional filter. This may be a DataChangeFilter of AggregateFilter
filterResult - The results for an AggregateFilterResult. Fill the object with your results, if there are problems in using the defined filter. For DataChangeFilters the parameter is not used (and will be null).
Throws:
StatusException - with StatusCode=Bad_UserAccessDenied, if the user is not allowed to perform the operation


Copyright © 2018. All rights reserved.