com.prosysopc.ua.server
Class EventManagerUaNode

java.lang.Object
  extended by com.prosysopc.ua.server.ServiceManagerBase
      extended by com.prosysopc.ua.server.EventManager
          extended by com.prosysopc.ua.server.EventManagerUaNode
All Implemented Interfaces:
CallableListener

public class EventManagerUaNode
extends EventManager


Field Summary
 
Fields inherited from class com.prosysopc.ua.server.EventManager
listener, RESULT_OK
 
Constructor Summary
EventManagerUaNode(NodeManager nodeManager)
           
 
Method Summary
protected  boolean acknowledge(ServiceContext serviceContext, AcknowledgeableConditionTypeNode condition, org.opcfoundation.ua.builtintypes.ByteString eventId, org.opcfoundation.ua.builtintypes.LocalizedText comment)
           
protected  boolean addComment(ServiceContext serviceContext, ConditionTypeNode condition, org.opcfoundation.ua.builtintypes.ByteString eventId, org.opcfoundation.ua.builtintypes.LocalizedText comment)
           
protected  void collectConditions(UaNode node, Collection<ConditionTypeNode> conditions)
           
protected  boolean confirm(ServiceContext serviceContext, AcknowledgeableConditionTypeNode condition, org.opcfoundation.ua.builtintypes.ByteString eventId, org.opcfoundation.ua.builtintypes.LocalizedText comment)
           
protected  boolean disable(ServiceContext serviceContext, ConditionTypeNode condition)
           
protected  boolean enable(ServiceContext serviceContext, ConditionTypeNode condition)
           
 Collection<ConditionTypeNode> getConditions()
          Get a list of all Condition nodes in the server address space.
 Collection<ConditionTypeNode> getConditions(org.opcfoundation.ua.builtintypes.NodeId nodeId)
          Get a list of all Condition nodes in the server address space that are listenable from the specified node.
 Collection<ConditionTypeNode> getConditions(UaNode node)
          Get a list of all Condition nodes in the server address space that are listenable from the specified node.
 boolean onCall(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId objectId, UaNode object, org.opcfoundation.ua.builtintypes.NodeId methodId, UaMethod method, org.opcfoundation.ua.builtintypes.Variant[] inputArguments, org.opcfoundation.ua.builtintypes.StatusCode[] inputArgumentResults, org.opcfoundation.ua.builtintypes.DiagnosticInfo[] inputArgumentDiagnosticInfos, org.opcfoundation.ua.builtintypes.Variant[] output)
          A method call notification.
protected  boolean oneshotshelve(ServiceContext serviceContext, AlarmConditionTypeNode condition, ShelvedStateMachineTypeNode stateMachine)
           
protected  void refreshItem(MonitoredEventItem eventItem)
           
protected  boolean requireUaNode()
           
protected  boolean timedshelve(ServiceContext serviceContext, AlarmConditionTypeNode condition, ShelvedStateMachineTypeNode stateMachine, double shelvingTime)
           
protected  boolean unshelve(ServiceContext serviceContext, AlarmConditionTypeNode condition, ShelvedStateMachineTypeNode stateMachine)
           
 
Methods inherited from class com.prosysopc.ua.server.EventManager
afterCreateMonitoredEventItem, afterDeleteMonitoredEventItem, afterModifyMonitoredEventItem, createEventId, createFullEventId, createMonitoredEventItem, deleteMonitoredEventItem, extractUserEventId, getListener, getNodeManager, methodEqualsIdOrName, modifyMonitoredEventItem, refresh, refresh, refreshEndEvent, refreshEndEvent, refreshItems, refreshStartEvent, refreshStartEvent, refreshSubscription, setListener
 
Methods inherited from class com.prosysopc.ua.server.ServiceManagerBase
arrayDimensionsMatch, checkIsMethod, checkIsValueNode, checkIsVariable, checkIsVariableOrVariableType, dataTypeEquals, getNode, getNode, getNode, getNode, getNodeManagerTable, getServer, getSubscriptionManager, isValueNode, isVariable, listenerError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventManagerUaNode

public EventManagerUaNode(NodeManager nodeManager)
Parameters:
nodeManager -
Method Detail

getConditions

public Collection<ConditionTypeNode> getConditions()
Get a list of all Condition nodes in the server address space.

The method will search for condition nodes that are connected to the Server object via HasCondition and HasEventSource/HasNotifier (forward) references.

Returns:
a collection of all condition nodes in the server

getConditions

public Collection<ConditionTypeNode> getConditions(org.opcfoundation.ua.builtintypes.NodeId nodeId)
                                            throws StatusException
Get a list of all Condition nodes in the server address space that are listenable from the specified node.

The method will search for condition nodes that are connected to the specified node via HasCondition and HasEventSource/HasNotifier (forward) references.

