public class LeaseImpl extends Object implements Lease
Lease.KeepAliveListener| Modifier and Type | Method and Description |
|---|---|
void |
close()
close the client and release its resources.
|
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 option)
retrieves the lease information of the given lease ID.
|
public CompletableFuture<LeaseGrantResponse> grant(long ttl)
Leasepublic CompletableFuture<LeaseRevokeResponse> revoke(long leaseId)
Leasepublic Lease.KeepAliveListener keepAlive(long leaseId)
Leasepublic void close()
CloseableClientclose in interface CloseableClientpublic CompletableFuture<LeaseKeepAliveResponse> keepAliveOnce(long leaseId)
LeasekeepAliveOnce in interface LeaseleaseId - id of lease to keep alive oncepublic CompletableFuture<LeaseTimeToLiveResponse> timeToLive(long leaseId, LeaseOption option)
LeasetimeToLive in interface LeaseleaseId - id of leaseoption - LeaseOptionCopyright © 2017. All rights reserved.