public class UaClient extends UaApplication
connect() to the server, and start communications. You can check the Status
of the server, or addServerStatusListener(ServerStatusListener) to monitor changes in
the quality of the connection.
For communications, you can use the various read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) and write(com.prosysopc.ua.stack.core.WriteValue...) methods, or
addSubscription(com.prosysopc.ua.client.Subscription) to monitor server data changes or notifications.
You can also call(com.prosysopc.ua.stack.core.CallMethodRequest...) server methods.
Note: although the class is not declared as final, it is not really designed for inheritance.UaApplication.DiagnosticMask, UaApplication.Protocol| Modifier and Type | Field and Description |
|---|---|
static Double |
MAX_CACHE_AGE
Maximum possible value for
setDefaultMaxAge(double), based on the Read service
call definitions. |
| Constructor and Description |
|---|
UaClient()
Create a new server connection.
|
UaClient(String address)
Create a server connection using the given server connection address.
|
UaClient(UaAddress address)
Create a server connection using the given server connection address.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addServerStatusListener(ServerStatusListener serverStatusListener)
Add a new listener for the ServerStatus events.
|
Subscription |
addSubscription(Subscription subscription)
Create a new subscription and add it to Subscriptions.
|
protected void |
addSubscriptionAck(SubscriptionAcknowledgement ack) |
CallResponse |
call(CallMethodRequest... MethodsToCall)
Call several methods at once.
|
Variant[] |
call(NodeId objectId,
NodeId methodId,
Variant... inputArguments)
Call a method in the server.
|
AsyncResult<CallResponse> |
callAsync(CallMethodRequest... methodsToCall)
Call several methods asynchronously.
|
void |
connect()
Connect to the OPC UA server.
|
void |
disconnect()
Disconnect from the server.
|
void |
disconnect(long timeout)
Disconnect from the server.
|
void |
disconnect(long timeout,
TimeUnit timeUnit) |
void |
disconnect(UnsignedInteger timeout)
Disconnect from the server.
|
EndpointDescription[] |
discoverEndpoints()
Find the list of server end-points corresponding to
getProtocol(). |
EndpointDescription[] |
discoverEndpoints(UaApplication.Protocol... protocols)
Find the list of server end-points corresponding to the defined protocols.
|
OperationLimits |
getActualOperationLimits()
Returns the actual operation limits i.e.
|
int |
getActualPublishRequestSetpoint() |
UaAddress |
getAddress()
Returns the connection address of the OPC UA server.
|
AddressSpace |
getAddressSpace()
AddressSpace object used for browsing the addres space of the server and for using the View
services.
|
ApplicationIdentity |
getApplicationIdentity()
The identity information of your OPC UA client application.
|
String |
getAuditEntryId()
Audit entry to include in service calls.
|
static Set<StatusCode> |
getCommErrorCodes()
Returns a Set of StatusCodes that indicate a communication error between the Client and the
Server when checking Server status and communication error filtering has been enabled with
setCommunicationErrorFilteringEnabled or when handling
PublishResponse errors. |
int |
getConnectTimeout()
Connection timeout in milliseconds.
|
double |
getDefaultMaxAge()
Get the default maxAge parameter used in Reads when none specified.
|
static UaApplication.Protocol |
getDefaultProtocol()
The default protocol to use for URI, if none is defined in #setUri()
|
TimestampsToReturn |
getDefaultTimestampsToReturn()
Get the default timestampsToReturn parameter used in Reads when none is specified
|
EncoderContext |
getEncoderContext() |
EndpointDescription |
getEndpoint()
The server endpoint that is used.
|
EndpointConfiguration |
getEndpointConfiguration()
Configuration parameters for the channel and endpoint.
|
String |
getHost()
Deprecated.
use
getAddress() and UaAddress.getHost() |
protected HttpsSecurityPolicy[] |
getHttpsSecurityPolicies()
The TLS security policies used for HTTPS communications.
|
HttpsSettings |
getHttpsSettings() |
DiagnosticInfo[] |
getLastOperationDiagnostics()
The operation level diagnostic information related to the last service call.
|
DateTime |
getLastResponseTimestamp()
The timestamps of the response message of the last service call.
|
DiagnosticInfo |
getLastServiceDiagnostics()
The service level diagnostic information related to the last service call.
|
StatusCode |
getLastServiceResult() |
UaClientListener |
getListener() |
Locale |
getLocale()
The currently defined user locale.
|
UnsignedInteger |
getMaxResponseMessageSize() |
NamespaceTable |
getNamespaceTable()
The server NamespaceTable.
|
NamespaceTable |
getNamespaceTable(boolean forceRefresh)
The server NamespaceTable.
|
EnumSet<UaApplication.DiagnosticMask> |
getOperationDiagnosticMask()
The currently requested operation diagnostics.
|
int |
getPort()
Deprecated.
use
getAddress() and UaAddress.getPort() |
UaApplication.Protocol |
getProtocol()
Deprecated.
use
getAddress() and UaAddress.getProtocol() |
double |
getPublishRequestFactor() |
int |
getPublishRequestSetpoint()
The current target of PublishRequests to send to the server.
|
UnsignedInteger |
getPublishRequestTimeout() |
UaAddress |
getReverseAddress() |
ReverseConnectionListener |
getReverseConnectionListener() |
SecureChannel |
getSecureChannel() |
SecurityMode |
getSecurityMode() |
ApplicationIdentity |
getServerIdentity() |
String |
getServerName()
Deprecated.
|
ServerState |
getServerState()
The current state of the server.
|
ServerStatusDataType |
getServerStatus()
The status of the server that we are connected.
|
StatusCode |
getServerStatusError()
In case the monitoring of Server Status fails, the related error code is available from here.
|
ServerTable |
getServerTable()
Returns the server's ServerTable (from node
VariableIdentifiers.Server_ServerArray). |
ServerTable |
getServerTable(boolean forceRefresh)
The server ServerTable.
|
long |
getServerTimeDifference()
The current time difference between the server and the client.
|
EnumSet<UaApplication.DiagnosticMask> |
getServiceDiagnosticMask() |
Session |
getSession()
The current session.
|
String |
getSessionName() |
double |
getSessionTimeout() |
TcpConnection.SocketFactory |
getSocketFactory()
Returns the
TcpConnection.SocketFactory previously set via #setSocketFactory(SocketFactory). |
long |
getStatusCheckInterval() |
long |
getStatusCheckTimeout()
The timeout used for Server Status reads in
updateServerStatus() |
Subscription |
getSubscription(int index)
Get a subscription by index.
|
Subscription |
getSubscriptionById(UnsignedInteger subscriptionId)
Get a subscription with the subscription ID specified by the server.
|
int |
getSubscriptionCount()
Number of defined subscriptions.
|
Subscription[] |
getSubscriptions()
Get subscriptions.
|
List<SecurityMode> |
getSupportedSecurityModes()
Get a list of security modes supported by the server.
|
UserTokenPolicy[] |
getSupportedUserIdentityTokens()
Find out the user identity types supported by the server.
|
int |
getTimeout()
The default communication request timeout.
|
TypeDictionary |
getTypeDictionary()
Returns a
TypeDictionary that can be used to parse unknown Structures. |
String |
getUri()
Deprecated.
use
getAddress() and UaAddress.getAddress() |
UserIdentity |
getUserIdentity()
The current user identity to use for user authentication.
|
boolean |
hasConnected()
Returns true if a successful
connect() has happened (i.e. |
boolean |
hasConnection()
Best-effort answers to "Are we currently connected to the server?".
|
boolean |
hasServerStatusListener(ServerStatusListener serverStatusListener)
Check if the client already has the specified server status listener.
|
boolean |
hasSubscription(UnsignedInteger subscriptionId)
Checks if the client has a subscription with the specified ID.
|
HistoryUpdateResult |
historyDeleteAtTimes(NodeId nodeId,
DateTime[] reqTimes)
Deletes history at specified times.
|
HistoryUpdateResult |
historyDeleteEvents(NodeId nodeId,
List<ByteString> eventIds)
Deletes specified events from history.
|
HistoryUpdateResult |
historyDeleteModified(NodeId nodeId,
DateTime startTime,
DateTime endTime)
Deletes modified history from a specified interval.
|
HistoryUpdateResult |
historyDeleteRaw(NodeId nodeId,
DateTime startTime,
DateTime endTime)
Deletes raw history from a specified interval.
|
HistoryReadResult[] |
historyRead(HistoryReadDetails details,
TimestampsToReturn timestampsToReturn,
Boolean releaseContinuationPoints,
HistoryReadValueId... nodesToRead)
Read history of nodes.
|
AsyncResult<HistoryReadResponse> |
historyReadAsync(HistoryReadDetails details,
TimestampsToReturn timestampsToReturn,
Boolean releaseContinuationPoints,
HistoryReadValueId... nodesToRead)
Read history of nodes asynchronously.
|
HistoryReadResult[] |
historyReadAtTimes(NodeId[] nodeIds,
DateTime[] reqTimes,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn,
Boolean useSimpleBounds)
Reads history at specified times.
|
DataValue[] |
historyReadAtTimes(NodeId nodeId,
DateTime[] reqTimes,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn)
Reads history at specified times.
|
DataValue[] |
historyReadAtTimes(NodeId nodeId,
DateTime[] reqTimes,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn,
Boolean useSimpleBounds)
Reads history at specified times.
|
HistoryReadResult[] |
historyReadEvents(NodeId[] nodeIds,
DateTime startTime,
DateTime endTime,
UnsignedInteger numValuesPerNode,
EventFilter filter,
TimestampsToReturn timestampsToReturn)
Reads events from history.
|
HistoryEventFieldList[] |
historyReadEvents(NodeId nodeId,
DateTime startTime,
DateTime endTime,
UnsignedInteger numValuesPerNode,
EventFilter filter,
TimestampsToReturn timestampsToReturn)
Reads events from history.
|
HistoryReadResult[] |
historyReadModified(NodeId[] nodeIds,
DateTime startTime,
DateTime endTime,
UnsignedInteger numValuesPerNode,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn)
Reads Modified values from the history.
|
HistoryModifiedData |
historyReadModified(NodeId nodeId,
DateTime startTime,
DateTime endTime,
UnsignedInteger numValuesPerNode,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn)
Reads Modified values from the history.
|
HistoryReadResult[] |
historyReadProcessed(NodeId[] nodeIds,
DateTime startTime,
DateTime endTime,
Double processingInterval,
NodeId aggregateType,
AggregateConfiguration aggregateConfiguration,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn)
Reads processed history data.
|
DataValue[] |
historyReadProcessed(NodeId nodeId,
DateTime startTime,
DateTime endTime,
Double processingInterval,
NodeId aggregateType,
AggregateConfiguration aggregateConfiguration,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn)
Reads processed history data.
|
HistoryReadResult[] |
historyReadRaw(NodeId[] nodeIds,
DateTime startTime,
DateTime endTime,
long numValuesPerNode,
Boolean returnBounds,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn)
Reads raw history data.
|
DataValue[] |
historyReadRaw(NodeId nodeId,
DateTime startTime,
DateTime endTime,
long numValuesPerNode,
Boolean returnBounds,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn)
Reads raw history data.
|
DataValue[] |
historyReadRaw(NodeId nodeId,
DateTime startTime,
DateTime endTime,
UnsignedInteger numValuesPerNode,
Boolean returnBounds,
NumericRange indexRange,
TimestampsToReturn timestampsToReturn)
Reads raw history data.
|
HistoryUpdateResult[] |
historyUpdate(HistoryUpdateDetails... details)
Update history data in the server.
|
AsyncResult<HistoryUpdateResponse> |
historyUpdateAsync(HistoryUpdateDetails... details)
Update history data in the server.
|
HistoryUpdateResult |
historyUpdateData(NodeId nodeId,
PerformUpdateType performInsertReplace,
DataValue[] updateValues)
Updates history data.
|
HistoryUpdateResult |
historyUpdateEvent(NodeId nodeId,
PerformUpdateType performInsertReplace,
EventFilter filter,
HistoryEventFieldList[] eventData)
Updates historical events in the server.
|
HistoryUpdateResult |
historyUpdateStructureData(NodeId nodeId,
PerformUpdateType performInsertReplace,
DataValue[] updateValues)
Updates historical structure data.
|
boolean |
isAutoReconnect()
Automatic reconnection setting.
|
boolean |
isConnected()
Deprecated.
use
hasConnection() or hasConnected() instead. |
boolean |
isInitTypeDictionaryAutoUsage()
Returns true if
TypeDictionary is read automatically when first encountering custom
Structures, unless already initialized at connect as defined by
isInitTypeDictionaryOnConnect(). |
boolean |
isInitTypeDictionaryOnConnect()
Returns true if
TypeDictionary is read automatically, when connecting to the server. |
boolean |
isInitTypeDictionaryShallow()
|
boolean |
isInReverseMode()
Defines whether the client is expecting a Reverse Connection from a server.
|
boolean |
isKeepSubscriptions()
Defines whether subscriptions should be kept in the server after
disconnect(). |
static boolean |
isUseCommErrorCodes()
Returns value set to
setUseCommErrorCodes(boolean). |
boolean |
isValidateCreateSessionResponseCert()
Define whether the client should validate the server certificate received at session creation.
|
boolean |
isValidateDiscoveredEndpoints()
Define whether the client should validate the server endpoints received at session creation
against those returned for
discoverEndpoints(). |
boolean |
isValidateNonceLength()
Define whether the client should validate the length of the nonce received at session creation.
|
ReadResponse |
read(Double maxAge,
TimestampsToReturn timestampsToReturn,
ReadValueId... nodesToRead)
This Service is used to read one or more Attributes of one or more Nodes.
|
AsyncResult<ReadResponse> |
readAsync(Double maxAge,
TimestampsToReturn timestampsToReturn,
ReadValueId... nodesToRead)
Read node attributes from the server asynchronously.
|
DataValue |
readAttribute(ExpandedNodeId nodeId,
UnsignedInteger attributeId)
Reads the value for the specified single node attribute.
|
DataValue |
readAttribute(ExpandedNodeId nodeId,
UnsignedInteger attributeId,
NumericRange indexRange,
Double maxCacheAge)
Reads the value for the specified single node attribute.
|
DataValue |
readAttribute(NodeId nodeId,
UnsignedInteger attributeId)
Reads the value for the specified single node attribute.
|
DataValue |
readAttribute(NodeId nodeId,
UnsignedInteger attributeId,
NumericRange indexRange,
Double maxCacheAge)
Reads the value for the specified single node attribute.
|
DataValue |
readAttribute(UaNodeId nodeId,
UnsignedInteger attributeId)
Reads the value for the specified single node attribute.
|
DataValue |
readAttribute(UaNodeId nodeId,
UnsignedInteger attributeId,
NumericRange indexRange,
Double maxCacheAge)
Reads the value for the specified single node attribute.
|
DataValue[] |
readAttributes(ExpandedNodeId nodeId,
UnsignedInteger... attributeIds)
Read all attributes of a Node.
|
DataValue[] |
readAttributes(ExpandedNodeId nodeId,
UnsignedInteger[] attributeIds,
NumericRange[] indexRanges,
Double maxCacheAge)
Read all attributes of a Node.
|
DataValue[] |
readAttributes(NodeId nodeId,
UnsignedInteger... attributeIds)
Read all attributes of a Node.
|
DataValue[] |
readAttributes(NodeId nodeId,
UnsignedInteger[] attributeIds,
NumericRange[] indexRanges,
Double maxCacheAge)
Read all attributes of a Node.
|
DataValue[] |
readAttributes(UaNodeId nodeId,
UnsignedInteger... attributeIds)
Read all attributes of a Node.
|
DataValue[] |
readAttributes(UaNodeId nodeId,
UnsignedInteger[] attributeIds,
NumericRange[] indexRanges,
Double maxCacheAge)
Read all attributes of a Node.
|
DataValue |
readValue(ExpandedNodeId nodeId)
Reads the value attribute of a node.
|
DataValue |
readValue(ExpandedNodeId nodeId,
Double maxCacheAge)
Reads the value attribute of a node.
|
DataValue |
readValue(ExpandedNodeId nodeId,
NumericRange indexRange)
Reads the value attribute of a node.
|
DataValue |
readValue(ExpandedNodeId nodeId,
NumericRange indexRange,
Double maxCacheAge)
Reads the value attribute of a node.
|
DataValue |
readValue(NodeId nodeId)
Reads the value attribute of a node.
|
DataValue |
readValue(NodeId nodeId,
Double maxCacheAge)
Reads the value attribute of a node.
|
DataValue |
readValue(NodeId nodeId,
NumericRange indexRange)
Reads the value attribute of a node.
|
DataValue |
readValue(NodeId nodeId,
NumericRange indexRange,
Double maxCacheAge)
Reads the value attribute of a node.
|
DataValue |
readValue(UaNodeId nodeId)
Reads the value attribute of a node.
|
DataValue |
readValue(UaNodeId nodeId,
Double maxCacheAge)
Reads the value attribute of a node.
|
DataValue |
readValue(UaNodeId nodeId,
NumericRange indexRange)
Reads the value attribute of a node.
|
DataValue |
readValue(UaNodeId nodeId,
NumericRange indexRange,
Double maxCacheAge)
Reads the value attribute of a node.
|
DataValue[] |
readValues(ExpandedNodeId[] nodeIds)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(ExpandedNodeId[] nodeIds,
NumericRange[] indexRanges)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(ExpandedNodeId[] nodeIds,
NumericRange[] indexRanges,
TimestampsToReturn timestamps)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(ExpandedNodeId[] nodeIds,
NumericRange[] indexRanges,
TimestampsToReturn timestamps,
Double maxCacheAge)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(ExpandedNodeId[] nodeIds,
TimestampsToReturn timestamps)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(NodeId[] nodeIds)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(NodeId[] nodeIds,
NumericRange[] indexRanges)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(NodeId[] nodeIds,
NumericRange[] indexRanges,
TimestampsToReturn timestamps)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(NodeId[] nodeIds,
NumericRange[] indexRanges,
TimestampsToReturn timestamps,
Double maxCacheAge)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(NodeId[] nodeIds,
TimestampsToReturn timestamps)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(UaNodeId[] nodeIds)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(UaNodeId[] nodeIds,
NumericRange[] indexRanges)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(UaNodeId[] nodeIds,
NumericRange[] indexRanges,
TimestampsToReturn timestamps)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(UaNodeId[] nodeIds,
NumericRange[] indexRanges,
TimestampsToReturn timestamps,
Double maxCacheAge)
Reads the value attribute of several nodes at once.
|
DataValue[] |
readValues(UaNodeId[] nodeIds,
TimestampsToReturn timestamps)
Reads the value attribute of several nodes at once.
|
boolean |
reconnect()
Reconnect to the server.
|
void |
registerModel(ClientCodegenModel codegenModel)
Register an information model to use in the application.
|
boolean |
removeServerStatusListener(ServerStatusListener serverStatusListener)
Remove a listener from the ServerStatus events.
|
StatusCode |
removeSubscription(Subscription subscription)
Remove the subscription from Subscriptions.
|
StatusCode[] |
removeSubscriptions(Subscription[] subscriptions)
Remove subscriptions from Subscriptions.
|
AsyncResult<StatusCode[]> |
removeSubscriptionsAsync(Subscription... subscriptions)
Remove subscriptions from Subscriptions, asynchronously.
|
void |
resetEndpoint()
Undefines the Endpoint.
|
protected void |
resetPublishRequestSetpoint()
Resets the setpoint
|
protected void |
resetSubscriptionsAfterRemove(Subscription[] subscriptions,
StatusCode[] result) |
protected UaAddress |
resolveConnectionAddress(UaAddress connectionAddress,
EndpointDescription discoveredEndpoint)
This method is used to resolve the connection address that is used to form the socket
connection to the "actual endpoint" after Discovery has been done (to
getAddress()). |
<T extends ServiceResponse> |
serviceRequest(ServiceRequest<T> request)
Send a custom service request to the server, synchronously.
|
<T extends ServiceResponse> |
serviceRequestAsync(ServiceRequest<T> request)
Send a custom service request to the server, asynchronously.
|
<T extends ServiceResponse> |
sessionlessRequest(ServiceRequest<T> request)
Make a service request to the server over a secure channel.
|
void |
setAddress(String address)
Define the connection address of the OPC UA server as a string.
|
void |
setAddress(UaAddress address)
Define the connection address to the OPC UA server.
|
void |
setApplicationIdentity(ApplicationIdentity applicationIdentity)
Set the security identity of the client application.
|
void |
setAuditEntryId(String auditEntryId)
An identifier that identifies the Client's security audit log entry associated with the
operations requested from the server.
|
void |
setAutoReconnect(boolean doAutoReconnect)
Define automatic reconnection.
|
void |
setConnectTimeout(int connectionTimeoutMilliseconds)
Set initial connection timeout in milliseconds.
|
void |
setConnectTimeout(int value,
TimeUnit timeUnit)
Convenience method for
#setConnectionTimeout(long) taking specific time units. |
void |
setDefaultMaxAge(double defaultMaxAge)
Set the default maxAge parameter to be used in Read calls when none is specified in the method
signature.
|
static void |
setDefaultProtocol(UaApplication.Protocol defaultProtocol)
The default protocol to use for URI, if none is defined in #setUri()
|
void |
setDefaultTimestampsToReturn(TimestampsToReturn defaultTimestampsToReturn)
Set the default TimestampsToReturn parameter to be used in Read calls when none is specified in
the method signature.
|
void |
setEndpoint(EndpointDescription endpoint)
Use the EndpointDescription to select the server endpoint to connect to.
|
protected void |
setHttpsSecurityPolicies(HttpsSecurityPolicy[] httpsSecurityPolicies)
The TLS security policies used for HTTPS communications.
|
void |
setInitTypeDictionaryAutoUsage(boolean initTypeDictionaryAutoUsage)
Controls if
TypeDictionary is initialized automatically, when custom Structures are
encountered for the first time. |
void |
setInitTypeDictionaryOnConnect(boolean initTypeDictionaryOnConnect)
Controls if
TypeDictionary is initialized automatically after connect(). |
void |
setInitTypeDictionaryShallow(boolean initTypeDictionaryShallow)
If set to true,
TypeDictionary will consider it as initialized if it would be
initialized, but doesn't do any of the normal initialization procedures, such as reading the
types of the server. |
void |
setKeepSubscriptions(boolean keepSubscriptions)
Defines that the Subscriptions should be left in the server, when {link disconnect} is called.
|
void |
setListener(UaClientListener listener)
Define the ClientListener to get notifications of client events.
|
void |
setLocale(Locale locale)
Define the user locale, in which all localizable text is requested from the server.
|
void |
setMaxResponseMessageSize(int maxResponseMessageSize)
Define the maximum size, in bytes, for the body of any response message from the server.
|
void |
setMaxResponseMessageSize(UnsignedInteger maxResponseMessageSize)
Define the maximum size, in bytes, for the body of any response message from the server.
|
void |
setOperationDiagnosticMask(EnumSet<UaApplication.DiagnosticMask> operationDiagnosticMask)
Define the operational level diagnostic info to return for the service calls.
|
void |
setPublishRequestFactor(double publishRequestFactor)
The factor is used to calculate the number of pending publish requests we are trying to keep
open in the server all the time.
|
void |
setPublishRequestSetpoint(int publishRequestSetpoint)
Define the target number of PublishRequests to send to the server.
|
void |
setPublishRequestTimeout(long publishRequestTimeout)
Define the timeout used for PublishRequests.
|
void |
setPublishRequestTimeout(long publishRequestTimeout,
TimeUnit timeUnit)
/** Define the timeout used for PublishRequests using a specific TimeUnit.
|
void |
setPublishRequestTimeout(UnsignedInteger publishRequestTimeout)
Define the timeout used for PublishRequests.
|
void |
setReverseAddress(UaAddress clientListenAddress)
Defines a client-side socket address for an OPC UA Reverse Connection.
|
void |
setReverseConnectionListener(ReverseConnectionListener reverseConnectionListener)
Set a reverse connection listener that can be used to validate that the incoming calls are
coming from an expected server.
|
void |
setReversePort(int port)
Convenience method for defining the Reverse Connection with a specific port number on every
network interface.
|
void |
setSecurityMode(SecurityMode securityMode)
Define the security mode to connect to.
|
void |
setServiceDiagnosticMask(EnumSet<UaApplication.DiagnosticMask> serviceDiagnosticMask)
Define the service level diagnostic info to return for the service calls.
|
void |
setSessionName(String sessionName)
Define a name for the session.
|
void |
setSessionTimeout(double sessionTimeout)
Set the requested session timeout.
|
void |
setSessionTimeout(long sessionTimeout,
TimeUnit timeUnit) |
void |
setSocketFactory(TcpConnection.SocketFactory socketFactory)
This can be used to override the
TcpConnection.DefaultSocketFactory used by
TcpConnection.getSocketFactory() for opc.tcp connections (during connect())
reverse connections). |
void |
setStatusCheckInterval(long statusCheckInterval)
Define the status check interval, that is, how often the server status is read, when
isConnected.
|
void |
setStatusCheckInterval(long statusCheckInterval,
TimeUnit timeUnit) |
void |
setStatusCheckTimeout(long statusCheckTimeout)
Define the timeout to use for Server Status reads in
updateServerStatus(). |
void |
setStatusCheckTimeout(long statusCheckTimeout,
TimeUnit timeUnit) |
void |
setTimeout(long timeOut)
Define the default communication request timeout.
|
void |
setTimeout(long timeOut,
TimeUnit timeUnits)
Define the default communication request timeout.
|
void |
setTimeout(UnsignedInteger timeOut)
Define the default communication request timeout.
|
void |
setUri(String uri)
Deprecated.
use
setAddress(String) instead. |
static void |
setUseCommErrorCodes(boolean communicationErrorFilteringEnabled)
Defines whether
getCommErrorCodes() are used to indicate communication errors that
trigger reconnect. |
void |
setUserIdentity(UserIdentity userIdentity)
Define a new user identity.
|
void |
setValidateCreateSessionResponseCert(boolean validateCreateSessionResponseCert)
Define whether the certificate received in CreateSessionResponse is validated to be the same as
used to create the SecureChannel.
|
void |
setValidateDiscoveredEndpoints(boolean validateDiscoveredEndpoints)
Define whether endpoints discovered from the server are validated against the endpoints
returned for a session create request.
|
void |
setValidateNonceLength(boolean validateNonceLength)
Define whether the length of Nonces received from the server are validated.
|
void |
updateServerStatus()
Read the current server status.
|
protected <T extends ServiceResponse> |
validateServiceRequest(ServiceRequest<T> request)
This method is called before any
ServiceRequest is sent to the server (during a
Session). |
WriteResponse |
write(WriteValue... nodesToWrite)
Write values to the server.
|
AsyncResult<WriteResponse> |
writeAsync(WriteValue... nodesToWrite)
Write node attributes to the server asynchronously.
|
boolean |
writeAttribute(ExpandedNodeId nodeId,
UnsignedInteger attributeId,
Object value)
Write a single attribute value.
|
boolean |
writeAttribute(ExpandedNodeId nodeId,
UnsignedInteger attributeId,
Object value,
boolean autoConvert)
Write a single attribute value.
|
boolean |
writeAttribute(ExpandedNodeId nodeId,
UnsignedInteger attributeId,
Object value,
NumericRange indexRange)
Write a single attribute value.
|
boolean |
writeAttribute(NodeId nodeId,
UnsignedInteger attributeId,
Object value)
Write a single attribute value.
|
boolean |
writeAttribute(NodeId nodeId,
UnsignedInteger attributeId,
Object value,
boolean autoConvert)
Write a single attribute value.
|
boolean |
writeAttribute(NodeId nodeId,
UnsignedInteger attributeId,
Object value,
NumericRange indexRange)
Write a single attribute value.
|
boolean |
writeAttribute(UaNodeId nodeId,
UnsignedInteger attributeId,
Object value)
Write a single attribute value.
|
boolean |
writeAttribute(UaNodeId nodeId,
UnsignedInteger attributeId,
Object value,
boolean autoConvert)
Write a single attribute value.
|
boolean |
writeAttribute(UaNodeId nodeId,
UnsignedInteger attributeId,
Object value,
NumericRange indexRange)
Write a single attribute value.
|
boolean |
writeValue(ExpandedNodeId nodeId,
Object value)
Write the value attribute of a node.
|
boolean |
writeValue(ExpandedNodeId nodeId,
Object value,
boolean autoConvert)
Write the value attribute of a node.
|
boolean |
writeValue(ExpandedNodeId nodeId,
Object value,
NumericRange indexRange)
Write the value attribute of a node.
|
boolean |
writeValue(NodeId nodeId,
Object value)
Write the value attribute of a node.
|
boolean |
writeValue(NodeId nodeId,
Object value,
boolean autoConvert)
Write the value attribute of a node.
|
boolean |
writeValue(NodeId nodeId,
Object value,
NumericRange indexRange)
Write the value attribute of a node.
|
boolean |
writeValue(UaNodeId nodeId,
Object value)
Write the value attribute of a node.
|
boolean |
writeValue(UaNodeId nodeId,
Object value,
boolean autoConvert)
Write the value attribute of a node.
|
boolean |
writeValue(UaNodeId nodeId,
Object value,
NumericRange indexRange)
Write the value attribute of a node.
|
StatusCode[] |
writeValues(ExpandedNodeId[] nodeIds,
Object[] value)
Write the value attribute of several nodes at once.
|
StatusCode[] |
writeValues(ExpandedNodeId[] nodeIds,
Object[] values,
NumericRange[] indexRanges)
Write the value attribute of several nodes at once.
|
StatusCode[] |
writeValues(NodeId[] nodeIds,
Object[] value)
Write the value attribute of several nodes at once.
|
StatusCode[] |
writeValues(NodeId[] nodeIds,
Object[] values,
NumericRange[] indexRanges)
Write the value attribute of several nodes at once.
|
StatusCode[] |
writeValues(UaNodeId[] nodeIds,
Object[] value)
Write the value attribute of several nodes at once.
|
StatusCode[] |
writeValues(UaNodeId[] nodeIds,
Object[] values,
NumericRange[] indexRanges)
Write the value attribute of several nodes at once.
|
formatUri, getAggregateCalculator, getCertificateValidator, getKnownDataTypeDictionary, getOperationLimits, getRegisteredClasses, getSdkVersion, getVersion, isAutoDiscoverCodegenModels, registerAutoDiscoveredModels, registerModelInternal, setAutoDiscoverCodegenModels, setCertificateValidator, setOperationLimits, validateApplicationCertificatepublic static final Double MAX_CACHE_AGE
setDefaultMaxAge(double), based on the Read service
call definitions.public UaClient()
setAddress(UaAddress) as well as the ApplicationIdentity via
setApplicationIdentity(ApplicationIdentity) before calling connect(). For
reverse connections, use setReversePort(int) (or
setReverseAddress(UaAddress)) instead of setAddress(UaAddress).public UaClient(String address)
connect().address - the connection address for the server.IllegalArgumentException - if the address is not valid.setAddress(UaAddress),
setReverseAddress(UaAddress),
setApplicationIdentity(ApplicationIdentity)public static Set<StatusCode> getCommErrorCodes()
setCommunicationErrorFilteringEnabled or when handling
PublishResponse errors.
If communication error filtering hasn't been enabled, then all Bad and Uncertain StatusCodes will indicate a communication error between the Client and the Server when reading Server status.
public static UaApplication.Protocol getDefaultProtocol()
public static boolean isUseCommErrorCodes()
setUseCommErrorCodes(boolean).public static void setDefaultProtocol(UaApplication.Protocol defaultProtocol)
defaultProtocol - the defaultProtocol to setpublic static void setUseCommErrorCodes(boolean communicationErrorFilteringEnabled)
getCommErrorCodes() are used to indicate communication errors that
trigger reconnect. If set to false all non-Good StatusCodes in status check are
considered as an indication of communication error between the Client and the Server. If set to
true only the codes in the getCommErrorCodes() are treated as communication errors.
Default: false.public void addServerStatusListener(ServerStatusListener serverStatusListener)
hasServerStatusListener(ServerStatusListener), the listener is not added again.serverStatusListener - the listener objectpublic Subscription addSubscription(Subscription subscription) throws ServiceException, StatusException
connect() to the server.
The server will assign an ID for each subscription.
Even if the createSubscription call fails, the subscription will still be added to the client
object and it will be in getSubscriptions().
If the subscription belongs to another client, it will be moved to this client.subscription - The subscription to add.ServiceException - if the server returns an error for a service callStatusException - if the subscription was being transferred from another server session,
but it failed.getSubscription(int),
getSubscriptionCount(),
removeSubscription(com.prosysopc.ua.client.Subscription)public CallResponse call(CallMethodRequest... MethodsToCall) throws ServiceException
call(NodeId, NodeId, Variant...) to call several methods at once to reduce the payload
required for making the calls.MethodsToCall - The method call structures.ServiceExceptioncallAsync(com.prosysopc.ua.stack.core.CallMethodRequest...)public Variant[] call(NodeId objectId, NodeId methodId, Variant... inputArguments) throws ServiceException, MethodCallStatusException
call(CallMethodRequest...) instead if you need to
call several methods at the same time.objectId - The NodeId of the Object or ObjectType that is the source of a HasComponent
Reference (or subtype of HasComponent Reference) to the Method.methodId - NodeId of the Method to invoke in the object.inputArguments - List of input argument values. An empty list indicates that there are no
input arguments. The size and order of this list matches the size and order of the input
arguments defined by the input InputArguments Property of the Method.
The name, a description and the data type of each argument are defined by the Argument
structure in each element of the method node's InputArguments Property.ServiceException - if the method call failsMethodCallStatusException - if the method returns a bad StatusCode.
The StatusCode is Bad_InvalidArgument, if at least one input argument broke a
constraint (e.g. wrong data type, value out of range). Read the InputArgumentResults of
the exception to learn which one was not correct.
If the Method execution failed in the server, the StatusCode is set accordingly.public AsyncResult<CallResponse> callAsync(CallMethodRequest... methodsToCall)
methodsToCall - The method call structures.CallResponse). You can poll it, set a listener or wait for the result (or
error).call(com.prosysopc.ua.stack.core.CallMethodRequest...)public void connect()
throws ServiceException,
ConnectException,
SessionActivationException,
InvalidServerEndpointException
getAddress() or starts
listening to a reverse connection from a server by opening a socket at
getReverseAddress(), if that is defined.
setApplicationIdentity(ApplicationIdentity) must also be called before the connection
is made.
The connection procedure starts by calling discoverEndpoints() and then selecting a
suitable EndpointDescription, based on the connection address and security settings.
getAddress() does not need to match exactly to an endpointUrl of the selected
Endpoint.
Note that you can also use #setEndpoint() yourself to initialize the Endpoint as well.
Once the endpoint is defined, the method will create a new OPC UA SecureChannel and a new OPC
UA session using the certificates defined in the ApplicationIdentity, and finally the session
is activated using the defined UserIdentity.
If there are Subscriptions already defined, they will be created in the server as well after
the session has been established. If the subscriptions still exist in the server, they will be
transferred to the new session.
NOTE! After this method has succeeded (i.e. not thrown), it shouldn't be called again until
disconnect(). However, it can be called again, but it does nothing. If connection
breaks, by default SDK handles reconnections. If isAutoReconnect() is set to false
(default true), reconnections must be handled with reconnect() (not with
connect()).ServiceException - if there are service call errors while discovering the endpoints or
adding the subscriptions to the server. Note that all the exceptions below are also
subclasses of ServiceException.ConnectException - if the connection failsSessionActivationException - if the session cannot be activated with the UserIdentityInvalidServerEndpointException - If the server endpoint defined by the parameters is not
found from the servers list of supported endpointspublic void disconnect()
setKeepSubscriptions(boolean) to define, if the subscriptions should be kept in the the
server, after disconnect (in case you wish to have them available when you reconnect, for
example).
The method uses a default timeout of 60000 ms (1 minute) for the CloseSession call.public void disconnect(long timeout)
setKeepSubscriptions(boolean) to define, if the subscriptions should be kept in the the
server, after disconnect (in case you wish to have them available when you reconnect, for
example).timeout - timeout (in milliseconds) for the CloseSession call. Must be a positive value. 0
tells it to wait infinitely for a response.public void disconnect(long timeout,
TimeUnit timeUnit)
disconnect(long)public void disconnect(UnsignedInteger timeout)
setKeepSubscriptions(boolean) to define, if the subscriptions should be kept in the the
server, after disconnect (in case you wish to have them available when you reconnect, for
example).timeout - timeout (in milliseconds) for the CloseSession call. UnsignedInteger.ZERO tells
it to wait infinitely for a response.public EndpointDescription[] discoverEndpoints() throws InvalidServerEndpointException, ConnectException, ServiceException
getProtocol().InvalidServerEndpointException - if the URI is not valid.ConnectException - if the list could not be retrieved - probably because the server could
not be connected to.ServiceException - if the service call failspublic EndpointDescription[] discoverEndpoints(UaApplication.Protocol... protocols) throws InvalidServerEndpointException, ConnectException, ServiceException
protocols - the transport protocols for which the endpoints are requested. If omitted,
getProtocol() is used.InvalidServerEndpointException - if the URI is not valid.ConnectException - if the list could not be retrieved - probably because the server could
not be connected to.ServiceException - if the service call failspublic OperationLimits getActualOperationLimits()
UaApplication.getOperationLimits().public int getActualPublishRequestSetpoint()
getPublishRequestSetpoint()public UaAddress getAddress()
connect(),
except when isInReverseMode(), in which case getReverseAddress() is used
instead.public AddressSpace getAddressSpace()
getAddressSpace in class UaApplicationpublic ApplicationIdentity getApplicationIdentity()
getApplicationIdentity in class UaApplicationsetApplicationIdentity(com.prosysopc.ua.ApplicationIdentity) to
define it, before connecting to the server.public String getAuditEntryId()
public int getConnectTimeout()
public double getDefaultMaxAge()
setDefaultMaxAge(double)public TimestampsToReturn getDefaultTimestampsToReturn()
public EncoderContext getEncoderContext()
getEncoderContext in class UaApplicationpublic EndpointDescription getEndpoint()
hasConnected().public EndpointConfiguration getEndpointConfiguration()
connect() is called. So if you change them after that they will have no effect, unless
you reconnect.
The parameters of the structure are:
| Type | Parameter | Default value | Description |
|---|---|---|---|
| Integer | OperationTimeout | 120000 (2 min) | Default timeout used by the stack, if the request messages do not define any. It is
recommended to use setTimeout(long), instead of setting the timeout here, though. It will
define the timeout also in the messages.
|
| Boolean | UseBinaryEncoding | true | Binary encoding should be used always. |
| Integer | MaxStringLength | UnsignedShort.MAX_VALUE | Maximum length for string parameters in service calls. |
| Integer | MaxByteStringLength | UnsignedShort.MAX_VALUE*16 | Maximum length for byte array parameters in service calls. |
| Integer | MaxArrayLength | UnsignedShort.MAX_VALUE | Maximum length for normal array parameters in service calls. |
| Integer | MaxMessageSize | UnsignedShort.MAX_VALUE*64 | Maximum length for service call messages. |
| Integer | MaxBufferSize | UnsignedShort.MAX_VALUE | Maximum buffer size to use in service calls. |
| Integer | ChannelLifetime | 120000 (2 min) | The lifetime of the channel. This specifies how long the server will keep the channel open, in case it does not receive any requests from the client. |
| Integer | SecurityTokenLifetime | 3600000 (1 hour) | The requested lifetime, in milliseconds, for security tokens. It specifies how often the client will renew the security token. |
@Deprecated public String getHost()
getAddress() and UaAddress.getHost()public HttpsSettings getHttpsSettings()
public DiagnosticInfo[] getLastOperationDiagnostics()
getLastServiceResult(),
getLastServiceDiagnostics(),
getLastResponseTimestamp()public DateTime getLastResponseTimestamp()
getLastServiceResult(),
getLastServiceDiagnostics(),
getLastOperationDiagnostics()public DiagnosticInfo getLastServiceDiagnostics()
getLastOperationDiagnostics(),
getLastServiceResult(),
getLastResponseTimestamp()public StatusCode getLastServiceResult()
getLastOperationDiagnostics(),
getLastServiceDiagnostics(),
getLastResponseTimestamp()public UaClientListener getListener()
public Locale getLocale()
public UnsignedInteger getMaxResponseMessageSize()
public NamespaceTable getNamespaceTable()
getNamespaceTable(boolean) to force a
refresh.getNamespaceTable in class UaApplicationpublic NamespaceTable getNamespaceTable(boolean forceRefresh) throws ServiceException, StatusException
isConnected is true.forceRefresh - request that the array is refreshed from the server, even if it has been
read alreadyStatusException - if the namespace array read from the server is not validServiceException - if the namespace array could not be readpublic EnumSet<UaApplication.DiagnosticMask> getOperationDiagnosticMask()
@Deprecated public int getPort()
getAddress() and UaAddress.getPort()@Deprecated public UaApplication.Protocol getProtocol()
getAddress() and UaAddress.getProtocol()public double getPublishRequestFactor()
setPublishRequestFactor(double)public int getPublishRequestSetpoint()
getActualPublishRequestSetpoint() is actually calculated based on
getPublishRequestFactor() and getSubscriptionCount() and automatically
adjusted, if the server sends Bad_TooManyPublishRequest errors for the PublishRequests.getPublishRequestFactor() should be used)getActualPublishRequestSetpoint(),
setPublishRequestSetpoint(int)public UnsignedInteger getPublishRequestTimeout()
public UaAddress getReverseAddress()
setReverseAddress(UaAddress)public ReverseConnectionListener getReverseConnectionListener()
public SecureChannel getSecureChannel() throws ServerConnectionException
ServerConnectionExceptionpublic SecurityMode getSecurityMode()
public ApplicationIdentity getServerIdentity()
@Deprecated public String getServerName()
getAddress() and UaAddress.getServerName()public ServerState getServerState()
hasConnected() will still return true, but getServerState()
will give ServerState.CommunicationFault.
If isAutoReconnect() is true, communication failures will be recovered automatically.
Otherwise, you must call reconnect yourself, until it succeeds.getServerStatus().getState(), when
status is available; ServerState.CommunicationFault, when the status could not be read
because of a communication problem; ServerState.Unknown when not
hasConnected() or if status could not be read for some other reason.public ServerStatusDataType getServerStatus() throws StatusException, ServerConnectionException
hasConnected().
Note also that getServerState() returns the State part of the status - also when the
status cannot be read, so it is easier to use for plain state checking.StatusException - if the server status could not be read from the server. Read the
StatusCode of the exception to learn the reason for that. The same status is also
available from ServerStatusErrorServerConnectionException - if we are not connected to the server, in which case the
status is not availablegetServerTimeDifference()public StatusCode getServerStatusError()
public ServerTable getServerTable()
UaApplicationVariableIdentifiers.Server_ServerArray).
The indexes of the table are used if References of a node in the server points to another
server via ExpandedNodeId.getServerIndex(). The index 0 always means the local server
and has the local server's ApplicationUrigetServerTable in class UaApplicationpublic ServerTable getServerTable(boolean forceRefresh) throws ServiceException, StatusException
isConnected is true.forceRefresh - request that the array is refreshed from the server, even if it has been
read alreadyStatusException - if the server array read from the server is not validServiceException - if the server array could not be readpublic long getServerTimeDifference()
getServerStatus()public EnumSet<UaApplication.DiagnosticMask> getServiceDiagnosticMask()
public Session getSession()
isConnected. Otherwise it will be null.public String getSessionName()
getSession().public double getSessionTimeout()
connect(). The revised value can be checked from the current session,
available from getSession().public TcpConnection.SocketFactory getSocketFactory()
TcpConnection.SocketFactory previously set via #setSocketFactory(SocketFactory).public long getStatusCheckInterval()
public long getStatusCheckTimeout()
updateServerStatus()getStatusCheckInterval()public Subscription getSubscription(int index)
getSubscriptionCount(),
addSubscription(com.prosysopc.ua.client.Subscription),
removeSubscription(com.prosysopc.ua.client.Subscription),
getSubscriptionById(UnsignedInteger),
getSubscriptions()public Subscription getSubscriptionById(UnsignedInteger subscriptionId)
subscriptionId - the ID of the subscriptiongetSubscriptionCount(),
addSubscription(com.prosysopc.ua.client.Subscription),
removeSubscription(com.prosysopc.ua.client.Subscription),
getSubscription(int)public int getSubscriptionCount()
getSubscription(int),
addSubscription(com.prosysopc.ua.client.Subscription),
removeSubscription(com.prosysopc.ua.client.Subscription),
getSubscriptions()public Subscription[] getSubscriptions()
public List<SecurityMode> getSupportedSecurityModes() throws InvalidServerEndpointException, ServerConnectionException, ServiceException
ServiceExceptionServerConnectionExceptionInvalidServerEndpointExceptionpublic UserTokenPolicy[] getSupportedUserIdentityTokens() throws ServerConnectionException, ServiceException
ServiceException - if the service call failsServerConnectionExceptionpublic int getTimeout()
getEndpointConfiguration() should be used.public TypeDictionary getTypeDictionary()
TypeDictionary that can be used to parse unknown Structures.@Deprecated public String getUri()
getAddress() and UaAddress.getAddress()setUri(String) or alternatively with setEndpoint(EndpointDescription).public UserIdentity getUserIdentity()
public boolean hasConnected()
connect() has happened (i.e. it didn't throw) and a
subsequent disconnect() call hasn't finished, otherwise returns false.
In general for most applications this method can be used to determine if is there a need to
call connect(). Once connect() succeeds, typically the SDK will manage the
connection, depending on isAutoReconnect() (which is by default true).
This method should NOT be used for "do we have a connection to the server right now" type of
questions, please see hasConnection() (do note the limitations).public boolean hasConnection()
ServiceException and StatusException (or
DataValue.getStatusCode() where applicable must be checked. However this method can be
used e.g. for an UI that will poll this value periodically.
See also hasConnected().public boolean hasServerStatusListener(ServerStatusListener serverStatusListener)
serverStatusListener - the listener to checkpublic boolean hasSubscription(UnsignedInteger subscriptionId)
subscriptionId - the ID of the subscriptionpublic HistoryUpdateResult historyDeleteAtTimes(NodeId nodeId, DateTime[] reqTimes) throws StatusException, ServerConnectionException, ServiceException
nodeId - the NodeId of the node whose history should be deletedreqTimes - an array of DateTimes at which history should be deletedStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failspublic HistoryUpdateResult historyDeleteEvents(NodeId nodeId, List<ByteString> eventIds) throws StatusException, ServerConnectionException, ServiceException
nodeId - the NodeId of the node whose history should be deletedeventIds - a list of eventIds (each id is a byte array) of the events that should be
deletedStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failspublic HistoryUpdateResult historyDeleteModified(NodeId nodeId, DateTime startTime, DateTime endTime) throws StatusException, ServerConnectionException, ServiceException
nodeId - the NodeId of the node whose history should be deletedstartTime - the start of the interval to be deletedendTime - the end of the interval to be deletedStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failspublic HistoryUpdateResult historyDeleteRaw(NodeId nodeId, DateTime startTime, DateTime endTime) throws StatusException, ServerConnectionException, ServiceException
nodeId - the NodeId of the node whose history should be deletedstartTime - the start of the interval to be deletedendTime - the end of the interval to be deletedStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failspublic HistoryReadResult[] historyRead(HistoryReadDetails details, TimestampsToReturn timestampsToReturn, Boolean releaseContinuationPoints, HistoryReadValueId... nodesToRead) throws ServerConnectionException, ServiceException
details - specifies how the data should be read. Use one of the subclasses of
HistoryReadDetails.timestampsToReturn - defines which timestamp information should be returned. The parameter
may not be TimestampsToReturn.Neither.releaseContinuationPoints - if you do not want to use the continuation points returned by
the previous request, define this parameter as true, to enable the server to release the
continuation points that it reserved. Note though that when it is true, the
server will not return any data, so in normal reads you must keep it false.nodesToRead - The node data for which the history is requested. Define the
continuationPoints here, if you wish to continue a previous request that returned
continuationPoints.getLastOperationDiagnostics().ServerConnectionException - if not connected to the serverServiceException - if the service call failsIllegalArgumentException - if details cannot be encodedhistoryReadAsync(com.prosysopc.ua.stack.core.HistoryReadDetails, com.prosysopc.ua.stack.core.TimestampsToReturn, java.lang.Boolean, com.prosysopc.ua.stack.core.HistoryReadValueId...),
historyReadAtTimes(com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.builtintypes.DateTime[], com.prosysopc.ua.stack.utils.NumericRange, com.prosysopc.ua.stack.core.TimestampsToReturn),
historyReadEvents(com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, com.prosysopc.ua.stack.core.EventFilter, com.prosysopc.ua.stack.core.TimestampsToReturn),
historyReadModified(com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, com.prosysopc.ua.stack.utils.NumericRange, com.prosysopc.ua.stack.core.TimestampsToReturn),
historyReadProcessed(com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DateTime, java.lang.Double, com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.core.AggregateConfiguration, com.prosysopc.ua.stack.utils.NumericRange, com.prosysopc.ua.stack.core.TimestampsToReturn),
historyReadRaw(com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DateTime, long, java.lang.Boolean, com.prosysopc.ua.stack.utils.NumericRange, com.prosysopc.ua.stack.core.TimestampsToReturn)public AsyncResult<HistoryReadResponse> historyReadAsync(HistoryReadDetails details, TimestampsToReturn timestampsToReturn, Boolean releaseContinuationPoints, HistoryReadValueId... nodesToRead)
details - specifies how the data should be read. Use one of the subclasses of
HistoryReadDetails.timestampsToReturn - defines which timestamp information should be returned. The parameter
may not be TimestampsToReturn.Neither.releaseContinuationPoints - if you do not want to use the continuation points returned by
the previous request, define this parameter as true, to enable the server to release the
continuation points that it reserved. Note though that when it is true, the
server will not return any data, so in normal reads you must keep it false.nodesToRead - The node data for which the history is requested. Define the
continuationPoints here, if you wish to continue a previous request that returned
continuationPoints.HistoryReadResponse.ServerConnectionException - if not connected to the serverIllegalArgumentException - if details cannot be encodedhistoryRead(com.prosysopc.ua.stack.core.HistoryReadDetails, com.prosysopc.ua.stack.core.TimestampsToReturn, java.lang.Boolean, com.prosysopc.ua.stack.core.HistoryReadValueId...),
historyReadAtTimes(com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.builtintypes.DateTime[], com.prosysopc.ua.stack.utils.NumericRange, com.prosysopc.ua.stack.core.TimestampsToReturn),
historyReadEvents(com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, com.prosysopc.ua.stack.core.EventFilter, com.prosysopc.ua.stack.core.TimestampsToReturn),
historyReadModified(com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, com.prosysopc.ua.stack.utils.NumericRange, com.prosysopc.ua.stack.core.TimestampsToReturn),
historyReadProcessed(com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DateTime, java.lang.Double, com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.core.AggregateConfiguration, com.prosysopc.ua.stack.utils.NumericRange, com.prosysopc.ua.stack.core.TimestampsToReturn),
historyReadRaw(com.prosysopc.ua.stack.builtintypes.NodeId, com.prosysopc.ua.stack.builtintypes.DateTime, com.prosysopc.ua.stack.builtintypes.DateTime, long, java.lang.Boolean, com.prosysopc.ua.stack.utils.NumericRange, com.prosysopc.ua.stack.core.TimestampsToReturn)public DataValue[] historyReadAtTimes(NodeId nodeId, DateTime[] reqTimes, NumericRange indexRange, TimestampsToReturn timestampsToReturn) throws StatusException, ServerConnectionException, ServiceException, DecodingException
historyReadAtTimes(NodeId, DateTime[], NumericRange, TimestampsToReturn, Boolean)
called with useSimpleBounds=false.
The method will make subsequent calls to the server, as long as the server returns
continuationPoints, to ensure that a full result set is retrieved. If you suspect that you may
get too large results sets (to fit in memory, for instance) this way, it may be better to use
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeId - the NodeId of the node whose history should be readreqTimes - the timestamps from which history should be readindexRange - the range of array indexes to use for array values. If null, all values
should be returned. The first array element is identified with 0. Should be null, if the
variable is not an array.
Note that the range applies to each element of the history data samples; not to the
elements of the returned array of data.timestampsToReturn - which timestamps to return with the valuesStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)public DataValue[] historyReadAtTimes(NodeId nodeId, DateTime[] reqTimes, NumericRange indexRange, TimestampsToReturn timestampsToReturn, Boolean useSimpleBounds) throws StatusException, ServerConnectionException, ServiceException, DecodingException
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeId - the NodeId of the node whose history should be readreqTimes - the timestamps from which history should be readindexRange - the range of array indexes to use for array values. If null, all values
should be returned. The first array element is identified with 0. Should be null, if the
variable is not an array.
Note that the range applies to each element of the history data samples; not to the
elements of the returned array of data.timestampsToReturn - which timestamps to return with the valuesuseSimpleBounds - whether the server is instructed to interpolate values using the
SimpleBounds algorithm or the normal one as defined in (OPC UA Part 13. Aggregates
Specification).StatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)public HistoryReadResult[] historyReadAtTimes(NodeId[] nodeIds, DateTime[] reqTimes, NumericRange indexRange, TimestampsToReturn timestampsToReturn, Boolean useSimpleBounds) throws ServerConnectionException, ServiceException, DecodingException, EncodingException
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeIds - the NodeIds of the nodes whose history should be readreqTimes - the timestamps from which history should be readindexRange - the range of array indexes to use for array values. If null, all values
should be returned. The first array element is identified with 0. Should be null, if the
variable is not an array.
Note that the range applies to each element of the history data samples; not to the
elements of the returned array of data.timestampsToReturn - which timestamps to return with the valuesuseSimpleBounds - whether the server is instructed to interpolate values using the
SimpleBounds algorithm or the normal one as defined in (OPC UA Part 13. Aggregates
Specification).ServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)EncodingException - if the returned data could not be encoded to ExtensionObjectpublic HistoryEventFieldList[] historyReadEvents(NodeId nodeId, DateTime startTime, DateTime endTime, UnsignedInteger numValuesPerNode, EventFilter filter, TimestampsToReturn timestampsToReturn) throws StatusException, ServerConnectionException, ServiceException, DecodingException
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeId - the NodeId of the node whose history should be readstartTime - the beginning of the time intervalendTime - the end of the time interval. If endTime is less than startTime the data will be
returned in reverse ordernumValuesPerNode - the maximum number of events to return per one internal call. If the
value is 0, all events between startTime and endTime are returned in one call. If the
value is bigger or the server decides to break the call, the server will respond with a
continuationPoint, which the client can use to automatically request all values with
subsequent reads.timestampsToReturn - which timestamps to return with the valuesfilter - the filter to use for selecting the events to include. You can use the
ContentFilterBuilder to create the WhereClause of the filter, the same way that
you do for the MonitoredEventItem.setEventFilter(EventFilter).StatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)public HistoryReadResult[] historyReadEvents(NodeId[] nodeIds, DateTime startTime, DateTime endTime, UnsignedInteger numValuesPerNode, EventFilter filter, TimestampsToReturn timestampsToReturn) throws ServerConnectionException, ServiceException, DecodingException, EncodingException
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeIds - the NodeIds of the nodes whose history should be readstartTime - the beginning of the time intervalendTime - the end of the time interval. If endTime is less than startTime the data will be
returned in reverse ordernumValuesPerNode - the maximum number of events to return per one internal call. If the
value is 0, all events between startTime and endTime are returned in one call. If the
value is bigger or the server decides to break the call, the server will respond with a
continuationPoint, which the client can use to automatically request all values with
subsequent reads.timestampsToReturn - which timestamps to return with the valuesfilter - the filter to use for selecting the events to include. You can use the
ContentFilterBuilder to create the WhereClause of the filter, the same way that
you do for the MonitoredEventItem.setEventFilter(EventFilter).ServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)EncodingException - if the returned data could not be encoded to ExtensionObjectpublic HistoryModifiedData historyReadModified(NodeId nodeId, DateTime startTime, DateTime endTime, UnsignedInteger numValuesPerNode, NumericRange indexRange, TimestampsToReturn timestampsToReturn) throws StatusException, ServerConnectionException, ServiceException, DecodingException
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeId - the NodeId of the node whose history should be readstartTime - the beginning of the time intervalendTime - the end of the time interval. If endTime is less than startTime the data will be
returned in reverse ordernumValuesPerNode - the maximum number of values to return per one internal call. If the
value is 0, all values between startTime and endTime are returned in one call. If the
value is bigger or the server decides to break the call, the server will respond with a
continuationPoint, which the client can use to automatically request all values with
subsequent reads.indexRange - the range of array indexes to use for array values. If null, all values
should be returned. The first array element is identified with 0. Should be null, if the
variable is not an array.timestampsToReturn - which timestamps to return with the valuesStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)public HistoryReadResult[] historyReadModified(NodeId[] nodeIds, DateTime startTime, DateTime endTime, UnsignedInteger numValuesPerNode, NumericRange indexRange, TimestampsToReturn timestampsToReturn) throws ServerConnectionException, ServiceException, DecodingException, EncodingException
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeIds - the NodeIds of the nodes whose history should be readstartTime - the beginning of the time intervalendTime - the end of the time interval. If endTime is less than startTime the data will be
returned in reverse ordernumValuesPerNode - the maximum number of values to return per one internal call. If the
value is 0, all values between startTime and endTime are returned in one call. If the
value is bigger or the server decides to break the call, the server will respond with a
continuationPoint, which the client can use to automatically request all values with
subsequent reads.indexRange - the range of array indexes to use for array values. If null, all values
should be returned. The first array element is identified with 0. Should be null, if the
variable is not an array.timestampsToReturn - which timestamps to return with the valuesServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)EncodingException - if the returned data could not be encoded to ExtensionObjectpublic DataValue[] historyReadProcessed(NodeId nodeId, DateTime startTime, DateTime endTime, Double processingInterval, NodeId aggregateType, AggregateConfiguration aggregateConfiguration, NumericRange indexRange, TimestampsToReturn timestampsToReturn) throws ServerConnectionException, ServiceException, DecodingException, StatusException
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeId - the NodeId of the node whose history should be readstartTime - the beginning of the time intervalendTime - the end of the time interval. If endTime is less than startTime the data will be
returned in reverse order. EndTime must not be equal to startTime.processingInterval - Interval between returned Aggregate values (in milliseconds). The
value 0 indicates that there is no Interval defined.aggregateType - The NodeId of the HistoryAggregate object that indicates the Aggregate
Function to use, when retrieving processed history. You can use one of the
Identifiers.AggregateFunction_X values in the SDK, but in practice the supported
functions are defined by the servers. You can look for the supported functions by
reading the list of NodeIds under the
Identifiers.HistoryServerCapabilities_AggregateFunctions folder. See [UA Part 13] for
details.aggregateConfiguration - Aggregate configuration structureindexRange - which elements of arrays to return, null returns all. this parameter is
always null if the value is not an arraytimestampsToReturn - which timestamps to return with the valuesStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)public HistoryReadResult[] historyReadProcessed(NodeId[] nodeIds, DateTime startTime, DateTime endTime, Double processingInterval, NodeId aggregateType, AggregateConfiguration aggregateConfiguration, NumericRange indexRange, TimestampsToReturn timestampsToReturn) throws ServerConnectionException, ServiceException, DecodingException, EncodingException
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeIds - the NodeIds of the nodes whose history should be readstartTime - the beginning of the time intervalendTime - the end of the time interval. If endTime is less than startTime the data will be
returned in reverse order. EndTime must not be equal to startTime.processingInterval - Interval between returned Aggregate values (in milliseconds). The
value 0 indicates that there is no Interval defined.aggregateType - The NodeId of the HistoryAggregate object that indicates the Aggregate
Function to use, when retrieving processed history. You can use one of the
Identifiers.AggregateFunction_X values in the SDK, but in practice the supported
functions are defined by the servers. You can look for the supported functions by
reading the list of NodeIds under the
Identifiers.HistoryServerCapabilities_AggregateFunctions folder. See [UA Part 13] for
details.aggregateConfiguration - Aggregate configuration structureindexRange - which elements of arrays to return, null returns all. this parameter is
always null if the value is not an arrayindexRange - which elements of arrays to return, null returns all. this parameter is
always null if the value is not an arraytimestampsToReturn - which timestamps to return with the valuesServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)EncodingException - if the returned data could not be encoded to ExtensionObjectpublic DataValue[] historyReadRaw(NodeId nodeId, DateTime startTime, DateTime endTime, long numValuesPerNode, Boolean returnBounds, NumericRange indexRange, TimestampsToReturn timestampsToReturn) throws ServerConnectionException, DecodingException, ServiceException, StatusException
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeId - the NodeId of the node whose history should be readstartTime - the beginning of the time intervalendTime - the end of the time interval. If endTime is less than startTime the data will be
returned in reverse order. EndTime must not be equal to startTime.numValuesPerNode - the maximum number of values to return per one internal call. If the
value is 0, all values between startTime and endTime are returned in one call. If the
value is bigger or the server decides to break the call, the server will respond with a
continuationPoint, which the client can use to automatically request all values with
subsequent reads. The value must fit in the range of UnsignedIntegerreturnBounds - whether values at the boundaries, corresponding to startTime and endtime,
should be included in the result setindexRange - which elements of arrays to return, null returns all. this parameter is
always null if the value is not an arraytimestampsToReturn - which timestamps to return with the valuesStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)public DataValue[] historyReadRaw(NodeId nodeId, DateTime startTime, DateTime endTime, UnsignedInteger numValuesPerNode, Boolean returnBounds, NumericRange indexRange, TimestampsToReturn timestampsToReturn) throws ServerConnectionException, ServiceException, DecodingException, StatusException
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeId - the NodeId of the node whose history should be readstartTime - the beginning of the time intervalendTime - the end of the time interval. If endTime is less than startTime the data will be
returned in reverse order. EndTime must not be equal to startTime.numValuesPerNode - the maximum number of values to return per one internal call. If the
value is 0, all values between startTime and endTime are returned in one call. If the
value is bigger or the server decides to break the call, the server will respond with a
continuationPoint, which the client can use to automatically request all values with
subsequent reads.returnBounds - whether values at the boundaries, corresponding to startTime and endtime,
should be included in the result setindexRange - which elements of arrays to return, null returns all. this parameter is
always null if the value is not an arraytimestampsToReturn - which timestamps to return with the valuesStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)public HistoryReadResult[] historyReadRaw(NodeId[] nodeIds, DateTime startTime, DateTime endTime, long numValuesPerNode, Boolean returnBounds, NumericRange indexRange, TimestampsToReturn timestampsToReturn) throws ServerConnectionException, ServiceException, DecodingException, EncodingException
historyRead(HistoryReadDetails, TimestampsToReturn, Boolean, HistoryReadValueId...)
instead.nodeIds - the NodeIds of the nodes whose history should be readstartTime - the beginning of the time intervalendTime - the end of the time interval. If endTime is less than startTime the data will be
returned in reverse order. EndTime must not be equal to startTime.numValuesPerNode - the maximum number of values to return per one internal call. If the
value is 0, all values between startTime and endTime are returned in one call. If the
value is bigger or the server decides to break the call, the server will respond with a
continuationPoint, which the client can use to automatically request all values with
subsequent reads. The value must fit in the range of UnsignedIntegerreturnBounds - whether values at the boundaries, corresponding to startTime and endtime,
should be included in the result setindexRange - which elements of arrays to return, null returns all. this parameter is
always null if the value is not an arraytimestampsToReturn - which timestamps to return with the valuesServerConnectionException - if we are not connected to the serverServiceException - if the service call failsDecodingException - if the returned data could not be decoded (received as an
ExtensionObject from the server)EncodingException - if the returned data could not be encoded to ExtensionObjectpublic HistoryUpdateResult[] historyUpdate(HistoryUpdateDetails... details) throws ServerConnectionException, ServiceException
details - the history update definitionsgetLastOperationDiagnostics().ServerConnectionException - if not connected to the serverServiceException - if the service call failsIllegalArgumentException - if details cannot be encodedpublic AsyncResult<HistoryUpdateResponse> historyUpdateAsync(HistoryUpdateDetails... details) throws ServerConnectionException
details - the history update definitionsHistoryUpdateResponse.ServerConnectionException - if not connected to the serverIllegalArgumentException - if details cannot be encodedpublic HistoryUpdateResult historyUpdateData(NodeId nodeId, PerformUpdateType performInsertReplace, DataValue[] updateValues) throws StatusException, ServerConnectionException, ServiceException
Insert data functionality Setting performInsertReplace = INSERT_1 inserts entries into the history database at the specified timestamps for one or more HistoricalDataNodes. If an entry exists at the specified timestamp, the new entry shall not be inserted; instead the StatusCode shall indicate Bad_EntryExists. This function is intended to insert new entries at the specified timestamps; e.g., the insertion of lab data to reflect the time of data collection. Replace data functionality Setting performInsertReplace = REPLACE_2 replaces entries in the history database at the specified timestamps for one or more HistoricalDataNodes. If no entry exists at the specified timestamp, the new entry shall not be inserted; otherwise the StatusCode shall indicate Bad_NoEntryExists. This function is intended to replace existing entries at the specified timestamp; e.g., correct lab data that was improperly processed, but inserted into the history database. Update data functionality Setting performInsertReplace = UPDATE_3 inserts or replaces entries in the history database for the specified timestamps for one or more HistoricalDataNodes. If the item has an entry at the specified timestamp, the new entry will replace the old one. If there is no entry at that timestamp, the function will insert the new data. This function is intended to unconditionally insert/replace values and qualities; e.g., correction of values for bad sensors. Good as a StatusCode for an individual entry is allowed when the server is unable to say whether there was already a value at that timestamp. If the server can determine whether the new entry replaces an entry that was already there, it should use Good_EntryInserted or Good_EntryReplaced to return that information. (OPC UA Spec. Part 11 v 1.01 6.7.2)
nodeId - the NodeId of the node whose history should be readperformInsertReplace - determines which action of Insert, Replace or Update is performed.
Update equals to "Insert or Replace" depending on whether the variable has an entry for
the specified timestamp. For Insert and replace a StatusException with StatusCode
Bad_EntryExists or Bad_NoEntryExists will be set for operationResults, respectively, if
there already is an entry which is being inserted or is no entry that could be replaced.updateValues - the values to be updated in historyStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failspublic HistoryUpdateResult historyUpdateEvent(NodeId nodeId, PerformUpdateType performInsertReplace, EventFilter filter, HistoryEventFieldList[] eventData) throws StatusException, ServerConnectionException, ServiceException
This function is intended to insert new entries; e.g., backfilling of historical Events. Setting performInsertReplace = INSERT_1 inserts entries into the Event history database for one or more HistoricalEventNodes. The whereClause parameter of the EventFilter shall be empty. The SelectClause shall specify the EventType and the Time. The selectClause should specify the SourceNode and the SourceName. If the historian does not support archiving the specified EventType the StatusCode shall indicate Bad_TypeDefinitionInvalid. If the SourceNode is not a valid source for Events the StatusCode shall indicate Bad_SourceNodeIdInvalid. If the Time does not fall within range that can be stored the StatusCode shall indicate Bad_OutOfRange.If the selectClause does not include fields which are mandatory for the EventType the StatusCode shall indicate Bad_ArgumentsMissing. If the selectClause specifies fields which are not valid for the EventType or cannot be saved by the historian the StatusCode shall indicate Good_DataIgnored and the OperationResults array shall specify Bad_NotSupported for each ignored field. The EventId is a server generated opaque value and a Client cannot assume it knows how to create value EventIds. If a Client does specify the EventId in the selectClause and it matches an existing Event the StatusCode shall indicate Bad_EntryExists. A Client must use a HistoryRead to discover any automatically generated EventIds. If any errors occur while processing individual fields the StatusCode shall indicate Bad_ArgumentInvalid and the OperationResults array shall specify the exact error for each invalid field. The IndexRange parameter of the SimpleAttributeOperand is not valid for insert operations and the OperationResults shall specify Bad_IndexRangeInvalid if one is specified. If no errors occur the StatusCode shall indicate Good and the OperationResults array shall be empty. If errors occur OperationResults array will have one element for each field specified in the selectClause. A Client may instruct the Server to choose a suitable default value for a field by specifying a value of null. If the server is not able to select a suitable default the corresponding entry in the OperationResults array shall be Bad_InvalidArgument. Replace event functionality This function is intended to replace fields in existing Event entries; e.g., correct Event data that contained incorrect data due to a bad sensor. Setting performInsertReplace = REPLACE_2 replaces entries in the Event history database for the specified filter for one or more HistoricalEventNodes. The whereClause parameter of the EventFilter shall specify the EventId Property. If no entry exists matching the specified filter, no updates will be performed, instead the StatusCode shall indicate Bad_NoEntryExists. If the selectClause specifies fields which are not valid for the EventType or cannot be saved by the historian the StatusCode shall indicate Good_DataIgnored and the OperationResults array shall specify Bad_NotSupported for each ignored field. If a field is valid for the EventType but cannot be changed the StatusCode shall indicate Good_DataIgnored and the corresponding entry in the OperationResults array shall be Bad_NotWriteable. If fatal errors occur while processing individual fields the StatusCode shall indicate Bad_ArgumentInvalid and the OperationResults array shall specify the exact error. If no errors occur the StatusCode shall indicate Good and the OperationResults array shall be empty. If errors occur OperationResults array will have one element for each field specified in the selectClause. If a Client specifies a value of null for any field the Server shall set the value of the field to null. If a null value is not valid for the corresponding entry in the OperationResults array shall be Bad_InvalidArgument. Update event functionality This function is intended to unconditionally insert/replace Events; e.g., synchronizing a backup Event database. Setting performInsertReplace = UPDATE_3 inserts or replaces entries in the Event history database for the specified filter for one or more HistoricalEventNodes. The server will, based on its own criteria, attempt to determine if the Event already exists, if it does the existing Event will be deleted and the new Event will be inserted (retaining the EventId). If the event does not exist then a new Event will be inserted, including the generation of a new EventId. All of the restrictions, behavoirs errors specified for the Insert functionality also apply to this function. If an existing entry was replaced successfully the StatusCode shall be Good_EntryReplaced. If a new entry was created the StatusCode shall be Good_EntryInserted. If the server cannot determine whether it replaced or inserted an entry it the StatusCode shall be Good. (OPC UA Spec. Part 11 v 1.01 6.7.4)
nodeId - the NodeId of the node whose history should be readperformInsertReplace - determines which action of Insert, Replace or Update is performed.
Update equals to "Insert or Replace" depending on whether the variable has an entry for
the specified timestamp.filter - the filter defines the target of the operation.eventData - the event data to be updatedStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failspublic HistoryUpdateResult historyUpdateStructureData(NodeId nodeId, PerformUpdateType performInsertReplace, DataValue[] updateValues) throws StatusException, ServerConnectionException, ServiceException
Structured History Data provides metadata describing an entry in the history database. The server shall define what uniqueness means for each Structured History Data structure type. For example, a server may only allow one Annotation per timestamp which means the timestamp is the unique key for the structure. Another server may allow for multiple Annotations to exist per user, so a combination username, Timestamp and message may be used as the unique key for the structure. In the following sections the terms "Structured History Data exists" and "at the specificed parameters" means a matching entry has been found at the specified timestamp using the Server's criteria for uniqueness. In the case where the Client wishes to Replace a parameter that is part of the uniqueness criteria, the resulting StatusCode would be Bad_NoEntryExists. They will have to Remove the existing structure and Insert the new structure. Insert functionality Setting performInsertReplace = INSERT_1 inserts Structured History Data such as Annotations, into the history database at the specified parameters for one or more Properties of HistoricalDataNodes If a Structured History Data entry already exists at the specified parameters the StatusCode shall indicate Bad_EntryExists. Replace functionality Setting performInsertReplace = REPLACE_2 replaces Structured History Data such as Annotations in the history database at the specified parameters for one or more Properties of HistoricalDataNodes. If a Structured History Data entry does not already exist at the specified parameters, the StatusCode shall indicate Bad_NoEntryExists. Update functionality Setting performInsertReplace = UPDATE_3 inserts or replaces Structure Data such as Annotations in the history database at the specified parameters for one or more Properties of HistoricalDataNodes. If a Structure History Data entry already exists at the specified parameters it is deleted and the value provided by the Client is inserted. If no existing entry exists the new entry is inserted. If an existing entry was replaced successfully the StatusCode shall be Good_EntryReplaced. If a new entry was created the StatusCode shall be Good_EntryInserted. If the server cannot determine whether it replaced or inserted an entry it the StatusCode shall be Good. Remove functionality Setting performInsertReplace = REMOVE_4 removes Structure Data such as Annotations from the history database at the specified parameters for one or more Properties of HistoricalDataNodes. If a Structure History Data entry exists at the specified parameters it is deleted. If Structured History Data does not already exist at the specified parameters, the StatusCode shall indicate Bad_NoEntryExists. (OPC UA Spec. Part 11 v1.01 6.7.3)
nodeId - the NodeId of the node whose history should be readperformInsertReplace - which action to take in updating (INSERT, REPLACE, UPDATE)updateValues - the values to be updated in historyStatusException - if the operation failsServerConnectionException - if we are not connected to the serverServiceException - if the service call failspublic boolean isAutoReconnect()
@Deprecated public boolean isConnected()
hasConnection() or hasConnected() instead.hasConnection() or hasConnected() instead.public boolean isInitTypeDictionaryAutoUsage()
TypeDictionary is read automatically when first encountering custom
Structures, unless already initialized at connect as defined by
isInitTypeDictionaryOnConnect().public boolean isInitTypeDictionaryOnConnect()
TypeDictionary is read automatically, when connecting to the server.public boolean isInitTypeDictionaryShallow()
public boolean isInReverseMode()
public boolean isKeepSubscriptions()
disconnect().public boolean isValidateCreateSessionResponseCert()
public boolean isValidateDiscoveredEndpoints()
discoverEndpoints().setValidateDiscoveredEndpoints(boolean)public boolean isValidateNonceLength()
setValidateNonceLength(boolean)public ReadResponse read(Double maxAge, TimestampsToReturn timestampsToReturn, ReadValueId... nodesToRead) throws ServiceException
ReadValueId[] nodesToRead = new ReadValueId[2];
// Scalar value or complete array
nodesToRead[0] = new ReadValueId(nodeId1, Attributes.Value, null,
null);
// Part of an array
NumericRange range = new NumericRange(1, 3);
nodesToRead[10] = new ReadValueId(nodeId2, Attributes.Value, range.toString(),
null);
final ReadResponse readResponse = read(UaClient.MAX_CACHE_AGE,
TimestampsToReturn.Both, nodesToRead);
final DataValue[] values = readResponse.getResults();
// Use the values:
if (values[0].getStatusCode().isGood())
System.out.println(values[0].getValue());
if (values[1].getStatusCode().isGood())
System.out.println(values[1].getValue());
timestampsToReturn - An enumeration that specifies the Timestamps to be returned for each
requested Variable Value Attribute.maxAge - Maximum age of the value to be read in milliseconds. The age of the value is
based on the difference between the ServerTimestamp and the time when the Server starts
processing the request. For example if the Client specifies a maxAge of 500 milliseconds
and it takes 100 milliseconds until the Server starts processing the request, the age of
the returned value could be 600 milliseconds prior to the time it was requested.
If the Server has one or more values of an Attribute that are within the maximum age, it
can return any one of the values or it can read a new value from the data source. The
number of values of an Attribute that a Server has depends on the number of
MonitoredItems that are defined for the Attribute. In any case, the Client can make no
assumption about which copy of the data will be returned.
If the Server does not have a value that is within the maximum age, it shall attempt to
read a new value from the data source. If the Server cannot meet the requested maxAge,
it returns its "best effort" value rather than rejecting the request. This may occur
when the time it takes the Server to process and return the new data value after it has
been accessed is greater than the specified maximum age.
If maxAge is set to 0, the Server shall attempt to read a new value from the data
source.
If maxAge is set to MAX_CACHE_AGE, the Server shall attempt to get a cached value.
Negative values are invalid for maxAge.nodesToRead - List of Nodes and their Attributes to read. For each entry in this list, a
StatusCode is returned, and if it indicates success, the Attribute Value is also
returned.
Note that DataEncoding may only be defined for the Value attribute - and the Java stack
currently only supports the binary encoding. So typically, it is best to leave it to
null.ServiceException - If the server returns a bad ServiceResult code for the service call.
The following result codes are expected: Bad_NothingToDo, Bad_TooManyOperations,
Bad_MaxAgeInvalid, Bad_TimestampsToReturnInvalidreadAsync(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]),
write(com.prosysopc.ua.stack.core.WriteValue...),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[])public AsyncResult<ReadResponse> readAsync(Double maxAge, TimestampsToReturn timestampsToReturn, ReadValueId... nodesToRead)
// Read the name of the objects folder, asynchronously.
NodeId myNodeId = Identifiers.ObjectsFolder;
// Provide a state listener with the call to watch the state transitions
// You may read the response when the state has changed to Complete
// - or wait for it, as is done below.
ClientServiceRequest r = server.readAsync(new StateListener<ClientServiceRequestState>() {
@Override
public void onStateTransition(IStatefulObject<ClientServiceRequestState, ?> sender,
ClientServiceRequestState oldState, ClientServiceRequestState newState) {
System.out.println(newState);
}
}, Server.MAX_CACHE_AGE, TimestampsToReturn.Both, new ReadValueId(myNodeId, Attributes.NodeId, null, null));
ReadResponse response = (ReadResponse) r.waitForResult();
assertTrue(response.getResponseHeader().getServiceResult().isGood());
DataValue[] v = response.getResults();
if (v[0].getStatusCode().isGood())
System.out.println(v[0].getValue().getValue()); // DataValue.Variant.Object
timestampsToReturn - An enumeration that specifies the Timestamps to be returned for each
requested Variable Value Attribute.maxAge - Maximum age of the value to be read in milliseconds. The age of the value is
based on the difference between the ServerTimestamp and the time when the Server starts
processing the request. For example if the Client specifies a maxAge of 500 milliseconds
and it takes 100 milliseconds until the Server starts processing the request, the age of
the returned value could be 600 milliseconds prior to the time it was requested. If the
Server has one or more values of an Attribute that are within the maximum age, it can
return any one of the values or it can read a new value from the data source. The number
of values of an Attribute that a Server has depends on the number of MonitoredItems that
are defined for the Attribute. In any case, the Client can make no assumption about
which copy of the data will be returned. If the Server does not have a value that is
within the maximum age, it shall attempt to read a new value from the data source. If
the Server cannot meet the requested maxAge, it returns its "best effort" value rather
than rejecting the request. This may occur when the time it takes the Server to process
and return the new data value after it has been accessed is greater than the specified
maximum age. If maxAge is set to 0, the Server shall attempt to read a new value from
the data source. If maxAge is set to the max Int32 value (@link Integer.MAX_VALUE), the
Server shall attempt to get a cached value. Negative values are invalid for maxAge.nodesToRead - List of Nodes and their Attributes to read. For each entry in this list, a
StatusCode is returned, and if it indicates success, the Attribute Value is also
returned.
Note that DataEncoding may only be defined for the Value attribute - and the Java stack
currently only supports the binary encoding. So typically, it is best to leave it to
null.ReadResponse). You can poll it, set a listener or wait for the result (or
error).read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
write(com.prosysopc.ua.stack.core.WriteValue...),
writeAsync(com.prosysopc.ua.stack.core.WriteValue...)public DataValue readAttribute(ExpandedNodeId nodeId, UnsignedInteger attributeId) throws ServiceException, StatusException
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...), readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]) or
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) instead, when you need to read several nodes or attributes.nodeId - The node to read. Only local nodes are supported.attributeId - The attribute to read. See Attributes for valid values.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue readAttribute(ExpandedNodeId nodeId, UnsignedInteger attributeId, NumericRange indexRange, Double maxCacheAge) throws ServiceException, StatusException
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...), readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]) or
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) instead, when you need to read several nodes or attributes.nodeId - The node to read. Only local nodes are supported.attributeId - The attribute to read. See Attributes for valid values.indexRange - An optional range of array indexes from which the value should be read.
Applies to the Value attribute only.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue readAttribute(NodeId nodeId, UnsignedInteger attributeId) throws ServiceException, StatusException
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...), readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]) or
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) instead, when you need to read several nodes or attributes.nodeId - The node to read.attributeId - The attribute to read. See Attributes for valid values.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue readAttribute(NodeId nodeId, UnsignedInteger attributeId, NumericRange indexRange, Double maxCacheAge) throws ServiceException, StatusException
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...), readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]) or
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) instead, when you need to read several nodes or attributes.nodeId - The node to read.attributeId - The attribute to read. See Attributes for valid values.indexRange - An optional range of array indexes from which the value should be read.
Applies to the Value attribute only.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue readAttribute(UaNodeId nodeId, UnsignedInteger attributeId) throws ServiceException, StatusException
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...), readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]) or
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) instead, when you need to read several nodes or attributes.nodeId - The node to read. Only local nodes are supported.attributeId - The attribute to read. See Attributes for valid values.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue readAttribute(UaNodeId nodeId, UnsignedInteger attributeId, NumericRange indexRange, Double maxCacheAge) throws ServiceException, StatusException
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...), readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]) or
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) instead, when you need to read several nodes or attributes.nodeId - The node to read. Only local nodes are supported.attributeId - The attribute to read. See Attributes for valid values.indexRange - An optional range of array indexes from which the value should be read.
Applies to the Value attribute only.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue[] readAttributes(ExpandedNodeId nodeId, UnsignedInteger... attributeIds) throws ServiceException, StatusException
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read
several nodes or attributes.nodeId - The node to read. Only local nodes are supported.attributeIds - The attributes to read. See Attributes for valid values.ServiceException - If the server returns a bad ServiceResult code for the service call.StatusException - If the server returns a bad status for the value.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue[] readAttributes(ExpandedNodeId nodeId, UnsignedInteger[] attributeIds, NumericRange[] indexRanges, Double maxCacheAge) throws ServiceException, StatusException
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read
several nodes or attributes.nodeId - The node to read. Only local nodes are supported.attributeIds - The attributes to read. See Attributes for valid values.indexRanges - Optional ranges of array indexes from which the values should be read.
Applies to the Value attribute only.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.StatusException - If the server returns a bad status for the value.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue[] readAttributes(NodeId nodeId, UnsignedInteger... attributeIds) throws ServiceException
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read
several nodes or attributes.nodeId - The node to read.attributeIds - The attributes to read. See Attributes for valid values.ServiceException - If the server returns a bad ServiceResult code for the service call.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue[] readAttributes(NodeId nodeId, UnsignedInteger[] attributeIds, NumericRange[] indexRanges, Double maxCacheAge) throws ServiceException
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read
several nodes or attributes.nodeId - The node to read.attributeIds - The attributes to read. See Attributes for valid values.indexRanges - Optional ranges of array indexes from which the values should be read.
Applies to the Value attribute only.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue[] readAttributes(UaNodeId nodeId, UnsignedInteger... attributeIds) throws ServiceException, StatusException
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read
several nodes or attributes.nodeId - The node to read. Only local nodes are supported.attributeIds - The attributes to read. See Attributes for valid values.ServiceException - If the server returns a bad ServiceResult code for the service call.StatusException - If the server returns a bad status for the value.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue[] readAttributes(UaNodeId nodeId, UnsignedInteger[] attributeIds, NumericRange[] indexRanges, Double maxCacheAge) throws ServiceException, StatusException
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read
several nodes or attributes.nodeId - The node to read. Only local nodes are supported.attributeIds - The attributes to read. See Attributes for valid values.indexRanges - Optional ranges of array indexes from which the values should be read.
Applies to the Value attribute only.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.StatusException - If the server returns a bad status for the value.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...)public DataValue readValue(ExpandedNodeId nodeId) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.nodeId - The node to read. Only local nodes are supported.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue readValue(ExpandedNodeId nodeId, Double maxCacheAge) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.nodeId - The node to read. Only local nodes are supported.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue readValue(ExpandedNodeId nodeId, NumericRange indexRange) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.
For example:
// Read element #1 of the array
client.readValue(arrayVariableId, new NumericRange(1));
// Read elements #1-#3 of the one-dimensional array
client.readValue(arrayVariableId, new NumericRange(1, 3));
// Read elements #1-#2/#2-#3 of the two-dimensional array
client.readValue(arrayVariableId, new NumericRange(new int[] {1, 2}, new int[] {2, 3}));
nodeId - The node to read. Only local nodes are supported.indexRange - An optional range of array indexes from which the value should be read.
Applies to the Value attribute only.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue readValue(ExpandedNodeId nodeId, NumericRange indexRange, Double maxCacheAge) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.
For example:
// Read element #1 of the array - from device (maxCacheAge=0)
client.readValue(arrayVariableId, new NumericRange(1), 0);
// Read elements #1-#3 of the one-dimensional array
client.readValue(arrayVariableId, new NumericRange(1, 3), 0);
// Read elements #1-#2/#2-#3 of the two-dimensional array
client.readValue(arrayVariableId, new NumericRange(new int[] {1, 2}, new int[] {2, 3}), 0);
nodeId - The node to read. Only local nodes are supported.indexRange - An optional range of array indexes from which the value should be read.
Applies to the Value attribute only.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue readValue(NodeId nodeId) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.nodeId - The node to read.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue readValue(NodeId nodeId, Double maxCacheAge) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.nodeId - The node to read.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue readValue(NodeId nodeId, NumericRange indexRange) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.
For example:
// Read element #1 of the array
client.readValue(arrayVariableId, new NumericRange(1));
// Read elements #1-#3 of the one-dimensional array
client.readValue(arrayVariableId, new NumericRange(1, 3));
// Read elements #1-#2/#2-#3 of the two-dimensional array
client.readValue(arrayVariableId, new NumericRange(new int[] {1, 2}, new int[] {2, 3}));
nodeId - The node to read.indexRange - An optional range of array indexes from which the value should be read.
Applies to the Value attribute only.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue readValue(NodeId nodeId, NumericRange indexRange, Double maxCacheAge) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.
For example:
// Read element #1 of the array - from device (maxCacheAge=0)
client.readValue(arrayVariableId, new NumericRange(1), 0);
// Read elements #1-#3 of the one-dimensional array
client.readValue(arrayVariableId, new NumericRange(1, 3), 0);
// Read elements #1-#2/#2-#3 of the two-dimensional array
client.readValue(arrayVariableId, new NumericRange(new int[] {1, 2}, new int[] {2, 3}), 0);
nodeId - The node to read.indexRange - An optional range of array indexes from which the value should be read.
Applies to the Value attribute only.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue readValue(UaNodeId nodeId) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.nodeId - The node to read. Only local nodes are supported.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue readValue(UaNodeId nodeId, Double maxCacheAge) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.nodeId - The node to read. Only local nodes are supported.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue readValue(UaNodeId nodeId, NumericRange indexRange) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.
For example:
// Read element #1 of the array
client.readValue(arrayVariableId, new NumericRange(1));
// Read elements #1-#3 of the one-dimensional array
client.readValue(arrayVariableId, new NumericRange(1, 3));
// Read elements #1-#2/#2-#3 of the two-dimensional array
client.readValue(arrayVariableId, new NumericRange(new int[] {1, 2}, new int[] {2, 3}));
nodeId - The node to read. Only local nodes are supported.indexRange - An optional range of array indexes from which the value should be read.
Applies to the Value attribute only.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue readValue(UaNodeId nodeId, NumericRange indexRange, Double maxCacheAge) throws ServiceException, StatusException
readValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[]), readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...) or
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...) instead, when you need to read several nodes or attributes.
For example:
// Read element #1 of the array - from device (maxCacheAge=0)
client.readValue(arrayVariableId, new NumericRange(1), 0);
// Read elements #1-#3 of the one-dimensional array
client.readValue(arrayVariableId, new NumericRange(1, 3), 0);
// Read elements #1-#2/#2-#3 of the two-dimensional array
client.readValue(arrayVariableId, new NumericRange(new int[] {1, 2}, new int[] {2, 3}), 0);
nodeId - The node to read. Only local nodes are supported.indexRange - An optional range of array indexes from which the value should be read.
Applies to the Value attribute only.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(ExpandedNodeId[] nodeIds) throws ServiceException, StatusException
nodeIds - The nodes to read. Only local nodes are supported.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(ExpandedNodeId[] nodeIds, NumericRange[] indexRanges) throws ServiceException, StatusException
nodeIds - The nodes to read. Only local nodes are supported.indexRanges - Optional ranges of array indexes from which the values should be read.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(ExpandedNodeId[] nodeIds, NumericRange[] indexRanges, TimestampsToReturn timestamps) throws ServiceException, StatusException
nodeIds - The nodes to read. Only local nodes are supported.indexRanges - Optional ranges of array indexes from which the values should be read.timestamps - Define which timestamps to return with each value. The default is to request
TimestampsToReturn.Both.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(ExpandedNodeId[] nodeIds, NumericRange[] indexRanges, TimestampsToReturn timestamps, Double maxCacheAge) throws ServiceException, StatusException
nodeIds - The nodes to read. Only local nodes are supported.indexRanges - Optional ranges of array indexes from which the values should be read.timestamps - Define which timestamps to return with each value. The default is to request
TimestampsToReturn.Both.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(ExpandedNodeId[] nodeIds, TimestampsToReturn timestamps) throws ServiceException, StatusException
nodeIds - The nodes to read. Only local nodes are supported.timestamps - Define which timestamps to return with each value.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(NodeId[] nodeIds) throws ServiceException
nodeIds - The nodes to read.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(NodeId[] nodeIds, NumericRange[] indexRanges) throws ServiceException
nodeIds - The nodes to read.indexRanges - Optional ranges of array indexes from which the values should be read.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(NodeId[] nodeIds, NumericRange[] indexRanges, TimestampsToReturn timestamps) throws ServiceException
nodeIds - The nodes to read.indexRanges - Optional ranges of array indexes from which the values should be read.timestamps - Define which timestamps to return with each value. The default is to request
TimestampsToReturn.Both.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(NodeId[] nodeIds, NumericRange[] indexRanges, TimestampsToReturn timestamps, Double maxCacheAge) throws ServiceException
nodeIds - The nodes to read.indexRanges - Optional ranges of array indexes from which the values should be read.timestamps - Define which timestamps to return with each value. The default is to request
TimestampsToReturn.Both.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(NodeId[] nodeIds, TimestampsToReturn timestamps) throws ServiceException
nodeIds - The nodes to read.timestamps - Define which timestamps to return with each value.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(UaNodeId[] nodeIds) throws ServiceException, StatusException
nodeIds - The nodes to read. Only local nodes are supported.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(UaNodeId[] nodeIds, NumericRange[] indexRanges) throws ServiceException, StatusException
nodeIds - The nodes to read. Only local nodes are supported.indexRanges - Optional ranges of array indexes from which the values should be read.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(UaNodeId[] nodeIds, NumericRange[] indexRanges, TimestampsToReturn timestamps) throws ServiceException, StatusException
nodeIds - The nodes to read. Only local nodes are supported.indexRanges - Optional ranges of array indexes from which the values should be read.timestamps - Define which timestamps to return with each value. The default is to request
TimestampsToReturn.Both.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(UaNodeId[] nodeIds, NumericRange[] indexRanges, TimestampsToReturn timestamps, Double maxCacheAge) throws ServiceException, StatusException
nodeIds - The nodes to read. Only local nodes are supported.indexRanges - Optional ranges of array indexes from which the values should be read.timestamps - Define which timestamps to return with each value. The default is to request
TimestampsToReturn.Both.maxCacheAge - Maximum accepted age of the value. If the server has an older value in its
cache, it should go and read a new value from the source (e.g. device) instead of
returning the value from cache. The default equals to Integer.MAX_VALUE (as Double).ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public DataValue[] readValues(UaNodeId[] nodeIds, TimestampsToReturn timestamps) throws ServiceException, StatusException
nodeIds - The nodes to read. Only local nodes are supported.timestamps - Define which timestamps to return with each value.ServiceException - If the server returns a bad ServiceResult code for the service call.
Read the exception for the error details and diagnostics.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics.readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger),
readAttributes(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger...),
read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object)public boolean reconnect()
throws ServiceException,
ConnectException,
SessionActivationException
setAutoReconnect(boolean) to disable the automatic system first.ServiceException - if the service call to create the secure channel failsConnectException - if the session could not be createdSessionActivationException - if the session activation call fails (for example, user
authentication failed)IllegalStateException - if called while isAutoReconnect() is true (in
this case SDK is handling reconnects automatically).public void registerModel(ClientCodegenModel codegenModel)
codegenModel - the model created by the codegen.public boolean removeServerStatusListener(ServerStatusListener serverStatusListener)
serverStatusListener - public StatusCode removeSubscription(Subscription subscription) throws ServiceException
isConnected the subscription is also
deleted from the server.subscription - ServiceException - if the service call fails.removeSubscriptions(com.prosysopc.ua.client.Subscription[]),
addSubscription(com.prosysopc.ua.client.Subscription),
getSubscription(int),
getSubscriptionCount()public StatusCode[] removeSubscriptions(Subscription[] subscriptions) throws ServiceException
isConnected the subscriptions are also
removed from the server.subscriptions - The subscriptions to remove.ServiceException - if the service call fails.removeSubscription(com.prosysopc.ua.client.Subscription),
addSubscription(com.prosysopc.ua.client.Subscription),
getSubscription(int),
getSubscriptionCount()public AsyncResult<StatusCode[]> removeSubscriptionsAsync(Subscription... subscriptions) throws ServiceException
isConnected the
subscriptions are also removed from the server. The method does not wait for the operation to
terminate before it returns.subscriptions - The subscriptions to remove.ServiceExceptionremoveSubscriptions(com.prosysopc.ua.client.Subscription[]),
addSubscription(com.prosysopc.ua.client.Subscription),
getSubscription(int),
getSubscriptionCount()public void resetEndpoint()
setEndpoint(EndpointDescription) with null.public <T extends ServiceResponse> T serviceRequest(ServiceRequest<T> request) throws ServiceException
T - request - The service request object, e.g. TestStackRequestServiceException - if the service call failsserviceRequestAsync(com.prosysopc.ua.stack.builtintypes.ServiceRequest<T>)public <T extends ServiceResponse> AsyncResult<T> serviceRequestAsync(ServiceRequest<T> request) throws ServiceException
T - request - The service request object, e.g. TestStackRequestServiceExceptionpublic <T extends ServiceResponse> T sessionlessRequest(ServiceRequest<T> request) throws InvalidServerEndpointException, ServerConnectionException, ServiceException
hasConnected() (with a session), serviceRequest(ServiceRequest) will be
called.T - request - the service request to sendInvalidServerEndpointException - if Uri is not valid, or not listed in the server's list
of endpointsServerConnectionException - if connection to the server failsServiceException - if the service call failspublic void setAddress(String address)
isConnected.
Equals to calling setAddress(UaAddress.parse(address));address - The connection address of the server. The address is expected to be in format
'UaAddress.parse(java.lang.String) for
details.IllegalArgumentException - if the address is not valid.setAddress(UaAddress)public void setAddress(UaAddress address)
connect(), that is when
isConnected.address - server address to connect to.connect()public void setApplicationIdentity(ApplicationIdentity applicationIdentity)
connect() to it.applicationIdentity - public void setAuditEntryId(String auditEntryId)
auditEntryId - the auditEntryId to setpublic void setAutoReconnect(boolean doAutoReconnect)
doAutoReconnect - When true, the UaClient will try to reconnect automatically to the
server, when communication fails.public void setConnectTimeout(int connectionTimeoutMilliseconds)
connect() can take longer than the
specified value, if the initial connection was obtained in-time. Default value is 60 seconds,
i.e. 60000. Note that regardless of this value, the Operating System may timeout the connection
earlier. On reverse connections, this value is used to determine how long the client waits for
server-initiated connection.public void setConnectTimeout(int value,
TimeUnit timeUnit)
#setConnectionTimeout(long) taking specific time units. Values
that would resolve to be less than one millisecond are treated as 0.value - value in given timeUnits.timeUnit - given timeUnits.public void setDefaultMaxAge(double defaultMaxAge)
defaultMaxAge - duration to use, must be 0 or positive. Values higher than Int32 max value
are not recommended, as they should all behave the same according to the specification
(i.e. server should use cached value).IllegalArgumentException - if given value is less than 0public void setDefaultTimestampsToReturn(TimestampsToReturn defaultTimestampsToReturn)
TimestampsToReturn.Both.public void setEndpoint(EndpointDescription endpoint)
hasConnected() when changing the endpoint.endpoint - the endpoint to use.setAddress(java.lang.String)public void setInitTypeDictionaryAutoUsage(boolean initTypeDictionaryAutoUsage)
TypeDictionary is initialized automatically, when custom Structures are
encountered for the first time.
Calling this method after connect() does not affect the current connection, only the
subsequent connections.
Default is true.
public void setInitTypeDictionaryOnConnect(boolean initTypeDictionaryOnConnect)
TypeDictionary is initialized automatically after connect().
If false, the dictionaries are initialized when first encountered, if
isInitTypeDictionaryAutoUsage() is true.
Calling this method after connect() does not affect the current connection, only the
subsequent connections.
Default is true.
public void setInitTypeDictionaryShallow(boolean initTypeDictionaryShallow)
TypeDictionary will consider it as initialized if it would be
initialized, but doesn't do any of the normal initialization procedures, such as reading the
types of the server. This can be used to cause TypeDictionary only work in a reactive
mode by trying to fetch metadata for UaDataTypeSpecification per encountered DataType.
However note that this does work with legacy DataTypeDictionaries only for DataTypes supporting
the OPC UA 1.04 DataTypeDefinition Attribute. If false (the default), the TypeDictionary works
normally when it initializes (reads all types). This flag should only put to true if knowing
connecting to a server known to support 1.04 DataTypeDefinition and additionally for some
reason the normal initialization is not good enough. In this case setting this to true might
offer performance improvement regarding connection speed, but may offer reductions to any
AddressSpace.getNode(NodeId) calls (it should also be noted that these are needed
internally to resolve the metadata for UaDataTypeSpecification).public void setKeepSubscriptions(boolean keepSubscriptions)
keepSubscriptions - public void setListener(UaClientListener listener)
listener - the listener to setpublic void setLocale(Locale locale)
locale - the locale to setpublic void setMaxResponseMessageSize(int maxResponseMessageSize)
maxResponseMessageSize - the maxResponseMessageSize to set, the value must be a positive
value. Default is 0, which means that it is not used.public void setMaxResponseMessageSize(UnsignedInteger maxResponseMessageSize)
maxResponseMessageSize - the maxResponseMessageSize to set. Default is 0, which means that
it is not used. Null is interpreted as 0.public void setOperationDiagnosticMask(EnumSet<UaApplication.DiagnosticMask> operationDiagnosticMask)
operationDiagnosticMask - setServiceDiagnosticMask(java.util.EnumSet<com.prosysopc.ua.UaApplication.DiagnosticMask>)public void setPublishRequestFactor(double publishRequestFactor)
publishRequestFactor - the new publish request factor. This should normally be at least 1.
The default value is 2. When the latency to the server is high, you might like to
increase the number.
If you set it to 0 (or negative), no publishRequests will be sent.public void setPublishRequestSetpoint(int publishRequestSetpoint)
getPublishRequestFactor() and getSubscriptionCount() and
automatically adjusted, if the server sends Bad_TooManyPublishRequest errors for the
PublishRequests.publishRequestSetpoint - the new setpoint value. Use 0 to reset the counter to the default
(calculated) value.public void setPublishRequestTimeout(long publishRequestTimeout)
UnsignedInteger.MAX_VALUE (~infinite)publishRequestTimeout - the timeout in milliseconds, must be a positive value. 0 means no
timeout, but it seems that some servers interpret this like timeout immediately.public void setPublishRequestTimeout(long publishRequestTimeout,
TimeUnit timeUnit)
UnsignedInteger.MAX_VALUE (~infinite)publishRequestTimeout - the timeout publishRequestTimeout. 0 means no timeout, but it
seems that some servers interpret this like timeout immediately.timeUnit - the time unit of publishRequestTimeout (default is milliseconds)setPublishRequestTimeout(long)public void setPublishRequestTimeout(UnsignedInteger publishRequestTimeout)
UnsignedInteger.MAX_VALUEpublishRequestTimeout - the timeout publishRequestTimeout. 0 means no timeout, but it
seems that some servers interpret this like timeout immediately, so it will be converted
to UnsignedInteger.MAX_VALUE.public void setReverseAddress(UaAddress clientListenAddress)
connect(), the client will start listening to server-initiated
connections at this address, according to the OPC UA Specification Part 6. The transport
protocol must be 'opc.tcp' and ServerName should be empty. Naturally, the hostname must
correspond to an actual hostname or IP address of the local machine.
If you do not want to specify the hostname and only wish to bind to all local addresses you can
use setReversePort(int) instead to set a wildcard address. Alternatively, you can
create a wildcard address with UaAddress.wildcardOpcTcp(int)).
You can use setReverseConnectionListener(ReverseConnectionListener) to define a custom
handler that can validate that the incoming calls are coming from an expected server. If
getSecurityMode() defines a secure connection the server certificate must be trusted
in order to enable the connection as well.IllegalArgumentException - if the given UaAddress cannot be used for reverse
connectionsisInReverseMode(),
setReversePort(int),
setReverseConnectionListener(ReverseConnectionListener)public void setReverseConnectionListener(ReverseConnectionListener reverseConnectionListener)
getSecurityMode() defines a secure connection the
server certificate must be trusted in order to enable the connection as well.setReverseAddress(UaAddress),
setReversePort(int),
connect()public void setReversePort(int port)
setReverseAddress(UaAddress) with an address
created by UaAddress.wildcardOpcTcp(int).public void setSecurityMode(SecurityMode securityMode)
SecurityMode as a parameter instead of defining your own
values.
You cannot change the setting when isConnected.securityMode - the new security modeIllegalStateException - if connected when calledpublic void setServiceDiagnosticMask(EnumSet<UaApplication.DiagnosticMask> serviceDiagnosticMask)
serviceDiagnosticMask - setOperationDiagnosticMask(java.util.EnumSet<com.prosysopc.ua.UaApplication.DiagnosticMask>)public void setSessionName(String sessionName)
sessionName - the sessionName to setpublic void setSessionTimeout(double sessionTimeout)
connect(). The revised value can be checked from the current session, available from
getSession().
Changes to the value will not take effect until you reconnect().
Default is one hour (3600000 ms)sessionTimeout - the sessionTimeout to set.public void setSessionTimeout(long sessionTimeout,
TimeUnit timeUnit)
public void setSocketFactory(TcpConnection.SocketFactory socketFactory)
TcpConnection.DefaultSocketFactory used by
TcpConnection.getSocketFactory() for opc.tcp connections (during connect())
reverse connections). If null (the default), the TcpConnection.getSocketFactory() is
used.public void setStatusCheckInterval(long statusCheckInterval)
statusCheckInterval - The interval in milliseconds. Use 0 to disable the status check.setStatusCheckTimeout(long)public void setStatusCheckInterval(long statusCheckInterval,
TimeUnit timeUnit)
public void setStatusCheckTimeout(long statusCheckTimeout)
updateServerStatus().
If you suspect that the server may be busy, or you get a lot of timeouts which cause the status
to go to CommunicationFault, you should increase the timeout from the default.
Default: 10000 msstatusCheckTimeout - the statusCheckTimeout to set (in milliseconds)setStatusCheckInterval(long)public void setStatusCheckTimeout(long statusCheckTimeout,
TimeUnit timeUnit)
setStatusCheckTimeout(long)public void setTimeout(long timeOut)
getEndpointConfiguration() should be used.timeOut - time the new timeout value to set, in millisecondspublic void setTimeout(long timeOut,
TimeUnit timeUnits)
getEndpointConfiguration() should be used.timeOut - time the new timeout value to setpublic void setTimeout(UnsignedInteger timeOut)
getEndpointConfiguration() should be used.timeOut - time the new timeout value to set, in milliseconds@Deprecated public void setUri(String uri)
setAddress(String) instead.connect() call.
The server will be connected using the host name and port. It is then queried for endpoints and
a suitable one will be picked, even when no exact match is found. In that case a warning
message will be display in the log messages.
You cannot change the setting when isConnected.
uri - The server URI to set.public void setUserIdentity(UserIdentity userIdentity) throws SessionActivationException
isConnected, the session
is reactivated using the new user identity.userIdentity - the new identity. If null, the default, anonymous authentication is setSessionActivationException - if the session activation fails with the new identitypublic void setValidateCreateSessionResponseCert(boolean validateCreateSessionResponseCert)
public void setValidateDiscoveredEndpoints(boolean validateDiscoveredEndpoints)
By default, the endpoints are validated, but some servers provide different endpointUrls for the GetEndpoints and CreateSession service responses and may therefore fail at connection. You can set this flag to false, if you know that the server is safe to be connected even without the check. Default is true. The check is required for OPC UA compliance.
public void setValidateNonceLength(boolean validateNonceLength)
By default the check is on, and it makes sure that the server sends long enough Nonces to provide proper session security. In case some server does not support secure conncetions and requires user authentication with plain-text passwords, for example, this check needs to be disabled, in order to enable the connection. Default is true. The check is required for OPC UA compliance.
public void updateServerStatus()
public WriteResponse write(WriteValue... nodesToWrite) throws ServiceException
nodesToWrite - List of Nodes and their Attributes to write.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.read(java.lang.Double, com.prosysopc.ua.stack.core.TimestampsToReturn, com.prosysopc.ua.stack.core.ReadValueId...),
writeAsync(com.prosysopc.ua.stack.core.WriteValue...),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[]),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public AsyncResult<WriteResponse> writeAsync(WriteValue... nodesToWrite)
// Write the name of the objects folder, asynchronously.
NodeId myNodeId = Identifiers.ObjectsFolder;
// Provide a state listener with the call to watch the state transitions
// You may read the response when the state has changed to Complete
// - or wait for it, as is done below.
ClientServiceRequest r = server.writeAsync(new StateListener<ClientServiceRequestState>() {
@Override
public void onStateTransition(IStatefulObject<ClientServiceRequestState, ?> sender,
ClientServiceRequestState oldState, ClientServiceRequestState newState) {
System.out.println(newState);
}
}, new WriteValue(OBJECTSFOLDER_NODEID, Attributes.BrowseName, null,
new DataValue(new Variant(new QualifiedName("Obj")), StatusCode.GOOD)));
WriteResponse response = (WriteResponse) r.waitForResult();
StatusCode[] v = response.getResults();
System.out.println(v[0]);
nodesToWrite - List of Nodes and their Attributes to write. For each entry in this list, a
StatusCode is returned.WriteResponse). You can poll it, set a listener or wait for the result (or
error).write(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[]),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public boolean writeAttribute(ExpandedNodeId nodeId, UnsignedInteger attributeId, Object value) throws ServiceException, StatusException
nodeId - The nodeattributeId - The attribute of the node. See Attributes for valid values.value - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeAsync(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger)public boolean writeAttribute(ExpandedNodeId nodeId, UnsignedInteger attributeId, Object value, boolean autoConvert) throws DataTypeConversionException, ServiceException, StatusException
nodeId - The nodeattributeId - The attribute of the node. See Attributes for valid values.autoConvert - if true, the value will be automatically converted to the DataType of the
specified Attribute, note that for Value Attributes the UaClient will first Read the
DataType Attribute of the node. If false, value will be written as-is.value - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.DataTypeConversionException - if the dataTypeConversion cannot be doneServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeAsync(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger)public boolean writeAttribute(ExpandedNodeId nodeId, UnsignedInteger attributeId, Object value, NumericRange indexRange) throws ServiceException, StatusException
nodeId - The nodeattributeId - The attribute of the node. See Attributes for valid values.value - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.indexRange - An optional range of array indexes to which the value should be written to.
Applies to the Value attribute only.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeAsync(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger)public boolean writeAttribute(NodeId nodeId, UnsignedInteger attributeId, Object value) throws ServiceException, StatusException
nodeId - The nodeattributeId - The attribute of the node. See Attributes for valid values.value - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeAsync(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger)public boolean writeAttribute(NodeId nodeId, UnsignedInteger attributeId, Object value, boolean autoConvert) throws DataTypeConversionException, ServiceException, StatusException
nodeId - The nodeattributeId - The attribute of the node. See Attributes for valid values.autoConvert - if true, the value will be automatically converted to the DataType of the
specified Attribute, note that for Value Attributes the UaClient will first Read the
DataType Attribute of the node. If false, value will be written as-is.value - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.DataTypeConversionException - if the dataTypeConversion cannot be doneServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeAsync(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger)public boolean writeAttribute(NodeId nodeId, UnsignedInteger attributeId, Object value, NumericRange indexRange) throws ServiceException, StatusException
nodeId - The nodeattributeId - The attribute of the node. See Attributes for valid values.value - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.indexRange - An optional range of array indexes to which the value should be written to.
Applies to the Value attribute only.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeAsync(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger)public boolean writeAttribute(UaNodeId nodeId, UnsignedInteger attributeId, Object value) throws ServiceException, StatusException
nodeId - The nodeattributeId - The attribute of the node. See Attributes for valid values.value - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeAsync(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger)public boolean writeAttribute(UaNodeId nodeId, UnsignedInteger attributeId, Object value, boolean autoConvert) throws DataTypeConversionException, ServiceException, StatusException
nodeId - The nodeattributeId - The attribute of the node. See Attributes for valid values.autoConvert - if true, the value will be automatically converted to the DataType of the
specified Attribute, note that for Value Attributes the UaClient will first Read the
DataType Attribute of the node. If false, value will be written as-is.value - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.DataTypeConversionException - if the dataTypeConversion cannot be doneServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeAsync(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger)public boolean writeAttribute(UaNodeId nodeId, UnsignedInteger attributeId, Object value, NumericRange indexRange) throws ServiceException, StatusException
nodeId - The nodeattributeId - The attribute of the node. See Attributes for valid values.value - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.indexRange - An optional range of array indexes to which the value should be written to.
Applies to the Value attribute only.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeAsync(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger)public boolean writeValue(ExpandedNodeId nodeId, Object value) throws ServiceException, StatusException
nodeId - The nodevalue - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[]),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public boolean writeValue(ExpandedNodeId nodeId, Object value, boolean autoConvert) throws DataTypeConversionException, ServiceException, StatusException
nodeId - The nodevalue - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.autoConvert - if true, the value will be automatically converted to the DataType of the
variable, note that the UaClient will first Read the DataType Attribute of the node. If
false, value will be written as-is.DataTypeConversionException - if the dataTypeConversion failsServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[]),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public boolean writeValue(ExpandedNodeId nodeId, Object value, NumericRange indexRange) throws ServiceException, StatusException
nodeId - The nodevalue - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.indexRange - An optional range of array indexes to which the value should be written toServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[]),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public boolean writeValue(NodeId nodeId, Object value) throws ServiceException, StatusException
nodeId - The nodevalue - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[]),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public boolean writeValue(NodeId nodeId, Object value, boolean autoConvert) throws DataTypeConversionException, ServiceException, StatusException
nodeId - The nodevalue - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.autoConvert - if true, the value will be automatically converted to the DataType of the
variable, note that the UaClient will first Read the DataType Attribute of the node. If
false, value will be written as-is.DataTypeConversionException - if the dataTypeConversion failsServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[]),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public boolean writeValue(NodeId nodeId, Object value, NumericRange indexRange) throws ServiceException, StatusException
nodeId - The nodevalue - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.indexRange - An optional range of array indexes to which the value should be written toServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[]),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public boolean writeValue(UaNodeId nodeId, Object value) throws ServiceException, StatusException
nodeId - The nodevalue - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[]),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public boolean writeValue(UaNodeId nodeId, Object value, boolean autoConvert) throws DataTypeConversionException, ServiceException, StatusException
nodeId - The nodevalue - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.autoConvert - if true, the value will be automatically converted to the DataType of the
variable, note that the UaClient will first Read the DataType Attribute of the node. If
false, value will be written as-is.DataTypeConversionException - if the dataTypeConversion failsServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[]),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public boolean writeValue(UaNodeId nodeId, Object value, NumericRange indexRange) throws ServiceException, StatusException
nodeId - The nodevalue - The new value to write. The value may be a DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.indexRange - An optional range of array indexes to which the value should be written toServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchwrite(com.prosysopc.ua.stack.core.WriteValue...),
writeValues(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId[], java.lang.Object[]),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public StatusCode[] writeValues(ExpandedNodeId[] nodeIds, Object[] value) throws ServiceException
nodeIds - The nodevalue - The new values to write. The values may be DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.write(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public StatusCode[] writeValues(ExpandedNodeId[] nodeIds, Object[] values, NumericRange[] indexRanges) throws ServiceException
nodeIds - The nodevalues - The new values to write. The values may be DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.indexRanges - Optional ranges of array indexes to which the values should be written to.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.write(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public StatusCode[] writeValues(NodeId[] nodeIds, Object[] value) throws ServiceException
nodeIds - The nodevalue - The new values to write. The values may be DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.write(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public StatusCode[] writeValues(NodeId[] nodeIds, Object[] values, NumericRange[] indexRanges) throws ServiceException
nodeIds - The nodevalues - The new values to write. The values may be DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.indexRanges - Optional ranges of array indexes to which the values should be written to.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.write(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public StatusCode[] writeValues(UaNodeId[] nodeIds, Object[] value) throws ServiceException
nodeIds - The nodevalue - The new values to write. The values may be DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.write(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)public StatusCode[] writeValues(UaNodeId[] nodeIds, Object[] values, NumericRange[] indexRanges) throws ServiceException
nodeIds - The nodevalues - The new values to write. The values may be DataValue, Variant or of native data
type. Use DataValue, if you wish to set the status and timestamp as well.indexRanges - Optional ranges of array indexes to which the values should be written to.ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.write(com.prosysopc.ua.stack.core.WriteValue...),
writeValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, java.lang.Object),
readValue(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId),
writeAttribute(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.UnsignedInteger, java.lang.Object)protected void addSubscriptionAck(SubscriptionAcknowledgement ack)
protected HttpsSecurityPolicy[] getHttpsSecurityPolicies()
getSecurityMode() is typically NONE, but the transport security must be a secure one.
Default is HttpsSecurityPolicy#ALL.setHttpsSecurityPolicies(com.prosysopc.ua.stack.transport.security.HttpsSecurityPolicy[])protected void resetPublishRequestSetpoint()
protected void resetSubscriptionsAfterRemove(Subscription[] subscriptions, StatusCode[] result)
subscriptions - result - protected UaAddress resolveConnectionAddress(UaAddress connectionAddress, EndpointDescription discoveredEndpoint)
getAddress()).
By default uses the UaAddress.getProtocol(), UaAddress.getHost() and
UaAddress.getPort() components from the connection address. The ServerName component
comes from the EndpointDescription.getEndpointUrl().protected void setHttpsSecurityPolicies(HttpsSecurityPolicy[] httpsSecurityPolicies)
getSecurityMode() is typically NONE, but the transport security must be a secure one.
You can enable all or just some of the policies. The applications will then negotiate a common
security mode with each other.
Default is HttpsSecurityPolicy#ALL.httpsSecurityPolicies - the policies to setprotected <T extends ServiceResponse> void validateServiceRequest(ServiceRequest<T> request) throws ServiceResultException
ServiceRequest is sent to the server (during a
Session). By default this method does nothing, but can be used if there is need to change the
request or prevent it's sending (by throwing) or to log the request.
IMPORTANT! The request is as-is as it would be sent. This includes the required authentication token within the RequestHeader. After any modification, the same token must exist within the RequestHeader of the request. Additionally, this method is called for every request (except CreateSession and calls related to the secure channel itself), including SDK internal calls to e.g. read the ServerStatus, thus care should be taken to preferably not edit those.
ServiceResultException - if the request should not be transmitted to the underlying
channelCopyright © 2026. All rights reserved.