public class LeaseImpl extends Object implements Lease
| Modifier and Type | Method and Description |
|---|---|
double |
availability() |
long |
expiry()
Absolute time since epoch at which this lease will expire.
|
int |
getAllowedRequests()
Number of requests allowed by this lease.
|
ByteBuf |
getMetadata()
Metadata for the lease.
|
int |
getStartingAllowedRequests()
Initial number of requests allowed by this lease.
|
int |
getTimeToLiveMillis()
Number of milliseconds that this lease is valid from the time it is received.
|
boolean |
isValid()
Checks if the lease has not expired and there are allowed requests available
|
String |
toString() |
boolean |
use()
try use 1 allowed request of Lease
|
public int getTimeToLiveMillis()
LeasegetTimeToLiveMillis in interface Leasepublic int getAllowedRequests()
LeasegetAllowedRequests in interface Leasepublic int getStartingAllowedRequests()
LeasegetStartingAllowedRequests in interface Lease@Nonnull public ByteBuf getMetadata()
LeasegetMetadata in interface Leasepublic long expiry()
Leasepublic boolean isValid()
Leasepublic boolean use()
public double availability()
availability in interface Availability