com.prosysopc.ua.server
Class IoManagerUaNode

java.lang.Object
  extended by com.prosysopc.ua.server.ServiceManagerBase
      extended by com.prosysopc.ua.server.IoManager
          extended by com.prosysopc.ua.server.IoManagerUaNode

public class IoManagerUaNode
extends IoManager

UaNode-based IO Manager. Implements the read and write services to simply read or write attribute values from UaNodes. Type-specific listeners can be added with addTypeListener(java.lang.Class, com.prosysopc.ua.server.io.UaTypeIoListener).

Calls UaNode.readAttribute(UnsignedInteger, DataValue, java.util.Locale) and UaNode.writeAttribute(UnsignedInteger, DataValue).

Expects that all nodes are implemented as UaNode objects. If you wish to use a node manager that accepts also custom node access without UaNode implementations, override requireUaNode() to return false and override the service methods to call this class (super from your inherited class) for only those nodes that actually do have a UaNode.


Constructor Summary
IoManagerUaNode(NodeManager nodeManager)
           
 
Method Summary
 void addNodeListener(UaNode node, UaNodeIoListener listener)
          Add UaNodeIoListener to the NodeIoManagerListener.
 void addTypeListener(Class<? extends BaseInstanceType> clazz, UaTypeIoListener listener)
          Add UaTypeIoListener to the TypeIoManagerListener.
 void addTypeListener(org.opcfoundation.ua.builtintypes.NodeId typeId, UaTypeIoListener listener)
          Add UaTypeIoListener to the TypeIoManagerListener.
 IoManagerListener getTypeListener()
          Get TypeIoManagerListener.
