public class LandlordLeaseMap extends AbstractIDLeaseMap
LeaseMap for LandlordLease.LandlordLease,
LeaseMapAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Field and Description |
|---|---|
private Landlord |
landlord
The landlord which this map will talk to.
|
private Uuid |
landlordUuid
The
Uuid of the landlord. |
| Modifier | Constructor and Description |
|---|---|
private |
LandlordLeaseMap(Landlord landlord,
Uuid landlordUuid,
Lease lease) |
(package private) |
LandlordLeaseMap(Landlord landlord,
Uuid landlordUuid,
Lease lease,
long duration)
Create a new
LandlordLeaseMap. |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelAll()
Cancels all leases in the LeaseMap.
|
boolean |
canContainKey(Object key)
Returns true if the given object is a Lease which can be renewed
and cancelled in a batch with other leases in the map.
|
(package private) static Landlord |
checkLandlord(Landlord landlord) |
(package private) static Uuid |
checkLandlordUuid(Uuid landlordUuid) |
(package private) static Lease |
checkLease(Lease lease) |
(package private) Landlord |
landlord()
Return the landlord.
|
void |
renewAll()
Renews all leases in the LeaseMap, using their current values as
the renewal durations.
|
containsKey, containsValue, entrySet, get, put, removeclear, clone, equals, hashCode, isEmpty, keySet, putAll, size, toString, valuesfinalize, getClass, notify, notifyAll, wait, wait, waitclear, compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, valuesprivate final Landlord landlord
LandlordLeaseMap(Landlord landlord, Uuid landlordUuid, Lease lease, long duration)
LandlordLeaseMap.landlord - Owner of the resource lease is for.landlordUuid - a universally unique id that has been
assigned to the server granting of the lease.
Ideally the Uuid landlord.getUuid would
return if landlord implemented
ReferentUuid. Used to determine when
two leases can be batched together.lease - first lease to be placed in the map. It is
assumed that canContainKey(lease)
would be true. Must work with the
landlord protocol.duration - the duration the lease should be renewed for if
renewAll is calledNullPointerException - if landlord or
landlordUuid is null.static Lease checkLease(Lease lease) throws ClassCastException
ClassCastExceptionstatic Uuid checkLandlordUuid(Uuid landlordUuid) throws NullPointerException
NullPointerExceptionstatic Landlord checkLandlord(Landlord landlord) throws NullPointerException
NullPointerExceptionpublic boolean canContainKey(Object key)
LeaseMapkey - an object that should be a leaseLease.canBatch(net.jini.core.lease.Lease)public void cancelAll()
throws LeaseMapException,
RemoteException
LeaseMapLeaseMapExceptionRemoteExceptionpublic void renewAll()
throws LeaseMapException,
RemoteException
LeaseMapLeaseMapExceptionRemoteExceptionLandlord landlord()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.