public interface ILeaseRenewer<T extends Lease>
| Modifier and Type | Method and Description |
|---|---|
void |
addLeasesToRenew(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.
|
void |
dropLease(T lease)
Stops the lease renewer from continunig to maintain the given lease.
|
T |
getCurrentlyHeldLease(String leaseKey) |
Map<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,
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 existMap<String,T> getCurrentlyHeldLeases()
T getCurrentlyHeldLease(String leaseKey)
leaseKey - key of the lease to retrievevoid addLeasesToRenew(Collection<T> newLeases)
newLeases - new leases.void clearCurrentlyHeldLeases()
void dropLease(T lease)
lease - the lease to drop.boolean updateLease(T lease, 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 wayCopyright © 2018. All rights reserved.