public interface Lease extends CloseableClient
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Lease.KeepAliveListener
KeepAliveListener listens for LeaseKeepAliveResponse of a given leaseID.
|
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<LeaseGrantResponse> |
grant(long ttl)
New a lease with ttl value.
|
Lease.KeepAliveListener |
keepAlive(long leaseId)
keep the given lease alive forever.
|
CompletableFuture<LeaseKeepAliveResponse> |
keepAliveOnce(long leaseId)
keep alive one lease only once.
|
CompletableFuture<LeaseRevokeResponse> |
revoke(long leaseId)
revoke one lease and the key bind to this lease will be removed.
|
CompletableFuture<LeaseTimeToLiveResponse> |
timeToLive(long leaseId,
LeaseOption leaseOption)
retrieves the lease information of the given lease ID.
|
closeCompletableFuture<LeaseGrantResponse> grant(long ttl)
ttl - ttl value, unit secondsCompletableFuture<LeaseRevokeResponse> revoke(long leaseId)
leaseId - id of the lease to revokeCompletableFuture<LeaseKeepAliveResponse> keepAliveOnce(long leaseId)
leaseId - id of lease to keep alive onceCompletableFuture<LeaseTimeToLiveResponse> timeToLive(long leaseId, LeaseOption leaseOption)
leaseId - id of leaseleaseOption - LeaseOptionLease.KeepAliveListener keepAlive(long leaseId)
leaseId - lease to be keep alive forever.Copyright © 2018. All rights reserved.