Package io.etcd.jetcd
Interface Lease
- All Superinterfaces:
AutoCloseable,CloseableClient
Interface of KeepAlive talking to etcd.
-
Method Summary
Modifier and TypeMethodDescriptiongrant(long ttl) New a lease with ttl value.New a lease with ttl value.Waits if necessary for at most the given time if etcd server is available.keepAlive(long leaseId, io.grpc.stub.StreamObserver<LeaseKeepAliveResponse> observer) keep the given lease alive forever.keepAliveOnce(long leaseId) keep alive one lease only once.revoke(long leaseId) revoke one lease and the key bind to this lease will be removed.timeToLive(long leaseId, LeaseOption leaseOption) retrieves the lease information of the given lease ID.Methods inherited from interface io.etcd.jetcd.support.CloseableClient
close
-
Method Details
-
grant
New a lease with ttl value.- Parameters:
ttl- ttl value, unit seconds- Returns:
- the grant response
-
grant
New a lease with ttl value.Waits if necessary for at most the given time if etcd server is available.- Parameters:
ttl- ttl value, unit secondstimeout- the maximum time to waitsunit- the time unit of the timeout argument- Returns:
- The grant response
-
revoke
revoke one lease and the key bind to this lease will be removed.- Parameters:
leaseId- id of the lease to revoke- Returns:
- the revoke response
-
keepAliveOnce
keep alive one lease only once.- Parameters:
leaseId- id of lease to keep alive once- Returns:
- The keep alive response
-
timeToLive
retrieves the lease information of the given lease ID.- Parameters:
leaseId- id of leaseleaseOption- LeaseOption- Returns:
- LeaseTimeToLiveResponse wrapped in CompletableFuture
-
keepAlive
CloseableClient keepAlive(long leaseId, io.grpc.stub.StreamObserver<LeaseKeepAliveResponse> observer) keep the given lease alive forever.- Parameters:
leaseId- lease to be keep alive forever.observer- the observer- Returns:
- a KeepAliveListener that listens for KeepAlive responses.
-