public class UaLoopbackClient extends UaClient
UaClient, that directly sends service calls (inside java) to an UaServer
instance. Instances of this class are only designed to be instantiated by the SDK and
constructors of this class can change at will. Methods related to connecting and connection
parameters shall not be called and are marked as Deprecated (as this client is always
"connected"). All operations performed by this client is equal to the
Session.INTERNAL_SESSION of the server, i.e. there is no "user"
per se, but in practice this means this client can access anything in the server.| Modifier and Type | Class and Description |
|---|---|
static class |
UaLoopbackClient.InternalEndpointServiceRequest
Internal, but used from multiple packages.
|
UaApplication.DiagnosticMask, UaApplication.ProtocolMAX_CACHE_AGE| Constructor and Description |
|---|
UaLoopbackClient(UaServer server,
Consumer<EndpointServiceRequest<?,?>> requestConsumer)
Internal (but used from other packages, thus public).
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Deprecated.
UaLoopbackClient cannot be connected or disconnected, it is always
connected. |
protected ServiceContext |
createServiceContext(ServiceRequest<ServiceResponse> request)
Create a
ServiceContext for the given request. |
void |
disconnect()
Deprecated.
UaLoopbackClient cannot be connected or disconnected, it is always
connected. |
void |
disconnect(long timeout)
Deprecated.
UaLoopbackClient cannot be connected or disconnected, it is always
connected. |
void |
disconnect(long timeout,
TimeUnit timeUnit)
Deprecated.
UaLoopbackClient cannot be connected or disconnected, it is always
connected. |
void |
disconnect(UnsignedInteger timeout)
Deprecated.
UaLoopbackClient cannot be connected or disconnected, it is always
connected. |
OperationLimits |
getActualOperationLimits()
Returns the actual operation limits i.e.
|
ApplicationIdentity |
getApplicationIdentity()
Deprecated.
use
UaServer.getApplicationIdentity() instead directly. |
EncoderContext |
getEncoderContext() |
NamespaceTable |
getNamespaceTable()
The server NamespaceTable.
|
NamespaceTable |
getNamespaceTable(boolean forceRefresh)
The server NamespaceTable.
|
SecurityMode |
getSecurityMode()
Deprecated.
concept doesn't apply.
|
ServerStatusDataType |
getServerStatus()
The status of the server that we are connected.
|
UserIdentity |
getUserIdentity()
Deprecated.
UaLoopbackClient identity is equals to
Session.INTERNAL_SESSION. |
boolean |
hasConnected()
The
UaLoopbackClient is always connected, always returns true. |
boolean |
hasConnection()
The
UaLoopbackClient is always connected, always returns true. |
boolean |
isAutoReconnect()
Automatic reconnection setting.
|
boolean |
isConnected()
Deprecated.
use
hasConnection() or hasConnected() instead. |
void |
setAddress(String address)
Deprecated.
|
void |
setAddress(UaAddress address)
Deprecated.
|
void |
setEndpoint(EndpointDescription endpoint)
Deprecated.
|
void |
setReverseAddress(UaAddress clientListenAddress)
Deprecated.
|
void |
setSecurityMode(SecurityMode securityMode)
Deprecated.
|
void |
setUri(String uri)
Deprecated.
|
void |
setUserIdentity(UserIdentity userIdentity)
Deprecated.
UaLoopbackClient identity is equals to
Session.INTERNAL_SESSION. |
void |
start() |
void |
stop() |
addServerStatusListener, addSubscription, addSubscriptionAck, call, call, callAsync, discoverEndpoints, discoverEndpoints, getActualPublishRequestSetpoint, getAddress, getAddressSpace, getAuditEntryId, getCommErrorCodes, getConnectTimeout, getDefaultMaxAge, getDefaultProtocol, getDefaultTimestampsToReturn, getEndpoint, getEndpointConfiguration, getHost, getHttpsSecurityPolicies, getHttpsSettings, getLastOperationDiagnostics, getLastResponseTimestamp, getLastServiceDiagnostics, getLastServiceResult, getListener, getLocale, getMaxResponseMessageSize, getOperationDiagnosticMask, getPort, getProtocol, getPublishRequestFactor, getPublishRequestSetpoint, getPublishRequestTimeout, getReverseAddress, getReverseConnectionListener, getSecureChannel, getServerIdentity, getServerName, getServerState, getServerStatusError, getServerTable, getServerTable, getServerTimeDifference, getServiceDiagnosticMask, getSession, getSessionName, getSessionTimeout, getSocketFactory, getStatusCheckInterval, getStatusCheckTimeout, getSubscription, getSubscriptionById, getSubscriptionCount, getSubscriptions, getSupportedSecurityModes, getSupportedUserIdentityTokens, getTimeout, getTypeDictionary, getUri, hasServerStatusListener, hasSubscription, historyDeleteAtTimes, historyDeleteEvents, historyDeleteModified, historyDeleteRaw, historyRead, historyReadAsync, historyReadAtTimes, historyReadAtTimes, historyReadAtTimes, historyReadEvents, historyReadEvents, historyReadModified, historyReadModified, historyReadProcessed, historyReadProcessed, historyReadRaw, historyReadRaw, historyReadRaw, historyUpdate, historyUpdateAsync, historyUpdateData, historyUpdateEvent, historyUpdateStructureData, isInitTypeDictionaryAutoUsage, isInitTypeDictionaryOnConnect, isInitTypeDictionaryShallow, isInReverseMode, isKeepSubscriptions, isUseCommErrorCodes, isValidateCreateSessionResponseCert, isValidateDiscoveredEndpoints, isValidateNonceLength, read, readAsync, readAttribute, readAttribute, readAttribute, readAttribute, readAttribute, readAttribute, readAttributes, readAttributes, readAttributes, readAttributes, readAttributes, readAttributes, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValues, readValues, readValues, readValues, readValues, readValues, readValues, readValues, readValues, readValues, readValues, readValues, readValues, readValues, readValues, reconnect, registerModel, removeServerStatusListener, removeSubscription, removeSubscriptions, removeSubscriptionsAsync, resetEndpoint, resetPublishRequestSetpoint, resetSubscriptionsAfterRemove, resolveConnectionAddress, serviceRequest, serviceRequestAsync, sessionlessRequest, setApplicationIdentity, setAuditEntryId, setAutoReconnect, setConnectTimeout, setConnectTimeout, setDefaultMaxAge, setDefaultProtocol, setDefaultTimestampsToReturn, setHttpsSecurityPolicies, setInitTypeDictionaryAutoUsage, setInitTypeDictionaryOnConnect, setInitTypeDictionaryShallow, setKeepSubscriptions, setListener, setLocale, setMaxResponseMessageSize, setMaxResponseMessageSize, setOperationDiagnosticMask, setPublishRequestFactor, setPublishRequestSetpoint, setPublishRequestTimeout, setPublishRequestTimeout, setPublishRequestTimeout, setReverseConnectionListener, setReversePort, setServiceDiagnosticMask, setSessionName, setSessionTimeout, setSessionTimeout, setSocketFactory, setStatusCheckInterval, setStatusCheckInterval, setStatusCheckTimeout, setStatusCheckTimeout, setTimeout, setTimeout, setTimeout, setUseCommErrorCodes, setValidateCreateSessionResponseCert, setValidateDiscoveredEndpoints, setValidateNonceLength, updateServerStatus, validateServiceRequest, write, writeAsync, writeAttribute, writeAttribute, writeAttribute, writeAttribute, writeAttribute, writeAttribute, writeAttribute, writeAttribute, writeAttribute, writeValue, writeValue, writeValue, writeValue, writeValue, writeValue, writeValue, writeValue, writeValue, writeValues, writeValues, writeValues, writeValues, writeValues, writeValuesformatUri, getAggregateCalculator, getCertificateValidator, getKnownDataTypeDictionary, getOperationLimits, getRegisteredClasses, getSdkVersion, getVersion, isAutoDiscoverCodegenModels, registerAutoDiscoveredModels, registerModelInternal, setAutoDiscoverCodegenModels, setCertificateValidator, setOperationLimits, validateApplicationCertificatepublic UaLoopbackClient(UaServer server, Consumer<EndpointServiceRequest<?,?>> requestConsumer)
@Deprecated public void connect() throws ServiceException, ConnectException, SessionActivationException, InvalidServerEndpointException
UaLoopbackClient cannot be connected or disconnected, it is always
connected.connect in class UaClientServiceException - 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 endpoints@Deprecated public void disconnect()
UaLoopbackClient cannot be connected or disconnected, it is always
connected.disconnect in class UaClient@Deprecated public void disconnect(long timeout)
UaLoopbackClient cannot be connected or disconnected, it is always
connected.disconnect in class UaClienttimeout - timeout (in milliseconds) for the CloseSession call. Must be a positive value. 0
tells it to wait infinitely for a response.@Deprecated public void disconnect(long timeout, TimeUnit timeUnit)
UaLoopbackClient cannot be connected or disconnected, it is always
connected.disconnect in class UaClientUaClient.disconnect(long)@Deprecated public void disconnect(UnsignedInteger timeout)
UaLoopbackClient cannot be connected or disconnected, it is always
connected.disconnect in class UaClienttimeout - timeout (in milliseconds) for the CloseSession call. UnsignedInteger.ZERO tells
it to wait infinitely for a response.public OperationLimits getActualOperationLimits()
UaClientUaApplication.getOperationLimits().getActualOperationLimits in class UaClient@Deprecated public ApplicationIdentity getApplicationIdentity()
UaServer.getApplicationIdentity() instead directly.ApplicationIdentity of the server.getApplicationIdentity in class UaClientUaClient.setApplicationIdentity(com.prosysopc.ua.ApplicationIdentity) to
define it, before connecting to the server.public EncoderContext getEncoderContext()
getEncoderContext in class UaClientpublic NamespaceTable getNamespaceTable()
UaClientUaClient.getNamespaceTable(boolean) to force a
refresh.getNamespaceTable in class UaClientpublic NamespaceTable getNamespaceTable(boolean forceRefresh) throws ServiceException, StatusException
UaClientUaClient.isConnected is true.getNamespaceTable in class UaClientforceRefresh - request that the array is refreshed from the server, even if it has been
read alreadyServiceException - if the namespace array could not be readStatusException - if the namespace array read from the server is not valid@Deprecated public SecurityMode getSecurityMode()
UaServer object given as the constructor parameter. This method always returns
SecurityMode.NONE.getSecurityMode in class UaClientpublic ServerStatusDataType getServerStatus() throws StatusException, ServerConnectionException
UaClientUaClient.hasConnected().
Note also that UaClient.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.getServerStatus in class UaClientStatusException - 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 availableUaClient.getServerTimeDifference()@Deprecated public UserIdentity getUserIdentity()
UaLoopbackClient identity is equals to
Session.INTERNAL_SESSION.getUserIdentity in class UaClientpublic boolean hasConnected()
UaLoopbackClient is always connected, always returns true.hasConnected in class UaClientpublic boolean hasConnection()
UaLoopbackClient is always connected, always returns true.hasConnection in class UaClientpublic boolean isAutoReconnect()
UaClientisAutoReconnect in class UaClient@Deprecated public boolean isConnected()
hasConnection() or hasConnected() instead.hasConnection() or hasConnected() instead.isConnected in class UaClient@Deprecated public void setAddress(String address)
UaClientUaClient.isConnected.
Equals to calling setAddress(UaAddress.parse(address));setAddress in class UaClientaddress - The connection address of the server. The address is expected to be in format
'UaAddress.parse(java.lang.String) for
details.UaClient.setAddress(UaAddress)@Deprecated public void setAddress(UaAddress address)
UaClientUaClient.connect(), that is when
UaClient.isConnected.setAddress in class UaClientaddress - server address to connect to.UaClient.connect()@Deprecated public void setEndpoint(EndpointDescription endpoint)
UaClientUaClient.hasConnected() when changing the endpoint.setEndpoint in class UaClientendpoint - the endpoint to use.UaClient.setAddress(java.lang.String)@Deprecated public void setReverseAddress(UaAddress clientListenAddress)
UaClientUaClient.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 UaClient.setReversePort(int) instead to set a wildcard address. Alternatively, you can
create a wildcard address with UaAddress.wildcardOpcTcp(int)).
You can use UaClient.setReverseConnectionListener(ReverseConnectionListener) to define a custom
handler that can validate that the incoming calls are coming from an expected server. If
UaClient.getSecurityMode() defines a secure connection the server certificate must be trusted
in order to enable the connection as well.setReverseAddress in class UaClientUaClient.isInReverseMode(),
UaClient.setReversePort(int),
UaClient.setReverseConnectionListener(ReverseConnectionListener)@Deprecated public void setSecurityMode(SecurityMode securityMode)
UaClientSecurityMode as a parameter instead of defining your own
values.
You cannot change the setting when UaClient.isConnected.setSecurityMode in class UaClientsecurityMode - the new security mode@Deprecated public void setUri(String uri)
UaClientUaClient.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 UaClient.isConnected.
@Deprecated public void setUserIdentity(UserIdentity userIdentity) throws SessionActivationException
UaLoopbackClient identity is equals to
Session.INTERNAL_SESSION.setUserIdentity in class UaClientuserIdentity - the new identity. If null, the default, anonymous authentication is setSessionActivationException - if the session activation fails with the new identitypublic void start()
public void stop()
protected ServiceContext createServiceContext(ServiceRequest<ServiceResponse> request)
ServiceContext for the given request. By default this method return
ServiceContext.INTERNAL_OPERATION_CONTEXT, but it can be overriden here, if needed.Copyright © 2026. All rights reserved.