public interface LeasePeriodPolicy
| Modifier and Type | Interface and Description |
|---|---|
static class |
LeasePeriodPolicy.Result
Simple class that holds a pair of times, the
new expiration and duration for a lease.
|
| Modifier and Type | Method and Description |
|---|---|
LeasePeriodPolicy.Result |
grant(LeasedResource resource,
long requestedDuration)
Calculate the initial expiration and duration for
a new lease.
|
LeasePeriodPolicy.Result |
renew(LeasedResource resource,
long requestedDuration)
Calculate the expiration and duration for an
existing lease that is being renewed.
|
LeasePeriodPolicy.Result grant(LeasedResource resource, long requestedDuration) throws LeaseDeniedException
resource - the server side representation of the new lease that
needs an initial expiration and durationrequestedDuration - the initial duration the
requester of the resources would like. May be
Lease.ANYResult that holds
both the expiration and duration.LeaseDeniedException - if the grant request
is denied.IllegalArgumentException - if the
requested duration is not Lease.ANY
and is negative.LeasePeriodPolicy.Result renew(LeasedResource resource, long requestedDuration) throws LeaseDeniedException
resource - the server side representation of the lease that is
being renewedrequestedDuration - the duration the client is requesting. May be
Lease.ANY.Result that holds
both the expiration and duration.LeaseDeniedException - if the renewal request
is denied.IllegalArgumentException - if the
requested duration is not Lease.ANY
and is negative.Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.