abstract class RegistrarLease extends AbstractLease implements ReferentUuid
Modifier and Type | Field and Description |
---|---|
(package private) Uuid |
leaseID
The internal lease id.
|
(package private) ServiceID |
registrarID
The registrar's service ID.
|
private static long |
serialVersionUID |
(package private) Registrar |
server
The registrar.
|
expiration, serialFormat
Constructor and Description |
---|
RegistrarLease(Registrar server,
ServiceID registrarID,
Uuid leaseID,
long expiration)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canBatch(Lease lease)
Two leases can be batched if they are both RegistrarLeases and
have the same server.
|
LeaseMap |
createLeaseMap(long duration)
Creates a lease map.
|
boolean |
equals(Object obj)
Returns true if lease Uuids match, false otherwise.
|
(package private) abstract String |
getLeaseType()
Returns the type of the lease.
|
Uuid |
getReferentUuid()
Returns the lease Uuid.
|
(package private) abstract Object |
getRegID()
Returns the service ID, or the event ID as a Long.
|
(package private) Registrar |
getRegistrar()
Returns the registrar.
|
(package private) ServiceID |
getRegistrarID()
Returns the registrar's service ID.
|
int |
hashCode()
Returns the lease Uuid's hash code.
|
private void |
readObject(ObjectInputStream in)
Reads the default serializable field values for this instance, followed
by the registrar's service ID encoded as specified by the
ServiceID.writeBytes method.
|
private void |
readObjectNoData()
Throws InvalidObjectException, since data for this class is required.
|
(package private) void |
setExpiration(long expiration)
Sets the expiration.
|
String |
toString()
Returns a string created from the proxy class name, the registrar's
service ID, the id of the lessee or event (depending on the subclass),
and the result of the underlying server proxy's toString method.
|
private void |
writeObject(ObjectOutputStream out)
Writes the default serializable field values for this instance, followed
by the registrar's service ID encoded as specified by the
ServiceID.writeBytes method.
|
doRenew, getExpiration, getSerialFormat, renew, setSerialFormat
private static final long serialVersionUID
final Registrar server
transient ServiceID registrarID
final Uuid leaseID
public LeaseMap createLeaseMap(long duration)
createLeaseMap
in interface Lease
duration
- the duration to put into a Long and use as the
value for the current lease in the created LeaseMappublic boolean canBatch(Lease lease)
public Uuid getReferentUuid()
getReferentUuid
in interface ReferentUuid
Uuid
associated with the
resource this proxy represents. Will not
return null
.public int hashCode()
public boolean equals(Object obj)
public String toString()
Registrar getRegistrar()
ServiceID getRegistrarID()
abstract Object getRegID()
abstract String getLeaseType()
void setExpiration(long expiration)
private void writeObject(ObjectOutputStream out) throws IOException
IOException
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
private void readObjectNoData() throws ObjectStreamException
ObjectStreamException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.