public final class ConstrainableLandlordLease extends LandlordLease implements RemoteMethodControl
LandlordLease
.
Instances of this class can be verified using the
LandlordProxyVerifier
class.LandlordProxyVerifier
,
Serialized Formexpiration, serialFormat
Constructor and Description |
---|
ConstrainableLandlordLease(Uuid cookie,
Landlord landlord,
Uuid landlordUuid,
long expiration,
MethodConstraints methodConstraints)
Create a new
ConstrainableLandlordLease . |
Modifier and Type | Method and Description |
---|---|
boolean |
canBatch(Lease lease) |
LeaseMap |
createLeaseMap(long duration) |
boolean |
equals(Object o) |
MethodConstraints |
getConstraints() |
int |
hashCode() |
RemoteMethodControl |
setConstraints(MethodConstraints constraints) |
cancel, doRenew, getProxy, getReferentUuid, identity, toString
getExpiration, getSerialFormat, renew, setSerialFormat
public ConstrainableLandlordLease(Uuid cookie, Landlord landlord, Uuid landlordUuid, long expiration, MethodConstraints methodConstraints)
ConstrainableLandlordLease
.cookie
- a Uuid
that universally and uniquely
identifies the lease this object is to be a proxy forlandlord
- Landlord
object that will be used to
communicate renew and cancel requests to the granter
of the lease.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.expiration
- The initial expiration time of the lease in
milliseconds since the beginning of the epoch.methodConstraints
- the client method constraints to place on
this proxy (may be null
).NullPointerException
- if landlord
,
landlordUuid
, or cookie
is null
.ClassCastException
- if landlord
does not implement RemoteMethodControl
.public RemoteMethodControl setConstraints(MethodConstraints constraints)
setConstraints
in interface RemoteMethodControl
public MethodConstraints getConstraints()
getConstraints
in interface RemoteMethodControl
public boolean canBatch(Lease lease)
canBatch
in interface Lease
canBatch
in class LandlordLease
public LeaseMap createLeaseMap(long duration)
createLeaseMap
in interface Lease
createLeaseMap
in class LandlordLease
public int hashCode()
hashCode
in class LandlordLease
public boolean equals(Object o)
equals
in class LandlordLease
Copyright © 2016–2018. All rights reserved.