|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.data.DataStructureImpl
net.i2p.data.i2np.I2NPMessageImpl
net.i2p.data.i2np.DatabaseLookupMessage
public class DatabaseLookupMessage
Defines the message a router sends to another router to search for a key in the network database.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.i2p.data.i2np.I2NPMessageImpl |
---|
I2NPMessageImpl.Builder |
Field Summary | |
---|---|
static int |
MESSAGE_TYPE
|
Fields inherited from class net.i2p.data.i2np.I2NPMessageImpl |
---|
_context, CHECKSUM_LENGTH, DEFAULT_EXPIRATION_MS |
Fields inherited from interface net.i2p.data.i2np.I2NPMessage |
---|
MAX_ID_VALUE, MAX_SIZE |
Constructor Summary | |
---|---|
DatabaseLookupMessage(I2PAppContext context)
|
|
DatabaseLookupMessage(I2PAppContext context,
boolean locallyCreated)
|
Method Summary | |
---|---|
protected int |
calculateWrittenLength()
calculate the message body's length (not including the header and footer |
boolean |
equals(java.lang.Object object)
|
java.util.Set<Hash> |
getDontIncludePeers()
Set of peers that a lookup reply should NOT include |
Hash |
getFrom()
Contains the router who requested this lookup |
TunnelId |
getReplyTunnel()
Contains the tunnel ID a reply should be sent to |
Hash |
getSearchKey()
Defines the key being searched for |
int |
getType()
Return the unique identifier for this type of I2NP message, as defined in the I2NP spec |
int |
hashCode()
|
void |
readMessage(byte[] data,
int offset,
int dataSize,
int type)
Read the body into the data structures, after the initial type byte and the uniqueId / expiration, using the current class's format as defined by the I2NP specification |
void |
setDontIncludePeers(java.util.Set peers)
|
void |
setFrom(Hash from)
|
void |
setReplyTunnel(TunnelId replyTunnel)
|
void |
setSearchKey(Hash key)
|
java.lang.String |
toString()
|
protected int |
writeMessageBody(byte[] out,
int curIndex)
write the message body to the output array, starting at the given index. |
Methods inherited from class net.i2p.data.i2np.I2NPMessageImpl |
---|
createMessage, fromRawByteArray, getMessageExpiration, getMessageSize, getRawMessageSize, getUniqueId, read, readBytes, readBytes, readBytes, readMessage, registerBuilder, setMessageExpiration, setUniqueId, toByteArray, toByteArray, toRawByteArray, verifyUnwritten, writeBytes, written |
Methods inherited from class net.i2p.data.DataStructureImpl |
---|
calculateHash, fromBase64, fromByteArray, read, toBase64 |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.i2p.data.DataStructure |
---|
calculateHash, fromBase64, fromByteArray, toBase64 |
Field Detail |
---|
public static final int MESSAGE_TYPE
Constructor Detail |
---|
public DatabaseLookupMessage(I2PAppContext context)
public DatabaseLookupMessage(I2PAppContext context, boolean locallyCreated)
Method Detail |
---|
public Hash getSearchKey()
public void setSearchKey(Hash key)
public Hash getFrom()
public void setFrom(Hash from)
public TunnelId getReplyTunnel()
public void setReplyTunnel(TunnelId replyTunnel)
public java.util.Set<Hash> getDontIncludePeers()
public void setDontIncludePeers(java.util.Set peers)
public void readMessage(byte[] data, int offset, int dataSize, int type) throws I2NPMessageException, java.io.IOException
I2NPMessage
data
- data to read fromoffset
- where to start in the data arraydataSize
- how long into the data to readtype
- I2NP message type
I2NPMessageException
- if the stream doesn't contain a valid message
that this class can read.
java.io.IOException
- if there is a problem reading from the streamprotected int calculateWrittenLength()
I2NPMessageImpl
calculateWrittenLength
in class I2NPMessageImpl
protected int writeMessageBody(byte[] out, int curIndex) throws I2NPMessageException
I2NPMessageImpl
writeMessageBody
in class I2NPMessageImpl
I2NPMessageException
public int getType()
I2NPMessage
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |