public interface ILeaseRenewer<T extends Lease>
| Modifier and Type | Method and Description |
|---|---|
void |
addLeasesToRenew(java.util.Collection<T> newLeases)
Adds leases to this LeaseRenewer's set of currently held leases.
|
void |
clearCurrentlyHeldLeases()
Clears this LeaseRenewer's set of currently held leases.
|
T |
getCurrentlyHeldLease(java.lang.String leaseKey) |
java.util.Map<java.lang.String,T> |
getCurrentlyHeldLeases() |
void |
initialize()
Bootstrap initial set of leases from the LeaseManager (e.g.
|
void |
renewLeases()
Attempt to renew all currently held leases.
|
boolean |
updateLease(T lease,
java.util.UUID concurrencyToken)
Update application-specific fields in a currently held lease.
|
void initialize()
throws DependencyException,
InvalidStateException,
ProvisionedThroughputException
DependencyException - on unexpected DynamoDB failuresInvalidStateException - if lease table doesn't existProvisionedThroughputException - if DynamoDB reads fail due to insufficient capacityvoid renewLeases()
throws DependencyException,
InvalidStateException
DependencyException - on unexpected DynamoDB failuresInvalidStateException - if lease table does not existjava.util.Map<java.lang.String,T> getCurrentlyHeldLeases()
T getCurrentlyHeldLease(java.lang.String leaseKey)
leaseKey - key of the lease to retrievevoid addLeasesToRenew(java.util.Collection<T> newLeases)
newLeases - new leases.void clearCurrentlyHeldLeases()
boolean updateLease(T lease, java.util.UUID concurrencyToken) throws DependencyException, InvalidStateException, ProvisionedThroughputException
lease - lease object containing updated dataconcurrencyToken - obtained by calling Lease.getConcurrencyToken for a currently held leaseInvalidStateException - if lease table does not existProvisionedThroughputException - if DynamoDB update fails due to lack of capacityDependencyException - if DynamoDB update fails in an unexpected way