Esempio n. 1
0
        /// <summary>
        /// UserGetAsync gets detailed user information in async
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <AuthUserGetResponse> UserGetAsync(AuthUserGetRequest request, Metadata headers = null)
        {
            AuthUserGetResponse response = new AuthUserGetResponse();
            bool success    = false;
            int  retryCount = 0;

            while (!success)
            {
                try
                {
                    response = await _balancer.GetConnection().authClient.UserGetAsync(request, headers);

                    success = true;
                }
                catch (RpcException ex) when(ex.StatusCode == StatusCode.Unavailable)
                {
                    retryCount++;
                    if (retryCount >= _balancer._numNodes)
                    {
                        throw ex;
                    }
                }
            }
            return(response);
        }
Esempio n. 2
0
        /// <summary>
        /// UserGetAsync gets detailed user information in async
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <AuthUserGetResponse> UserGetAsync(AuthUserGetRequest request, Metadata headers = null)
        {
            AuthUserGetResponse response = new AuthUserGetResponse();

            response = await _balancer.GetConnection().authClient.UserGetAsync(request, headers);

            return(response);
        }
Esempio n. 3
0
        /// <summary>
        /// UserGet gets detailed user information
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public AuthUserGetResponse UserGet(AuthUserGetRequest request, Metadata headers = null)
        {
            AuthUserGetResponse response = new AuthUserGetResponse();

            response = _balancer.GetConnection().authClient.UserGet(request, headers);

            return(response);
        }
Esempio n. 4
0
        public AuthUserGetResponse UserGet(ByteSequence user)
        {
            Etcdserverpb.AuthUserGetRequest userGetRequest = new Etcdserverpb.AuthUserGetRequest();
            userGetRequest.Name = user.ToString();
            var rsp = authClient.UserGet(userGetRequest);
            AuthUserGetResponse response = new AuthUserGetResponse(rsp);

            return(response);
            //return Util.ToCompletableFuture(
            //    this.stub.userGet(userGetRequest),
            //    new FunctionResponse<Etcdserverpb.AuthUserGetRequest, AuthUserGetResponse>());
        }
Esempio n. 5
0
        /// <summary>
        /// UserGetAsync gets detailed user information in async
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <AuthUserGetResponse> UserGetAsync(AuthUserGetRequest request)
        {
            AuthUserGetResponse response = new AuthUserGetResponse();

            try
            {
                response = await _authClient.UserGetAsync(request, _headers);
            }
            catch (RpcException ex)
            {
                ResetConnection(ex);
                throw;
            }
            catch
            {
                throw;
            }
            return(response);
        }
Esempio n. 6
0
        /// <summary>
        /// UserGet gets detailed user information
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public AuthUserGetResponse UserGet(AuthUserGetRequest request)
        {
            AuthUserGetResponse response = new AuthUserGetResponse();

            try
            {
                response = _authClient.UserGet(request, _headers);
            }
            catch (RpcException ex)
            {
                ResetConnection(ex);
                throw;
            }
            catch
            {
                throw;
            }
            return(response);
        }