|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.server.ServiceManagerBase
com.prosysopc.ua.server.IoManager
com.prosysopc.ua.server.IoManagerUaNode
public class IoManagerUaNode
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 extends com.prosysopc.ua.types.opcua.BaseInstanceType>, 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.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 |
|---|
public IoManagerUaNode(NodeManager nodeManager)
| Method Detail |
|---|
public void addNodeListener(UaNode node,
UaNodeIoListener listener)
UaNodeIoListener to the
NodeIoManagerListener.
public void addTypeListener(Class<? extends BaseInstanceType> clazz,
UaTypeIoListener listener)
throws AnnotationException,
org.opcfoundation.ua.common.ServiceResultException
UaTypeIoListener to the TypeIoManagerListener.
AnnotationException
org.opcfoundation.ua.common.ServiceResultException
public void addTypeListener(org.opcfoundation.ua.builtintypes.NodeId typeId,
UaTypeIoListener listener)
UaTypeIoListener to the TypeIoManagerListener.
public IoManagerListener getTypeListener()
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)
throws StatusException
IoManager
readNonValue in class IoManagerserviceContext - 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.
StatusException - If the read fails. Expected result codes: Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_NotReadable, Bad_UserAccessDenied
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
IoManager
readValue in class IoManagerserviceContext - 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.
StatusException - If the read fails. Expected result codes: Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_IndexRangeInvalid, Bad_IndexRangeNoData, Bad_NotReadable,
Bad_UserAccessDeniedprotected boolean requireUaNode()
requireUaNode in class ServiceManagerBase
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
IoManager
writeNonValue in class IoManagerserviceContext - 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.
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
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
IoManager
writeValue in class IoManagerserviceContext - 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.
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||