Search in sources :

Example 1 with FindServersRequest

use of org.eclipse.milo.opcua.stack.core.types.structured.FindServersRequest in project milo by eclipse.

the class DiscoveryClient method findServers.

/**
 * Query the FindServers service at the {@code endpointUrl}.
 * <p>
 * The endpoint URL(s) for each server {@link ApplicationDescription} in the response can then be used in a
 * {@link #getEndpoints(String)} call to discover the endpoints for that server.
 *
 * @param endpointUrl the endpoint URL to find servers at.
 * @param 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.
 * @param serverUris  list of servers to return. All known servers are returned if the list is empty.
 * @return the {@link FindServersResponse}s returned by the FindServers service.
 */
public CompletableFuture<FindServersResponse> findServers(String endpointUrl, String[] localeIds, String[] serverUris) {
    RequestHeader requestHeader = stackClient.newRequestHeader(NodeId.NULL_VALUE, stackClient.getConfig().getRequestTimeout());
    FindServersRequest request = new FindServersRequest(requestHeader, endpointUrl, localeIds, serverUris);
    return stackClient.sendRequest(request).thenApply(FindServersResponse.class::cast);
}
Also used : RequestHeader(org.eclipse.milo.opcua.stack.core.types.structured.RequestHeader) FindServersResponse(org.eclipse.milo.opcua.stack.core.types.structured.FindServersResponse) FindServersRequest(org.eclipse.milo.opcua.stack.core.types.structured.FindServersRequest)

Aggregations

FindServersRequest (org.eclipse.milo.opcua.stack.core.types.structured.FindServersRequest)1 FindServersResponse (org.eclipse.milo.opcua.stack.core.types.structured.FindServersResponse)1 RequestHeader (org.eclipse.milo.opcua.stack.core.types.structured.RequestHeader)1