java.lang.Object
org.eclipse.milo.opcua.sdk.client.DiscoveryClient

public class DiscoveryClient extends Object
  • Constructor Details

    • DiscoveryClient

      public DiscoveryClient(org.eclipse.milo.opcua.stack.core.types.structured.EndpointDescription endpoint, org.eclipse.milo.opcua.stack.transport.client.OpcClientTransport transport)
  • Method Details

    • connect

      public DiscoveryClient connect() throws org.eclipse.milo.opcua.stack.core.UaException
      Throws:
      org.eclipse.milo.opcua.stack.core.UaException
    • connectAsync

      public CompletableFuture<DiscoveryClient> connectAsync()
    • disconnect

      public DiscoveryClient disconnect() throws org.eclipse.milo.opcua.stack.core.UaException
      Throws:
      org.eclipse.milo.opcua.stack.core.UaException
    • disconnectAsync

      public CompletableFuture<DiscoveryClient> disconnectAsync()
    • findServers

      public CompletableFuture<org.eclipse.milo.opcua.stack.core.types.structured.FindServersResponse> findServers(String endpointUrl, String[] localeIds, String[] serverUris)
      Query the FindServers service at the endpointUrl.

      The endpoint URL(s) for each server ApplicationDescription in the response can then be used in a getEndpoints(String) call to discover the endpoints for that server.

      Parameters:
      endpointUrl - the endpoint URL to find servers at.
      localeIds - list of locales to use. The server should return the applicationName in the ApplicationDescription using one of locales specified. If the server supports more than one of the requested locales then the server shall use the locale that appears first in this list. If the server does not support any of the requested locales it chooses an appropriate default locale. The server chooses an appropriate default locale if this list is empty.
      serverUris - list of servers to return. All known servers are returned if the list is empty.
      Returns:
      the FindServersResponses returned by the FindServers service.
    • getEndpoints

      public CompletableFuture<org.eclipse.milo.opcua.stack.core.types.structured.GetEndpointsResponse> getEndpoints(String endpointUrl, String[] localeIds, String[] profileUris)
      Query the GetEndpoints service at endpointUrl.
      Parameters:
      endpointUrl - the endpoint URL to get endpoints from.
      localeIds - list of locales to use. Specifies the locale to use when returning human-readable strings.
      profileUris - list of Transport Profile that the returned Endpoints shall support. All Endpoints are returned if the list is empty.
      Returns:
      the GetEndpointsResponse returned by the GetEndpoints service.
    • registerServer

      public CompletableFuture<org.eclipse.milo.opcua.stack.core.types.structured.RegisterServerResponse> registerServer(org.eclipse.milo.opcua.stack.core.types.structured.RegisteredServer server)
      Call the RegisterServer service to register server.
      Parameters:
      server - the RegisteredServer to register.
      Returns:
      the RegisterServerResponse returned by the RegisterServer service.
    • newRequestHeader

      public org.eclipse.milo.opcua.stack.core.types.structured.RequestHeader newRequestHeader(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId authToken, org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger requestTimeout)
    • findServers

      public static CompletableFuture<List<org.eclipse.milo.opcua.stack.core.types.structured.ApplicationDescription>> findServers(String endpointUrl)
      Query the FindServers service at the endpointUrl.

      The discovery URL(s) for each server ApplicationDescription in the response can then be used in a getEndpoints(String) call to discover the endpoints for that server.

      Parameters:
      endpointUrl - the endpoint URL to find servers at.
      Returns:
      a List of ApplicationDescriptions returned by the FindServers service.
    • findServers

      public static CompletableFuture<List<org.eclipse.milo.opcua.stack.core.types.structured.ApplicationDescription>> findServers(String endpointUrl, Consumer<org.eclipse.milo.opcua.stack.transport.client.tcp.OpcTcpClientTransportConfigBuilder> customizer)
      Query the FindServers service at the endpointUrl.

      The discovery URL(s) for each server ApplicationDescription in the response can then be used in a getEndpoints(String) call to discover the endpoints for that server.

      Parameters:
      endpointUrl - the endpoint URL to find servers at.
      customizer - a Consumer that accepts a OpcTcpClientTransportConfigBuilder for customization.
      Returns:
      a List of ApplicationDescriptions returned by the FindServers service.
    • getEndpoints

      public static CompletableFuture<List<org.eclipse.milo.opcua.stack.core.types.structured.EndpointDescription>> getEndpoints(String endpointUrl)
      Query the GetEndpoints service at endpointUrl.
      Parameters:
      endpointUrl - the endpoint URL to get endpoints from.
      Returns:
      a List of EndpointDescriptions returned by the GetEndpoints service.
    • getEndpoints

      public static CompletableFuture<List<org.eclipse.milo.opcua.stack.core.types.structured.EndpointDescription>> getEndpoints(String endpointUrl, Consumer<org.eclipse.milo.opcua.stack.transport.client.tcp.OpcTcpClientTransportConfigBuilder> customizer)
      Query the GetEndpoints service at endpointUrl.
      Parameters:
      endpointUrl - the endpoint URL to get endpoints from.
      customizer - a Consumer that accepts a OpcTcpClientTransportConfigBuilder for customization.
      Returns:
      a List of EndpointDescriptions returned by the GetEndpoints service.