Package net.i2p.data
Class MetaLeaseSet
java.lang.Object
net.i2p.data.DataStructureImpl
net.i2p.data.DatabaseEntry
net.i2p.data.LeaseSet
net.i2p.data.LeaseSet2
net.i2p.data.MetaLeaseSet
- All Implemented Interfaces:
Serializable
,DataStructure
public class MetaLeaseSet extends LeaseSet2
PRELIMINARY - Subject to change - see proposal 123
- Since:
- 0.9.38
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class net.i2p.data.LeaseSet2
_expires, _flags, _offlineSignature, _options, _published, _transientExpires, _transientSigningPublicKey
Fields inherited from class net.i2p.data.LeaseSet
_byteified, _checked, _destination, _encryptionKey, _lastExpiration, _leases, _receivedAsPublished, _signingKey, MAX_LEASES
Fields inherited from class net.i2p.data.DatabaseEntry
_signature, KEY_TYPE_ENCRYPTED_LS2, KEY_TYPE_LEASESET, KEY_TYPE_LS2, KEY_TYPE_META_LS2, KEY_TYPE_ROUTERINFO, KEY_TYPE_SERVICE_LIST, KEY_TYPE_SERVICE_RECORD
-
Constructor Summary
Constructors Constructor Description MetaLeaseSet()
-
Method Summary
Modifier and Type Method Description void
addEncryptionKey(PublicKey key)
Add an encryption key.void
addLease(Lease lease)
boolean
equals(Object object)
int
getType()
Get the type of the data structure.int
hashCode()
the destination has enough randomness in it to use it by itself for speedvoid
readBytes(InputStream in)
This does NOT validate the signaturevoid
setEncryptionKey(PublicKey key)
int
size()
Number of bytes, NOT including signatureString
toString()
protected void
writeBytesWithoutSig(OutputStream out)
Without sig.Methods inherited from class net.i2p.data.LeaseSet2
encrypt, getBlindedHash, getBytes, getEncryptionKey, getEncryptionKey, getEncryptionKeys, getExpires, getOption, getPublished, getReceivedAsPublished, getTransientExpiration, getTransientSigningKey, isBlindedWhenPublished, isCurrent, isOffline, isUnpublished, offlineSign, readHeader, readOfflineBytes, setBlindedHash, setBlindedWhenPublished, setOfflineSignature, setOptions, setSigningKey, setUnpublished, sign, verifyOfflineSignature, verifyOfflineSignature, verifySignature, writeBody, writeBytes, writeHeader, writeOfflineBytes
Methods inherited from class net.i2p.data.LeaseSet
getDate, getDestination, getEarliestLeaseDate, getKeysAndCert, getLatestLeaseDate, getLease, getLeaseCount, getReceivedAsReply, getReceivedBy, getSigningKey, setDestination, setReceivedAsPublished, setReceivedAsReply, setReceivedBy, verifySignature
Methods inherited from class net.i2p.data.DatabaseEntry
getHash, getRoutingKey, getSignature, getSigningPublicKey, isLeaseSet, isLeaseSet, setSignature, validateRoutingKey
Methods inherited from class net.i2p.data.DataStructureImpl
calculateHash, fromBase64, fromByteArray, read, toBase64, toByteArray
-
Constructor Details
-
MetaLeaseSet
public MetaLeaseSet()
-
-
Method Details
-
getType
public int getType()Description copied from class:DatabaseEntry
Get the type of the data structure. This should be faster than instanceof. -
setEncryptionKey
- Overrides:
setEncryptionKey
in classLeaseSet
- Throws:
UnsupportedOperationException
- always
-
addEncryptionKey
Description copied from class:LeaseSet2
Add an encryption key. Encryption keys should be added in order of server preference, most-preferred first.- Overrides:
addEncryptionKey
in classLeaseSet2
- Throws:
UnsupportedOperationException
- always
-
readBytes
This does NOT validate the signature- Specified by:
readBytes
in interfaceDataStructure
- Overrides:
readBytes
in classLeaseSet2
- Parameters:
in
- stream to read from- Throws:
IllegalStateException
- if called more than once or Destination already setDataFormatException
- if the data is improperly formattedIOException
- if there was a problem reading the stream
-
writeBytesWithoutSig
Without sig. This does NOT validate the signature- Overrides:
writeBytesWithoutSig
in classLeaseSet2
- Throws:
DataFormatException
IOException
-
size
public int size()Number of bytes, NOT including signature -
addLease
- Overrides:
addLease
in classLeaseSet2
- Parameters:
lease
- must be a MetaLease- Throws:
IllegalArgumentException
- if not a MetaLease
-
equals
-
hashCode
public int hashCode()the destination has enough randomness in it to use it by itself for speed -
toString
-