public class MetaLease extends Lease
MetaLease extends the Lease concept to reference other LeaseSets rather than tunnel endpoints:
Structure:
Lease.getGateway())Key Differences from Lease:
UnsupportedOperationException)Usage Scenarios:
Selection Criteria:
Implementation Status: PRELIMINARY - Subject to change as proposal evolves
| Modifier and Type | Field and Description |
|---|---|
static int | LENGTHMetaLease length in bytes. |
| Constructor and Description |
|---|
MetaLease() |
| Modifier and Type | Method and Description |
|---|---|
boolean | equals(Object object)Compares this Lease with another object for equality. |
int | getCost()Cost value for this lease. |
TunnelId | getTunnelId()UnsupportedOperationException always. |
int | getType()Type identifier for this lease. |
int | hashCode()Hash code based on end time, gateway, and tunnel ID. |
void | readBytes(InputStream in)Reads the lease from an input stream. |
void | setCost(int cost)Set the cost of this lease. |
void | setTunnelId(TunnelId id)UnsupportedOperationException always. |
void | setType(int type)Set the type of this lease. |
String | toString()Returns a string representation of this Lease. |
void | writeBytes(OutputStream out)Writes the lease to an output stream. |
getEndDate, getEndTime, getGateway, isExpired, isExpired, setEndDate, setEndDate, setGatewaycalculateHash, fromBase64, fromByteArray, read, toBase64, toByteArraypublic static final int LENGTH
public boolean equals(Object object)
public int getCost()
public TunnelId getTunnelId()
getTunnelId in class LeaseUnsupportedOperationException - alwayspublic int getType()
public int hashCode()
public void readBytes(InputStream in) throws DataFormatException, IOException
readBytes in interface DataStructurereadBytes in class Leasein - stream to read fromDataFormatException - if the data is improperly formattedIOException - if there was a problem reading the streampublic void setCost(int cost)
cost - the cost valuepublic void setTunnelId(TunnelId id)
setTunnelId in class Leaseid - tunnel IDUnsupportedOperationException - alwayspublic void setType(int type)
type - the typepublic String toString()
public void writeBytes(OutputStream out) throws DataFormatException, IOException
writeBytes in interface DataStructurewriteBytes in class Leaseout - stream to write toDataFormatException - if the data was incomplete or not yet ready to be writtenIOException - if there was a problem writing to the stream