com.prosysopc.ua.server
Class NodeManagerAdapter

java.lang.Object
  extended by com.prosysopc.ua.server.NodeManagerAdapter
All Implemented Interfaces:
NodeManagerListener

public abstract class NodeManagerAdapter
extends Object
implements NodeManagerListener


Constructor Summary
NodeManagerAdapter()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeManagerAdapter

public NodeManagerAdapter()
Method Detail

onAfterAddNode

public 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
Description copied from interface: NodeManagerListener
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 NodeManagerListener.onAddNode(ServiceContext, NodeId, UaNode, NodeId, NodeClass, QualifiedName, NodeAttributes, UaReferenceType, ExpandedNodeId, UaNode) instead of this method.

Specified by:
onAfterAddNode in interface NodeManagerListener
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

public 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
Description copied from interface: NodeManagerListener
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 NodeManagerListener.onAddReference(ServiceContext, NodeId, UaNode, ExpandedNodeId, UaNode, NodeId, UaReferenceType, boolean) instead.

Specified by:
onAfterAddReference in interface NodeManagerListener
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

public void onAfterCreateMonitoredDataItem(ServiceContext serviceContext,
                                           Subscription subscription,
                                           MonitoredDataItem item)
Description copied from interface: NodeManagerListener
Notification after a new MonitoredDataItem was added to a subscription.

Specified by:
onAfterCreateMonitoredDataItem in interface NodeManagerListener
Parameters:
serviceContext - The client calling context.
subscription - The subscription
item - The item that was added

onAfterDeleteMonitoredDataItem

public void onAfterDeleteMonitoredDataItem(ServiceContext serviceContext,
                                           Subscription subscription,
                                           MonitoredDataItem item)
Description copied from interface: NodeManagerListener
Notification after a MonitoredDataItem was deleted.

Specified by:
onAfterDeleteMonitoredDataItem in interface NodeManagerListener
Parameters:
serviceContext - The client calling context.
subscription - The subscription
item - The item that was modified

onAfterModifyMonitoredDataItem

public void onAfterModifyMonitoredDataItem(ServiceContext serviceContext,
                                           Subscription subscription,
                                           MonitoredDataItem item)
Description copied from interface: NodeManagerListener
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 NodeManagerListener.onModifyMonitoredDataItem(ServiceContext, Subscription, MonitoredDataItem, UaNode, MonitoringParameters, MonitoringFilter, AggregateFilterResult) where you can validate them. MonitoringMode is only notified here after it has been changed.

Specified by:
onAfterModifyMonitoredDataItem in interface NodeManagerListener
Parameters:
serviceContext - The client calling context.
subscription - The subscription
item - The item that was modified

onAddNode

public 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
Description copied from interface: NodeManagerListener
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.

Specified by:
onAddNode in interface NodeManagerListener
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

public 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
Description copied from interface: NodeManagerListener
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.

Specified by:
onAddReference in interface NodeManagerListener
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

public boolean onBrowseNode(ServiceContext serviceContext,
                            org.opcfoundation.ua.core.ViewDescription view,
                            org.opcfoundation.ua.builtintypes.NodeId nodeId,
                            UaNode node,
                            UaReference reference)
Description copied from interface: NodeManagerListener
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.

Specified by:
onBrowseNode in interface NodeManagerListener
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:
NodeManagerListener.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

public 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
Description copied from interface: NodeManagerListener
Notification of a new MonitoredDataItem request from a client application.

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

Specified by:
onCreateMonitoredDataItem in interface NodeManagerListener
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

public void onDeleteMonitoredDataItem(ServiceContext serviceContext,
                                      Subscription subscription,
                                      MonitoredDataItem item)
Description copied from interface: NodeManagerListener
Notification of a data item being removed from a client subscription.

Specified by:
onDeleteMonitoredDataItem in interface NodeManagerListener
Parameters:
serviceContext - The client calling context.
subscription - The subscription from which the item is being removed
item - The monitored item to remove

onDeleteNode

public void onDeleteNode(ServiceContext serviceContext,
                         org.opcfoundation.ua.builtintypes.NodeId nodeId,
                         UaNode node,
                         boolean deleteTargetReferences)
                  throws StatusException
Description copied from interface: NodeManagerListener
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.

Specified by:
onDeleteNode in interface NodeManagerListener
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

public 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
Description copied from interface: NodeManagerListener
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.

Specified by:
onDeleteReference in interface NodeManagerListener
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

public void onGetReferences(ServiceContext serviceContext,
                            org.opcfoundation.ua.core.ViewDescription viewDescription,
                            org.opcfoundation.ua.builtintypes.NodeId nodeId,
                            UaNode node,
                            List<UaReference> references)
Description copied from interface: NodeManagerListener
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.

Specified by:
onGetReferences in interface NodeManagerListener
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 NodeManagerListener.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

public 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
Description copied from interface: NodeManagerListener
Notification of a modify request on the monitoring parameters of a monitored item.

Specified by:
onModifyMonitoredDataItem in interface NodeManagerListener
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.