public class IoManager extends ServiceManagerBase
The base implementation defines the default constructor which requires a NodeManager, which the IO Manager will use to find the nodes that the operations refer to.
By default the operations just call the respective methods in IoManagerListeners.
Node-specific listeners can be added with addNodeListener(com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.server.io.UaNodeIoListener).
| Constructor and Description |
|---|
IoManager(NodeManager nodeManager)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListeners(IoManagerListener... listeners)
Add listeners to the
IoManagerListenerChain. |
void |
addNodeListener(NodeId nodeId,
UaNodeIoListener listener)
Add
UaNodeIoListener to the NodeIoManagerListener. |
static void |
applyIndexRangeToReadValue(DataValue dataValue,
NumericRange indexRange)
"Cuts" the specified indexRange out of the provided dataValue.
|
static DataValue |
applyIndexRangeToWriteValue(DataValue currentValue,
DataValue newValue,
NumericRange indexRange)
Writes the newValue to currentValue in the location specified by the indexRange.
|
Variant |
autoConvert(Variant value,
NodeId dataTypeId)
Method for converting UA ByteString DataType to Java UnsignedByte[] type.
|
protected Object |
beginRead(ServiceContext serviceContext,
ReadValueId[] nodesToRead,
TimestampsToReturn timestampsToReturn,
DateTime minTimestamp,
DataValue[] results,
DiagnosticInfo[] diagnosticInfos)
Called to notify that a Read is beginning.
|
protected Object |
beginWrite(ServiceContext serviceContext,
WriteValue[] nodesToWrite,
StatusCode[] results,
DiagnosticInfo[] diagnosticInfos)
Called to notify that a Write is beginning.
|
protected void |
checkAccessLevel(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaVariable variable,
AccessLevelType.Options accessLevel)
Validate that the node enables access for a certain accessLevel.
|
protected void |
checkDataType(NodeId nodeId,
UaValueNode valueNode,
DataValue dataValue)
Checks the Variant within the DataValue can be applied to the given node.
|
protected void |
checkExecutable(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaMethod method)
Validate that the (method) node is Executable for the user.
|
protected static void |
checkIndexRange(Object value,
NumericRange indexRange,
int dimension) |
protected void |
checkSupportsAttribute(ServiceContext serviceContext,
NodeId nodeId,
UaNode node,
UnsignedInteger attributeId)
Checks the given node supports the given Attribute.
|
protected void |
checkWriteMask(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaNode node,
UnsignedInteger attributeId)
Checks the given node has the specified Attribute as writeable.
|
protected void |
endRead(ServiceContext serviceContext,
Object object,
ReadValueId[] nodesToRead,
TimestampsToReturn timestampsToReturn,
DateTime minTimestamp,
DataValue[] results,
DiagnosticInfo[] diagnosticInfos)
Called to notify the end of a Read.
|
protected void |
endWrite(ServiceContext serviceContext,
Object object,
WriteValue[] nodesToWrite,
StatusCode[] results,
DiagnosticInfo[] diagnosticInfos)
Called to notify the end of a Write.
|
protected AccessLevelType |
getAccessLevel(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaVariable variable)
Returns the AccessLevel Attribute value of the given node.
|
IoManagerListener |
getDefaultListener()
Get the default
IoManagerListener. |
protected boolean |
getExecutable(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaMethod node)
Returns the Executable Attribute value of the given node.
|
IoManagerListener |
getNodeListener()
|
NodeManager |
getNodeManager()
Returns the
NodeManager for which this IoManager handles IO. |
protected AccessLevelType |
getUserAccessLevel(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaVariable node)
Returns the UserAccessLevel Attribute value of the given node.
|
protected boolean |
getUserExecutable(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaMethod node)
Returns the UserExecutable Attribute value of the given node.
|
protected AttributeWriteMask |
getUserWriteMask(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaNode node)
Returns the UserWriteMask Attribute value of the given node.
|
protected NodeId |
getVariableDataType(NodeId nodeId,
UaValueNode valueNode)
Returns DataType Attribute value for the given node.
|
protected AttributeWriteMask |
getWriteMask(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaNode node)
Returns the WriteMask Attribute value of the given node.
|
protected void |
initializeMonitoredDataItem(ServiceContext serviceContext,
MonitoredDataItem monitoredItem,
DataValue dataValue)
Get the initial value for a new MonitoredDataItem.
|
DataValue |
readAttribute(NodeId nodeId,
UnsignedInteger attributeId,
NumericRange indexRange,
DateTime minTimestamp)
Read attribute directly from this IoManager.
|
protected void |
readAttribute(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UnsignedInteger attributeId,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn,
DateTime minTimestamp,
DataValue dataValue)
Read the value of a single node attribute.
|
protected void |
readNonValue(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaNode node,
UnsignedInteger attributeId,
DataValue dataValue)
Read the value of a node attribute, except for the Value of a variable node.
|
protected void |
readValue(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaValueNode variable,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn,
DateTime minTimestamp,
DataValue dataValue)
Read the Value attribute of a Variable node.
|
void |
removeListeners(IoManagerListener... listeners)
Remove given listeners from the
IoManagerListenerChain. |
void |
setListeners(IoManagerListener... listeners)
Set the listeners of the
IoManagerListenerChain. |
protected static void |
validateIndexRange(int dim,
int length,
NumericRange indexRange) |
void |
writeAttribute(NodeId nodeId,
UnsignedInteger attributeId,
NumericRange indexRange,
DataValue dataValue)
Write the value of a single node attribute.
|
protected boolean |
writeAttribute(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UnsignedInteger attributeId,
NumericRange indexRange,
DataValue dataValue)
Write the value of a single node attribute.
|
protected boolean |
writeNonValue(ServiceContext serviceContext,
Object operationContext,
NodeId nodeId,
UaNode node,
UnsignedInteger attributeId,
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,
NodeId nodeId,
UaValueNode valueNode,
NumericRange indexRange,
DataValue dataValue)
Write the Value attribute of a Variable node.
|
arrayDimensionsMatch, checkIsMethod, checkIsValueNode, checkIsVariable, checkIsVariableOrVariableType, dataTypeEquals, getNode, getNode, getNode, getNode, getNodeManagerTable, getServer, getSubscriptionManager, invalidatePreviousNodeCache, isValueNode, isVariable, listenerError, requireUaNodepublic IoManager(NodeManager nodeManager)
nodeManager - the NodeManager to which this IO Manager is attached to.public static void applyIndexRangeToReadValue(DataValue dataValue, NumericRange indexRange) throws StatusException
dataValue - the original value, which is modified by the method, unless the status is bad,
in which case the range is ignoredindexRange - the index range to cut out of the value: if null or empty, the method will
not modify the valueStatusException - Bad_IndexRangeNoData, if the index range cannot be applied to the valuepublic static DataValue applyIndexRangeToWriteValue(DataValue currentValue, DataValue newValue, NumericRange indexRange) throws StatusException
currentValue - the current value to modify.newValue - the new value to write: if not a string or array, the method will return the
value unmodifiedindexRange - the range where to write the newValue: if null or empty, the method will
return the value unmodifiedStatusException - Bad_IndexRangeNoData if the range cannot be applied to currentValueprotected static void checkIndexRange(Object value, NumericRange indexRange, int dimension) throws StatusException
StatusExceptionprotected static void validateIndexRange(int dim,
int length,
NumericRange indexRange)
throws StatusException
StatusExceptionpublic void addListeners(IoManagerListener... listeners)
IoManagerListenerChain.public void addNodeListener(NodeId nodeId, UaNodeIoListener listener)
UaNodeIoListener to the NodeIoManagerListener.public final Variant autoConvert(Variant value, NodeId dataTypeId)
value - Variant to convert.dataTypeId - The target type for conversion.public IoManagerListener getDefaultListener()
IoManagerListener. This should be the last listener in the
IoManagerListenerChain to provide default return values.public IoManagerListener getNodeListener()
public NodeManager getNodeManager()
NodeManager for which this IoManager handles IO. This is the same
manager given in constructor.public DataValue readAttribute(NodeId nodeId, UnsignedInteger attributeId, NumericRange indexRange, DateTime minTimestamp) throws StatusException
nodeId - The node to read.attributeId - The attribute to read.indexRange - The requested index range for an array value. May be null.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.StatusException - If the read fails. Expected result codes: Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_NotReadable, Bad_UserAccessDeniedpublic void removeListeners(IoManagerListener... listeners)
IoManagerListenerChain.public void setListeners(IoManagerListener... listeners)
IoManagerListenerChain. Typically the last one is the default
getDefaultListener(). Node-specific listener getNodeListener() and
type-specific listener IoManagerUaNode.getTypeListener() can be used too.public void writeAttribute(NodeId nodeId, UnsignedInteger attributeId, NumericRange indexRange, DataValue dataValue) throws StatusException
nodeId - The node to write.attributeId - The attribute to write.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_TypeMismatchprotected Object beginRead(ServiceContext serviceContext, ReadValueId[] nodesToRead, TimestampsToReturn timestampsToReturn, DateTime minTimestamp, DataValue[] results, DiagnosticInfo[] diagnosticInfos) throws ServiceException
readValue(com.prosysopc.ua.server.ServiceContext, java.lang.Object, com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.nodes.UaValueNode, com.prosysopc.ua.stack.utils.NumericRange, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DataValue) and
readNonValue(com.prosysopc.ua.server.ServiceContext, java.lang.Object, com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.nodes.UaNode, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, com.prosysopc.ua.stack.builtintypes.DataValue) handlers. Alternatively, you may define all the results here.
If you return a result object, it will be provided in endRead(com.prosysopc.ua.server.ServiceContext, java.lang.Object, com.prosysopc.ua.stack.core.ReadValueId[], com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DataValue[], com.prosysopc.ua.stack.builtintypes.DiagnosticInfo[]), where you can dispose
it.
serviceContext - the client service call contextnodesToRead - the nodes to be read. Note: The call may contain read requests for
several node managers, so if you handle the nodes here, check the namespace of the
requested items.timestampsToReturn - defines whether Server, Source or Both timestamps should be returned
with every value. Neither is not a valid value (checked already before calling the
method)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.results - the array of results, which you may fill here or later in the specific read
methodsdiagnosticInfos - possible error diagnosticsServiceException - if you need to return a service call errorprotected Object beginWrite(ServiceContext serviceContext, WriteValue[] nodesToWrite, StatusCode[] results, DiagnosticInfo[] diagnosticInfos) throws ServiceException
writeValue(com.prosysopc.ua.server.ServiceContext, java.lang.Object, com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.nodes.UaValueNode, com.prosysopc.ua.stack.utils.NumericRange, com.prosysopc.ua.stack.builtintypes.DataValue) and
writeNonValue(com.prosysopc.ua.server.ServiceContext, java.lang.Object, com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.nodes.UaNode, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, com.prosysopc.ua.stack.builtintypes.DataValue) handlers. Alternatively, you may define all the results here and ignore
them in the specific methods.
If you return a result object, it will be provided in endWrite(com.prosysopc.ua.server.ServiceContext, java.lang.Object, com.prosysopc.ua.stack.core.WriteValue[], com.prosysopc.ua.stack.builtintypes.StatusCode[], com.prosysopc.ua.stack.builtintypes.DiagnosticInfo[]), where you can dispose
it.
serviceContext - the client service call contextnodesToWrite - the nodes to be read. Note: The call may contain read requests for
several node managers, so if you handle the nodes here, check the namespace of the
requested items.results - the array of results, which you may fill here or later in the specific write
methodsdiagnosticInfos - possible error diagnosticsServiceException - if you need to return a service call errorprotected void checkAccessLevel(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaVariable variable, AccessLevelType.Options accessLevel) throws StatusException
StatusExceptionprotected void checkDataType(NodeId nodeId, UaValueNode valueNode, DataValue dataValue) throws StatusException
ServiceManagerBase.dataTypeEquals(Variant, NodeId) and
autoConvert(Variant, NodeId).StatusExceptionprotected void checkExecutable(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaMethod method) throws StatusException
serviceContext - the service context (i.e. user)operationContext - possible operation contextmethodId - NodeId of the Method nodemethod - UaNode of the Method node (can be null)StatusException - if the user cannot execute the Methodprotected void checkSupportsAttribute(ServiceContext serviceContext, NodeId nodeId, UaNode node, UnsignedInteger attributeId) throws StatusException
StatusExceptionprotected void checkWriteMask(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaNode node, UnsignedInteger attributeId) throws StatusException
StatusExceptionprotected void endRead(ServiceContext serviceContext, Object object, ReadValueId[] nodesToRead, TimestampsToReturn timestampsToReturn, DateTime minTimestamp, DataValue[] results, DiagnosticInfo[] diagnosticInfos) throws ServiceException
beginRead(com.prosysopc.ua.server.ServiceContext, com.prosysopc.ua.stack.core.ReadValueId[], com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DataValue[], com.prosysopc.ua.stack.builtintypes.DiagnosticInfo[])
here.serviceContext - the client service call contextnodesToRead - the nodes to be readtimestampsToReturn - defines whether Server, Source or Both timestamps should be returned
with every value. Neither is not a valid value (checked already before calling the
method)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.results - the array of resultsdiagnosticInfos - possible error diagnosticsServiceException - if you need to return a service call errorprotected void endWrite(ServiceContext serviceContext, Object object, WriteValue[] nodesToWrite, StatusCode[] results, DiagnosticInfo[] diagnosticInfos) throws ServiceException
beginWrite(com.prosysopc.ua.server.ServiceContext, com.prosysopc.ua.stack.core.WriteValue[], com.prosysopc.ua.stack.builtintypes.StatusCode[], com.prosysopc.ua.stack.builtintypes.DiagnosticInfo[]) here.serviceContext - the client service call contextnodesToWrite - the nodes to be writtenresults - the array of resultsdiagnosticInfos - possible error diagnosticsServiceException - if you need to return a service call errorprotected AccessLevelType getAccessLevel(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaVariable variable) throws StatusException
StatusExceptionprotected boolean getExecutable(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaMethod node) throws StatusException
StatusExceptionprotected AccessLevelType getUserAccessLevel(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaVariable node)
IoManagerListener to this IoManager. The Attribute
value is user-specific.protected boolean getUserExecutable(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaMethod node)
IoManagerListener to this IoManager. The Attribute value is
user-specific.protected AttributeWriteMask getUserWriteMask(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaNode node)
IoManagerListener to this IoManager. The Attribute value is
user-specific.protected NodeId getVariableDataType(NodeId nodeId, UaValueNode valueNode) throws StatusException
StatusExceptionprotected AttributeWriteMask getWriteMask(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaNode node) throws StatusException
StatusExceptionprotected void initializeMonitoredDataItem(ServiceContext serviceContext, MonitoredDataItem monitoredItem, DataValue dataValue) throws StatusException
The initial value is required for CreateMonitoredItem, ModifyMonitoredItem or TransferSubscription.
serviceContext - The serviceContext of the client connection used to call the
CreateMonitoredItem, ModifyMonitoredItem or TransferSubscription service that initiates
the call. Note that the RequestHeader part of the ServiceContext may be set to null in
the object.monitoredItem - The new monitoredItem that needs the initial valuedataValue - The value that should be initialized to the initial value of the item. The
value is by default Bad_WaitingForInitialData, unless changed here.StatusException - If the value is not available or may not be read due to access level
restrictions, for example.protected void readAttribute(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UnsignedInteger attributeId, NumericRange indexRange, TimestampsToReturn timestampsToReturn, DateTime minTimestamp, DataValue dataValue) throws StatusException
If the Value attribute is to be read, the method uses
#checkAccessLevel(ServiceContext, NodeId, UaVariable, AccessLevel) to validate that the
user has read access to the value. If the read is acceptable, it will call
#readValue(ServiceContext, NodeId, UaVariable, NumericRange, TimestampsToReturn, DateTime, DataValue)
to do the read and finally, it will trigger the onRead event in the listener.
For other attributes,
#readNonValue(ServiceContext, NodeId, UaNode, UnsignedInteger, DataValue) is used to
read the attribute value, except for the User-attributes for which
#getUserAccessLevel(ServiceContext, NodeId, UaVariable),
#getUserExecutable(ServiceContext, NodeId, UaMethod) or
#getUserWriteMask(ServiceContext, NodeId, UaNode) are used, respectively, to define the
correct value. By default, these methods just ask the value from the listener.
Typically, you will just need to override readValue and readNonValue to create your custom
IoManager. If you use IoManagerUaNode, it will simply read the attributes from the node
objects, by default.
serviceContext - The serviceContext of the client connection used to call this service.operationContext - the possible operationContext prepared in beginRead(com.prosysopc.ua.server.ServiceContext, com.prosysopc.ua.stack.core.ReadValueId[], com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DataValue[], com.prosysopc.ua.stack.builtintypes.DiagnosticInfo[])nodeId - The node to read.attributeId - The attribute to read.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_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_NotReadable, Bad_UserAccessDeniedprotected void readNonValue(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaNode node, UnsignedInteger attributeId, DataValue dataValue) throws StatusException
serviceContext - The serviceContext of the client connection used to call this service.operationContext - the possible operationContext prepared in beginRead(com.prosysopc.ua.server.ServiceContext, com.prosysopc.ua.stack.core.ReadValueId[], com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DataValue[], com.prosysopc.ua.stack.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_UserAccessDeniedprotected void readValue(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaValueNode variable, NumericRange indexRange, TimestampsToReturn timestampsToReturn, DateTime minTimestamp, DataValue dataValue) throws StatusException
serviceContext - The serviceContext of the client connection used to call this service.operationContext - the possible operationContext prepared in beginRead(com.prosysopc.ua.server.ServiceContext, com.prosysopc.ua.stack.core.ReadValueId[], com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DataValue[], com.prosysopc.ua.stack.builtintypes.DiagnosticInfo[])nodeId - The node to read.variable - 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 writeAttribute(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UnsignedInteger attributeId, NumericRange indexRange, DataValue dataValue) throws StatusException
The method uses #checkAccessLevel(ServiceContext, NodeId, UaVariable, AccessLevel) ,
checkSupportsAttribute(ServiceContext, NodeId, UaNode, UnsignedInteger) and
#checkWriteMask(ServiceContext, NodeId, UaNode, UnsignedInteger) methods to validate if
write is accepted. Override these methods, instead of this method, to provide your custom
checks.
If write is acceptable, it will also notify the listener about the write. Unless the listener
cancels the write, it will finally call
#writeValue(ServiceContext, NodeId, UaVariable, NumericRange, DataValue) or
#writeNonValue(ServiceContext, NodeId, UaNode, UnsignedInteger, DataValue) to do the
actual write. The default implementation does nothing, so you must override that. Or if you are
actually using IoManagerUaNode, it will write the attribute value to a UaNode
object.
serviceContext - The serviceContext of the client connection used to call this service.operationContext - The possible operationContext prepared in beginWrite(com.prosysopc.ua.server.ServiceContext, com.prosysopc.ua.stack.core.WriteValue[], com.prosysopc.ua.stack.builtintypes.StatusCode[], com.prosysopc.ua.stack.builtintypes.DiagnosticInfo[]).nodeId - The node to write.attributeId - The attribute to write.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_TypeMismatchprotected boolean writeNonValue(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaNode node, UnsignedInteger attributeId, DataValue dataValue) throws StatusException
serviceContext - The serviceContext of the client connection used to call this service.operationContext - The user-provided context object returned in
beginWrite(ServiceContext, WriteValue[], StatusCode[], DiagnosticInfo[]). Is
null if none returned.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_TypeMismatchprotected boolean writeValue(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaValueNode valueNode, NumericRange indexRange, DataValue dataValue) throws StatusException
serviceContext - The serviceContext of the client connection used to call this service.operationContext - The possible operationContext prepared in beginWrite(com.prosysopc.ua.server.ServiceContext, com.prosysopc.ua.stack.core.WriteValue[], com.prosysopc.ua.stack.builtintypes.StatusCode[], com.prosysopc.ua.stack.builtintypes.DiagnosticInfo[]).nodeId - The node to write.valueNode - 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_WriteNotSupportedCopyright © 2026. All rights reserved.