public class Client extends Object
| Constructor and Description |
|---|
Client(Application application)
Construct a new client application
|
| Modifier and Type | Method and Description |
|---|---|
ApplicationDescription |
createApplicationDescription()
createApplicationDescription.
|
static Client |
createClientApplication(KeyPair cert)
createClientApplication.
|
SecureChannel |
createReverseSecureChannel(String localEndpointUrl,
ReverseTransportChannelSettings settings)
Open a local connection accepting a ReverseHello messages sent by the server.
|
SecureChannel |
createSecureChannel(ApplicationDescription applicationDescription)
Create a secure channel to a UA application
|
SecureChannel |
createSecureChannel(EndpointDescription endpoint)
Create a secure channel to an endpoint
|
SecureChannel |
createSecureChannel(String endpointUrl)
Create a secure channel to a UA Server This method first queries endpoints, chooses the most
suitable and connects to it.
|
SecureChannel |
createSecureChannel(String connectUrl,
EndpointDescription endpoint)
Create a secure channel to an endpoint.
|
SecureChannel |
createSecureChannel(String connectUrl,
String endpointUri)
Create a secure channel to a UA Server This method first queries endpoints, chooses the most
suitable and connects to it.
|
SecureChannel |
createSecureChannel(String connectUrl,
String endpointUri,
SecurityMode mode,
Cert remoteCertificate)
Create and open a secure channel.
|
SecureChannel |
createSecureChannel(String connectUrl,
TransportChannelSettings settings)
Create and open a secure channel.
|
SecureChannel |
createSecureChannel(TransportChannelSettings settings)
Create and open a secure channel.
|
ServiceChannel |
createServiceChannel(ApplicationDescription applicationDescription)
Create a service channel
|
ServiceChannel |
createServiceChannel(EndpointDescription endpoint)
Create a service channel to an endpoint.
|
ServiceChannel |
createServiceChannel(String endpointUrl)
Create a service channel to a UA Server This method first queries endpoints, chooses the most
suitable and connects to it.
|
ServiceChannel |
createServiceChannel(String connectUrl,
EndpointDescription endpoint)
Create a service channel to an endpoint
|
ServiceChannel |
createServiceChannel(String connectUrl,
String endpointUri)
Create a service channel to a UA Server This method first queries endpoints, chooses the most
suitable and connects to it.
|
ServiceChannel |
createServiceChannel(String connectUrl,
String endpointUri,
SecurityMode mode,
Cert remoteCertificate)
Create and open a service channel.
|
ServiceChannel |
createServiceChannel(TransportChannelSettings settings)
Create and open a secure channel and adapt to service channel.
|
Session |
createSession(SecureChannel channel)
Create a new session on a server.
|
Session |
createSession(SecureChannel channel,
UnsignedInteger maxResponseMessageSize,
Double requestedSessionTimeout,
String sessionName)
Create a new session on a server
|
Session |
createSession(SecureChannel channel,
UnsignedInteger maxResponseMessageSize,
Double requestedSessionTimeout,
String sessionName,
EndpointDescription[] discoveredEndpoints)
Create a new session on a server
|
SessionChannel |
createSessionChannel(ApplicationDescription applicationDescription)
Creates a secure channel and an unactivated session channel.
|
SessionChannel |
createSessionChannel(EndpointDescription endpoint)
Creates a secure channel and an unactivated session channel.
|
SessionChannel |
createSessionChannel(String endpointUrl)
Creates a secure channel and an unactivated session channel.
|
SessionChannel |
createSessionChannel(String connectUrl,
EndpointDescription endpoint)
Creates a secure channel and an unactivated session channel.
|
SessionChannel |
createSessionChannel(String connectUrl,
String endpointUri)
Creates a secure channel and an unactivated session channel.
|
ApplicationDescription[] |
discoverApplications(String discoverServerEndpointUrl)
Discover applications
|
ApplicationDescription[] |
discoverApplications(String connectUrl,
String discoverServerEndpointUri)
Discover applications
|
EndpointDescription[] |
discoverEndpoints(String discoveryEndpointUrl)
Discover endpoints
|
EndpointDescription[] |
discoverEndpoints(String connectUrl,
String discoveryEndpointUri)
Discover endpoints.
|
ServerOnNetwork[] |
discoverServersOnNetwork(String discoverServerEndpointUrl)
Discover ServerOnNetwork records from LDS
|
ServerOnNetwork[] |
discoverServersOnNetwork(String connectUrl,
String discoverServerEndpointUri)
Discover ServerOnNetwork records from LDS
|
ServerOnNetwork[] |
discoverServersOnNetwork(String connectUrl,
String discoverServerEndpointUri,
String[] serverCapabilities)
Discover ServerOnNetwork records from LDS
|
FindServersOnNetworkResponse |
discoverServersOnNetwork(String connectUrl,
String discoverServerEndpointUri,
UnsignedInteger startingRecordId,
UnsignedInteger maxRecordsToReturn,
String[] serverCapabilities)
Get FindServersOnNetworkResponse to retrieve ServerOnNetwork records and lastCounterResetTime
associated with them
|
Application |
getApplication()
Getter for the field
application. |
HttpsSettings |
getApplicationHttpsSettings()
getApplicationHttpsSettings.
|
OpcTcpSettings |
getApplicatioOpcTcpSettings()
getApplicatioOpcTcpSettings.
|
EncoderContext |
getEncoderContext()
getEncoderContext.
|
EndpointConfiguration |
getEndpointConfiguration()
Getter for the field
endpointConfiguration. |
int |
getMaxMessageSize()
getMaxMessageSize.
|
int |
getTimeout()
getTimeout.
|
void |
setEndpointConfiguration(EndpointConfiguration endpointConfiguration)
Setter for the field
endpointConfiguration. |
void |
setMaxMessageSize(int maxMessagSize)
setMaxMessageSize.
|
void |
setTimeout(int timeout)
setTimeout.
|
public Client(Application application)
Note: Client needs an application instance certificate to create secure channels. See
Application.addApplicationInstanceCertificate(KeyPair)
application - common application datapublic static Client createClientApplication(KeyPair cert)
createClientApplication.
public ApplicationDescription createApplicationDescription()
createApplicationDescription.
ApplicationDescription object.public SecureChannel createReverseSecureChannel(String localEndpointUrl, ReverseTransportChannelSettings settings) throws ServiceResultException
TransportChannelSettings must
be sent by the server in the ReverseHello Message.localEndpointUrl, - The client opens a server socket based on this address, listens server
sent ReverseHelloserverApplicationUri - expected Server(Application)Uri of the ReverseHellosettings - settings used for connection (timeouts etc)ServiceResultException - if errorpublic SecureChannel createSecureChannel(ApplicationDescription applicationDescription) throws ServiceResultException
This implementation accepts only connections with opc.tcp protocol and with encryption.
Note this implementation is unsafe as the dialog with discover endpoint is not encrypted.
applicationDescription - application descriptionServiceResultException - if errorpublic SecureChannel createSecureChannel(EndpointDescription endpoint) throws ServiceResultException
endpoint - endpoint descriptionServiceResultException - if errrorpublic SecureChannel createSecureChannel(String endpointUrl) throws ServiceResultException
endpointUrl - Endpoint identifier and socket addressServiceResultException - if errorpublic SecureChannel createSecureChannel(String connectUrl, EndpointDescription endpoint) throws ServiceResultException
connectUrl - address that contains the socket address to the endpointendpoint - endpoint descriptionServiceResultException - if errorpublic SecureChannel createSecureChannel(String connectUrl, String endpointUri) throws ServiceResultException
connectUrl - address that contains the socket address to the endpointendpointUri - EndpointUri identifier or "" for discoveryServiceResultException - if errorpublic SecureChannel createSecureChannel(String connectUrl, String endpointUri, SecurityMode mode, Cert remoteCertificate) throws ServiceResultException
connectUrl - address that contains the socket address to the endpointendpointUri - endpoint urimode - security moderemoteCertificate - remove certificateServiceResultException - if errorpublic SecureChannel createSecureChannel(String connectUrl, TransportChannelSettings settings) throws ServiceResultException
connectUrl - address that contains the socket address to the endpointsettings - (optional) overriding settingsServiceResultException - if errorpublic SecureChannel createSecureChannel(TransportChannelSettings settings) throws ServiceResultException
settings - transport settingsServiceResultException - if errorpublic ServiceChannel createServiceChannel(ApplicationDescription applicationDescription) throws ServiceResultException
Note this implementation is unsecure as the dialog with discover endpoint is not encrypted.
applicationDescription - application descriptionServiceResultException - if errorpublic ServiceChannel createServiceChannel(EndpointDescription endpoint) throws ServiceResultException
endpoint - endpoint descriptionServiceResultException - if errorpublic ServiceChannel createServiceChannel(String endpointUrl) throws ServiceResultException
endpointUrl - endpoint idenfier and socket addressServiceResultException - if errorpublic ServiceChannel createServiceChannel(String connectUrl, EndpointDescription endpoint) throws ServiceResultException
connectUrl - address that contains the socket address to the endpointendpoint - endpoint descriptionServiceResultException - if errorpublic ServiceChannel createServiceChannel(String connectUrl, String endpointUri) throws ServiceResultException
connectUrl - connection urlendpointUri - endpointUri idenfier or "" for discovery serviceServiceResultException - if errorpublic ServiceChannel createServiceChannel(String connectUrl, String endpointUri, SecurityMode mode, Cert remoteCertificate) throws ServiceResultException
connectUrl - address that contains the socket address to the endpointendpointUri - endpointUri identifier of the endpointmode - security moderemoteCertificate - remote certificateServiceResultException - if errorpublic ServiceChannel createServiceChannel(TransportChannelSettings settings) throws ServiceResultException
settings - transport settingsServiceResultException - if errorpublic Session createSession(SecureChannel channel) throws ServiceResultException
channel - open channelServiceResultException - if errorpublic Session createSession(SecureChannel channel, UnsignedInteger maxResponseMessageSize, Double requestedSessionTimeout, String sessionName) throws IllegalArgumentException, ServiceResultException
channel - open channel to usemaxResponseMessageSize - max size of response messages - if null, use 4194304requestedSessionTimeout - requested session time out (in ms) - if null, use 3600000 (one
hour)sessionName - session name - if null a random GUID is used to generate the nameIllegalArgumentException - if errorServiceResultException - if errorpublic Session createSession(SecureChannel channel, UnsignedInteger maxResponseMessageSize, Double requestedSessionTimeout, String sessionName, EndpointDescription[] discoveredEndpoints) throws IllegalArgumentException, ServiceResultException
channel - open channel to usemaxResponseMessageSize - max size of response messages - if null, defaulting to 4194304requestedSessionTimeout - requested session timeout (ms) - if null, defaulting to 3600000
(one hour)sessionName - session name - if null, a random GUID is used to generate the namediscoveredEndpoints - list of previously discovered Endpoints using GetEndpoints service.
This list is checked against the Endpoint list received from CreateSessionResponse, if
it does not match, an exception is thrown, if null the check is disabledIllegalArgumentException - if endpoint or channel is nullServiceResultException - if errorpublic SessionChannel createSessionChannel(ApplicationDescription applicationDescription) throws ServiceResultException
The channel needs to be activated separately.
To close the object, both secure channel and the session must be close separately. SessionChannel.closeSession() SessionChannel.closeSecureChannel()
applicationDescription - application descriptionServiceResultException - on errorspublic SessionChannel createSessionChannel(EndpointDescription endpoint) throws ServiceResultException
The channel needs to be activated separately.
To close the object, both secure channel and the session must be close separately. SessionChannel.closeSession() SessionChannel.closeSecureChannel()
endpoint - endpoint descriptionServiceResultException - on errorspublic SessionChannel createSessionChannel(String endpointUrl) throws ServiceResultException
The channel needs to be activated separately.
To close the object, both secure channel and the session must be close separately. SessionChannel.closeSession() SessionChannel.closeSecureChannel()
endpointUrl - endpoint identifier and socket addressServiceResultException - if errorpublic SessionChannel createSessionChannel(String connectUrl, EndpointDescription endpoint) throws ServiceResultException
The channel needs to be activated separately.
To close the object, both secure channel and the session must be close separately. SessionChannel.closeSession() SessionChannel.closeSecureChannel()
connectUrl - address that contains the socket address to the endpointendpoint - endpoint descriptionServiceResultException - on errorspublic SessionChannel createSessionChannel(String connectUrl, String endpointUri) throws ServiceResultException
The channel needs to be activated separately.
To close the object, both secure channel and the session must be close separately. SessionChannel.closeSession() SessionChannel.closeSecureChannel()
connectUrl - address that contains the socket address to the endpointendpointUri - endpoint identifierServiceResultException - if errorpublic ApplicationDescription[] discoverApplications(String discoverServerEndpointUrl) throws ServiceResultException
discoverServerEndpointUrl - endpointURI that is also the socket addressServiceResultException - if errorpublic ApplicationDescription[] discoverApplications(String connectUrl, String discoverServerEndpointUri) throws ServiceResultException
connectUrl - address that contains the socket address to the endpointdiscoverServerEndpointUri - endpointURI or ""ServiceResultException - if errorpublic EndpointDescription[] discoverEndpoints(String discoveryEndpointUrl) throws ServiceResultException
discoveryEndpointUrl - endpoint identifier or socket addressServiceResultException - Error that occured while
processing the operation.public EndpointDescription[] discoverEndpoints(String connectUrl, String discoveryEndpointUri) throws ServiceResultException
connectUrl - address that contains the socket address to the endpointdiscoveryEndpointUri - the endpoint identifier that identifies the endpoints that are
being discoveredServiceResultException - Error that occured while
processing the operation.public ServerOnNetwork[] discoverServersOnNetwork(String discoverServerEndpointUrl) throws ServiceResultException
discoverServerEndpointUrl - endpointURI that is also the socket addressServiceResultException - if errorpublic ServerOnNetwork[] discoverServersOnNetwork(String connectUrl, String discoverServerEndpointUri) throws ServiceResultException
connectUrl - address that contains the socket address to the endpointdiscoverServerEndpointUri - endpointURI or ""ServiceResultException - if errorpublic ServerOnNetwork[] discoverServersOnNetwork(String connectUrl, String discoverServerEndpointUri, String[] serverCapabilities) throws ServiceResultException
connectUrl - address that contains the socket address to the endpointdiscoverServerEndpointUri - endpointURI or ""serverCapabilities - list of server capability filtersServiceResultException - if errorpublic FindServersOnNetworkResponse discoverServersOnNetwork(String connectUrl, String discoverServerEndpointUri, UnsignedInteger startingRecordId, UnsignedInteger maxRecordsToReturn, String[] serverCapabilities) throws ServiceResultException
connectUrl - address that contains the socket address to the endpointdiscoverServerEndpointUri - endpointURI or ""startingRecordId - smallest id of records to be returnedmaxRecordsToReturn - maximum number of records to returnserverCapabilities - list of server capability filtersServiceResultException - if errorpublic Application getApplication()
Getter for the field application.
Application object.public HttpsSettings getApplicationHttpsSettings()
getApplicationHttpsSettings.
HttpsSettings object.public OpcTcpSettings getApplicatioOpcTcpSettings()
getApplicatioOpcTcpSettings.
OpcTcpSettings object.public EncoderContext getEncoderContext()
getEncoderContext.
EncoderContext object.public EndpointConfiguration getEndpointConfiguration()
Getter for the field endpointConfiguration.
EndpointConfiguration object.public int getMaxMessageSize()
getMaxMessageSize.
public int getTimeout()
getTimeout.
public void setEndpointConfiguration(EndpointConfiguration endpointConfiguration)
Setter for the field endpointConfiguration.
endpointConfiguration - a EndpointConfiguration
object.public void setMaxMessageSize(int maxMessagSize)
setMaxMessageSize.
maxMessagSize - a int.public void setTimeout(int timeout)
setTimeout.
timeout - a int.Copyright © 2026. All rights reserved.