public interface PersistentLease extends com.google.common.util.concurrent.ListenableFuture<Long>, Closeable
This class is also a future which completes with the lease id once the lease is created or verified.
Use the Closeable.close() method to cancel/revoke the lease
| Modifier and Type | Interface and Description |
|---|---|
static class |
PersistentLease.LeaseState |
| Modifier and Type | Method and Description |
|---|---|
void |
addStateObserver(io.grpc.stub.StreamObserver<PersistentLease.LeaseState> observer,
boolean publishInitialState) |
long |
getCurrentTtlSecs() |
long |
getKeepAliveTtlSecs() |
long |
getLeaseId() |
long |
getPreferredTtlSecs() |
PersistentLease.LeaseState |
getState() |
void |
removeStateObserver(io.grpc.stub.StreamObserver<PersistentLease.LeaseState> observer) |
long getLeaseId()
PersistentLease.LeaseState getState()
PersistentLease.LeaseStatelong getPreferredTtlSecs()
long getKeepAliveTtlSecs()
long getCurrentTtlSecs()
void addStateObserver(io.grpc.stub.StreamObserver<PersistentLease.LeaseState> observer, boolean publishInitialState)
observer - publishInitialState - if true, the StreamObserver.onNext(Object)
method of the supplied observer will be called first with the current
state regardless of when it last changed. Subsequent callbacks will correspond
to state changes.void removeStateObserver(io.grpc.stub.StreamObserver<PersistentLease.LeaseState> observer)
Copyright © 2023. All rights reserved.