Search in sources :

Example 1 with AuthenticateRequest

use of com.ibm.etcd.api.AuthenticateRequest in project etcd-java by IBM.

the class EtcdClient method authenticate.

private ListenableFuture<AuthenticateResponse> authenticate() {
    AuthenticateRequest request = AuthenticateRequest.newBuilder().setNameBytes(name).setPasswordBytes(password).build();
    // no call creds for auth call
    CallOptions callOpts = CallOptions.DEFAULT;
    return Futures.catchingAsync(grpc.fuCall(METHOD_AUTHENTICATE, request, callOpts, 0L), Exception.class, ex -> !retryAuthRequest(ex) ? Futures.immediateFailedFuture(ex) : grpc.fuCall(METHOD_AUTHENTICATE, request, callOpts, 0L));
}
Also used : AuthenticateRequest(com.ibm.etcd.api.AuthenticateRequest) CallOptions(io.grpc.CallOptions)

Aggregations

AuthenticateRequest (com.ibm.etcd.api.AuthenticateRequest)1 CallOptions (io.grpc.CallOptions)1