The method finds the node object corresponding to the nodeId and calls the corresponding method with the node.

Parameters:
nodeId - ID of the root node for the list
Returns:
a collection of condition nodes under the specified node
Throws:
StatusException - if the nodeId does not correspond to a node

getConditions

public Collection<ConditionTypeNode> getConditions(UaNode node)
Get a list of all Condition nodes in the server address space that are listenable from the specified node.

The method will search for condition nodes that are connected to the specified node via HasCondition and HasEventSource/HasNotifier (forward) references.

Parameters:
node - Root node for the list
Returns:
a collection of condition nodes under the specified node

onCall

public boolean onCall(ServiceContext serviceContext,
                      org.opcfoundation.ua.builtintypes.NodeId objectId,
                      UaNode object,
                      org.opcfoundation.ua.builtintypes.NodeId methodId,
                      UaMethod method,
                      org.opcfoundation.ua.builtintypes.Variant[] inputArguments,
                      org.opcfoundation.ua.builtintypes.StatusCode[] inputArgumentResults,
                      org.opcfoundation.ua.builtintypes.DiagnosticInfo[] inputArgumentDiagnosticInfos,
                      org.opcfoundation.ua.builtintypes.Variant[] output)
               throws StatusException
Description copied from interface: CallableListener
A method call notification.

Use onCall to check whether the called method is the one that you handle. If so, return true, and set the outputs. Do not create a new array for the outputs, just assign your values in there - it is already created for the length defined by the OutputArguments of the UaMethod.

If you find errors in the inputArguments, fill in the inputArgumentResults and inputArgumentDiagnosticInfos respectively. They are also preallocated.

Specified by:
onCall in interface CallableListener
Overrides:
onCall in class EventManager
objectId - the ID of the node whose method is being called
object - the object node whose method is being called, if available
methodId - the ID of the method being called
method - the method node being called, if available
inputArguments - input argument values
inputArgumentResults - room for argument errors. Fill in the array if you encounter errors in the values.
inputArgumentDiagnosticInfos - room for diagnostic info, in case of errors.
output - room for output values. The array is pre-created, so just fill in the values.
Returns:
true if you handle the call, which prevents any other handler being called.
Throws:
StatusException - if there are errors in the method handling. For example, if you set inputArgumentResults, you should throw a StatusException with StatusCodes.Bad_InvalidArgument

acknowledge

protected boolean acknowledge(ServiceContext serviceContext,
                              AcknowledgeableConditionTypeNode condition,
                              org.opcfoundation.ua.builtintypes.ByteString eventId,
                              org.opcfoundation.ua.builtintypes.LocalizedText comment)
                       throws StatusException
Throws:
StatusException

addComment

protected boolean addComment(ServiceContext serviceContext,
                             ConditionTypeNode condition,
                             org.opcfoundation.ua.builtintypes.ByteString eventId,
                             org.opcfoundation.ua.builtintypes.LocalizedText comment)
                      throws StatusException
Throws:
StatusException

collectConditions

protected void collectConditions(UaNode node,
                                 Collection<ConditionTypeNode> conditions)

confirm

protected boolean confirm(ServiceContext serviceContext,
                          AcknowledgeableConditionTypeNode condition,
                          org.opcfoundation.ua.builtintypes.ByteString eventId,
                          org.opcfoundation.ua.builtintypes.LocalizedText comment)
                   throws StatusException
Throws:
StatusException

disable

protected boolean disable(ServiceContext serviceContext,
                          ConditionTypeNode condition)
                   throws StatusException
Throws:
StatusException

enable

protected boolean enable(ServiceContext serviceContext,
                         ConditionTypeNode condition)
                  throws StatusException
Throws:
StatusException

oneshotshelve

protected boolean oneshotshelve(ServiceContext serviceContext,
                                AlarmConditionTypeNode condition,
                                ShelvedStateMachineTypeNode stateMachine)
                         throws StatusException
Throws:
StatusException

refreshItem

protected void refreshItem(MonitoredEventItem eventItem)
Specified by:
refreshItem in class EventManager
Parameters:
eventItem -

requireUaNode

protected boolean requireUaNode()
Overrides:
requireUaNode in class ServiceManagerBase

timedshelve

protected boolean timedshelve(ServiceContext serviceContext,
                              AlarmConditionTypeNode condition,
                              ShelvedStateMachineTypeNode stateMachine,
                              double shelvingTime)
                       throws StatusException
Throws:
StatusException

unshelve

protected boolean unshelve(ServiceContext serviceContext,
                           AlarmConditionTypeNode condition,
                           ShelvedStateMachineTypeNode stateMachine)
                    throws StatusException
Throws:
StatusException


Copyright © 2018. All rights reserved.