Class UmaDbAsyncClientImpl

java.lang.Object
io.umadb.client.grpc.UmaDbAsyncClientImpl
All Implemented Interfaces:
UmaDbAsyncClient, AutoCloseable

public final class UmaDbAsyncClientImpl extends Object implements UmaDbAsyncClient
Internal gRPC-based implementation of UmaDbAsyncClient.

Unary calls go through the asynchronous stub rather than the futures stub: the futures stub hands back a Guava ListenableFuture, which would both leak Guava into the public API and give no way to make cancellation reach the wire. Driving the async stub inside a Context.CancellableContext solves both, and uses the same cancellation mechanism as the streaming calls.

This class is not intended to be used directly by client code. Clients should construct instances via UmaDbClientBuilder.buildAsync().

  • Constructor Details

    • UmaDbAsyncClientImpl

      public UmaDbAsyncClientImpl(String host, int port, boolean tlsEnabled, String caFilePath, String apiKey, Executor executor)
      Creates a new asynchronous client implementation.
      Parameters:
      host - UmaDB server host
      port - UmaDB server port
      tlsEnabled - indicates whether an encrypted communication (TLS) is to be used
      caFilePath - optional path to a CA certificate for TLS
      apiKey - optional API key (requires TLS)
      executor - optional executor for gRPC callbacks; null uses the gRPC default
      Throws:
      IllegalArgumentException - if arguments are invalid or insecure
  • Method Details