public class LandlordLeaseMap extends AbstractIDLeaseMap
LeaseMap
for LandlordLease
.LandlordLease
,
LeaseMap
AbstractMap.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, remove
clear, clone, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
clear, compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
private 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
ClassCastException
static Uuid checkLandlordUuid(Uuid landlordUuid) throws NullPointerException
NullPointerException
static Landlord checkLandlord(Landlord landlord) throws NullPointerException
NullPointerException
public boolean canContainKey(Object key)
LeaseMap
key
- an object that should be a leaseLease.canBatch(net.jini.core.lease.Lease)
public void cancelAll() throws LeaseMapException, RemoteException
LeaseMap
LeaseMapException
RemoteException
public void renewAll() throws LeaseMapException, RemoteException
LeaseMap
LeaseMapException
RemoteException
Landlord landlord()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.