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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEncryptionKey(PublicKey key)Add an encryption key.voidaddLease(Lease lease)booleanequals(Object object)intgetType()Get the type of the data structure.inthashCode()the destination has enough randomness in it to use it by itself for speedvoidreadBytes(InputStream in)This does NOT validate the signaturevoidsetEncryptionKey(PublicKey key)intsize()Number of bytes, NOT including signatureStringtoString()protected voidwriteBytesWithoutSig(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
-
-
-
-
Method Detail
-
getType
public int getType()
Description copied from class:DatabaseEntryGet the type of the data structure. This should be faster than instanceof.
-
setEncryptionKey
public void setEncryptionKey(PublicKey key)
- Overrides:
setEncryptionKeyin classLeaseSet- Throws:
UnsupportedOperationException- always
-
addEncryptionKey
public void addEncryptionKey(PublicKey key)
Description copied from class:LeaseSet2Add an encryption key. Encryption keys should be added in order of server preference, most-preferred first.- Overrides:
addEncryptionKeyin classLeaseSet2- Throws:
UnsupportedOperationException- always
-
readBytes
public void readBytes(InputStream in) throws DataFormatException, IOException
This does NOT validate the signature- Specified by:
readBytesin interfaceDataStructure- Overrides:
readBytesin 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
protected void writeBytesWithoutSig(OutputStream out) throws DataFormatException, IOException
Without sig. This does NOT validate the signature- Overrides:
writeBytesWithoutSigin classLeaseSet2- Throws:
DataFormatExceptionIOException
-
addLease
public void addLease(Lease lease)
- Overrides:
addLeasein classLeaseSet2- Parameters:
lease- must be a MetaLease- Throws:
IllegalArgumentException- if not a MetaLease
-
hashCode
public int hashCode()
the destination has enough randomness in it to use it by itself for speed
-
-