com.prosysopc.ua.server
Interface CallableListener

All Known Implementing Classes:
EventManager, EventManagerUaNode

public interface CallableListener

Interface for listening method calls from a UaCallable node.

See Also:
UaCallable.addCallListener(CallableListener)

Method Summary
 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[] outputs)
          A method call notification.
 

Method Detail

onCall

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[] outputs)
               throws StatusException
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.

Parameters:
serviceContext -
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.
outputs - 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


Copyright © 2018. All rights reserved.