protected  void readNonValue(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Read the value of a node attribute, except for the Value of a variable node.
protected  void readValue(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaValueNode node, org.opcfoundation.ua.utils.NumericRange indexRange, org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn, org.opcfoundation.ua.builtintypes.DateTime minTimestamp, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Read the Value attribute of a Variable node.
protected  boolean requireUaNode()
           
protected  boolean writeNonValue(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Write the value of a single node attribute, except for the Value of a variable node.
protected  boolean writeValue(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaValueNode node, org.opcfoundation.ua.utils.NumericRange indexRange, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Write the Value attribute of a Variable node.
 
Methods inherited from class com.prosysopc.ua.server.IoManager
addListeners, addNodeListener, applyIndexRangeToReadValue, applyIndexRangeToReadValue, applyIndexRangeToWriteValue, autoConvert, beginRead, beginWrite, checkAccessLevel, checkDataType, checkIndexRange, checkSupportsAttribute, checkWriteMask, endRead, endWrite, getAccessLevel, getDefaultListener, getExecutable, getNodeListener, getNodeManager, getUserAccessLevel, getUserExecutable, getUserWriteMask, getVariableDataType, getWriteMask, initializeMonitoredDataItem, readAttribute, readAttribute, removeListeners, setListeners, validateIndexRange, writeAttribute, writeAttribute
 
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

IoManagerUaNode

public IoManagerUaNode(NodeManager nodeManager)
Method Detail

addNodeListener

public void addNodeListener(UaNode node,
                            UaNodeIoListener listener)
Add UaNodeIoListener to the NodeIoManagerListener.


addTypeListener

public void addTypeListener(Class<? extends BaseInstanceType> clazz,
                            UaTypeIoListener listener)
                     throws AnnotationException,
                            org.opcfoundation.ua.common.ServiceResultException
Add UaTypeIoListener to the TypeIoManagerListener.

Throws:
AnnotationException
org.opcfoundation.ua.common.ServiceResultException

addTypeListener

public void addTypeListener(org.opcfoundation.ua.builtintypes.NodeId typeId,
                            UaTypeIoListener listener)
Add UaTypeIoListener to the TypeIoManagerListener.


getTypeListener

public IoManagerListener getTypeListener()
Get TypeIoManagerListener.


readNonValue

protected void readNonValue(ServiceContext serviceContext,
                            Object operationContext,
                            org.opcfoundation.ua.builtintypes.NodeId nodeId,
                            UaNode node,
                            org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                            org.opcfoundation.ua.builtintypes.DataValue dataValue)
                     throws StatusException
Description copied from class: IoManager
Read the value of a node attribute, except for the Value of a variable node.

Overrides:
readNonValue in class IoManager
Parameters:
serviceContext - The serviceContext of the client connection used to call this service.
operationContext - the possible operationContext prepared in IoManager.beginRead(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.ReadValueId[], org.opcfoundation.ua.core.TimestampsToReturn, org.opcfoundation.ua.builtintypes.DateTime, org.opcfoundation.ua.builtintypes.DataValue[], org.opcfoundation.ua.builtintypes.DiagnosticInfo[])
nodeId - The node to read.
node - The node object to read. If the node is not available this may be null.
attributeId - The attribute to read.
dataValue - The data value to return. You only need to set Value of the DataValue.
Throws:
StatusException - If the read fails. Expected result codes: Bad_NodeIdInvalid, Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_NotReadable, Bad_UserAccessDenied

readValue

protected void readValue(ServiceContext serviceContext,
                         Object operationContext,
                         org.opcfoundation.ua.builtintypes.NodeId nodeId,
                         UaValueNode node,
                         org.opcfoundation.ua.utils.NumericRange indexRange,
                         org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
                         org.opcfoundation.ua.builtintypes.DateTime minTimestamp,
                         org.opcfoundation.ua.builtintypes.DataValue dataValue)
                  throws StatusException
Description copied from class: IoManager
Read the Value attribute of a Variable node.

Overrides:
readValue in class IoManager
Parameters:
serviceContext - The serviceContext of the client connection used to call this service.
operationContext - the possible operationContext prepared in IoManager.beginRead(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.ReadValueId[], org.opcfoundation.ua.core.TimestampsToReturn, org.opcfoundation.ua.builtintypes.DateTime, org.opcfoundation.ua.builtintypes.DataValue[], org.opcfoundation.ua.builtintypes.DiagnosticInfo[])
nodeId - The node to read.
node - The node object to read. If the node is not available this may be null.
indexRange - The requested index range for an array value. May be null.
timestampsToReturn - Which timestamps were requested by the client.
minTimestamp - Minimum value of the ServerTimestamp of the value to be read. If there is no value available that is new enough already available (in the server cache), the server should attempt to read a new value from the actual data source, instead of using the cached value. If a new value cannot be read, the best value available is returned. If minTimestamp == DateTime.MAX_VALUE a new value should be read from the source.
dataValue - The data value to return. Set Value, and for Value attribute also StatusCode and the Timestamps.
Throws:
StatusException - If the read fails. Expected result codes: Bad_NodeIdInvalid, Bad_NodeIdUnknown, Bad_IndexRangeInvalid, Bad_IndexRangeNoData, Bad_NotReadable, Bad_UserAccessDenied

requireUaNode

protected boolean requireUaNode()
Overrides:
requireUaNode in class ServiceManagerBase

writeNonValue

protected boolean writeNonValue(ServiceContext serviceContext,
                                Object operationContext,
                                org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                UaNode node,
                                org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                org.opcfoundation.ua.builtintypes.DataValue dataValue)
                         throws StatusException
Description copied from class: IoManager
Write the value of a single node attribute, except for the Value of a variable node.

Overrides:
writeNonValue in class IoManager
Parameters:
serviceContext - The serviceContext of the client connection used to call this service.
nodeId - The node to write.
node - The node object to write. If the node is not available this may be null.
attributeId - The attribute to write.
dataValue - The data value to write.
Throws:
StatusException - If the write fails. Expected result codes: Bad_NodeIdInvalid, Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData, Bad_DataEncodingInvalid, Bad_DataEncodingUnsupported, Bad_NotWriteable, Bad_UserAccessDenied, Bad_TypeMismatch

writeValue

protected boolean writeValue(ServiceContext serviceContext,
                             Object operationContext,
                             org.opcfoundation.ua.builtintypes.NodeId nodeId,
                             UaValueNode node,
                             org.opcfoundation.ua.utils.NumericRange indexRange,
                             org.opcfoundation.ua.builtintypes.DataValue dataValue)
                      throws StatusException
Description copied from class: IoManager
Write the Value attribute of a Variable node.

Overrides:
writeValue in class IoManager
Parameters:
serviceContext - The serviceContext of the client connection used to call this service.
operationContext - the possible operationContext prepared in IoManager.beginWrite(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.WriteValue[], org.opcfoundation.ua.builtintypes.StatusCode[], org.opcfoundation.ua.builtintypes.DiagnosticInfo[])
nodeId - The node to write.
node - The node object to write. If the node is not available this may be null.
indexRange - The index range to set for an array value. May be null.
dataValue - The data value to write.
Throws:
StatusException - If the write fails. Expected result codes: Bad_NodeIdInvalid, Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData, Bad_DataEncodingInvalid, Bad_DataEncodingUnsupported, Bad_NotWriteable, Bad_UserAccessDenied, Bad_OutOfRange, Bad_TypeMismatch, Bad_WriteNotSupported


Copyright © 2018. All rights reserved.