io.etcd.jetcd.api.lock

## Class LockGrpc.LockFutureStub

- java.lang.Object
- - io.grpc.stub.AbstractStub<S>
  - - io.grpc.stub.AbstractFutureStub<LockGrpc.LockFutureStub>
    - - io.etcd.jetcd.api.lock.LockGrpc.LockFutureStub

Enclosing class:
  LockGrpc

    public static final class LockGrpc.LockFutureStub
    extends io.grpc.stub.AbstractFutureStub<LockGrpc.LockFutureStub>

     The lock service exposes client-side locking facilities as a gRPC interface.

### Nested Class Summary

### Nested classes/interfaces inherited from class io.grpc.stub.AbstractStub

`io.grpc.stub.AbstractStub.StubFactory<T extends io.grpc.stub.AbstractStub<T>>`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected LockGrpc.LockFutureStub` `build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)`
`com.google.common.util.concurrent.ListenableFuture<LockResponse>` `lock(LockRequest request)` Lock acquires a distributed shared lock on a given named lock.
`com.google.common.util.concurrent.ListenableFuture<UnlockResponse>` `unlock(UnlockRequest request)` Unlock takes a key returned by Lock and releases the hold on lock.

### Methods inherited from class io.grpc.stub.AbstractFutureStub

`newStub, newStub`

### Methods inherited from class io.grpc.stub.AbstractStub

`getCallOptions, getChannel, withCallCredentials, withChannel, withCompression, withDeadline, withDeadlineAfter, withExecutor, withInterceptors, withMaxInboundMessageSize, withMaxOutboundMessageSize, withOption, withWaitForReady`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### build

    protected LockGrpc.LockFutureStub build(io.grpc.Channel channel,
                                            io.grpc.CallOptions callOptions)

Specified by:
  `build` in class `io.grpc.stub.AbstractStub<LockGrpc.LockFutureStub>`

#### lock

    public com.google.common.util.concurrent.ListenableFuture<LockResponse> lock(LockRequest request)

     Lock acquires a distributed shared lock on a given named lock.
     On success, it will return a unique key that exists so long as the
     lock is held by the caller. This key can be used in conjunction with
     transactions to safely ensure updates to etcd only occur while holding
     lock ownership. The lock is held until Unlock is called on the key or the
     lease associate with the owner expires.

#### unlock

    public com.google.common.util.concurrent.ListenableFuture<UnlockResponse> unlock(UnlockRequest request)

     Unlock takes a key returned by Lock and releases the hold on lock. The
     next Lock caller waiting for the lock will then be woken up and given
     ownership of the lock.