public class LandlordLeaseMap extends AbstractLeaseMap
LeaseMap
for LandlordLease
.LandlordLease
,
LeaseMap
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 . |
map
Constructor and Description |
---|
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) Landlord |
landlord()
Return the landlord.
|
void |
renewAll()
Renews all leases in the LeaseMap, using their current values as
the renewal durations.
|
checkKey, checkValue, clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
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
.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-2016, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.