public class HostReplyMessage extends I2CPMessageImpl
| Modifier and Type | Field and Description |
|---|---|
static int | MESSAGE_TYPEMESSAGE_TYPE. |
static int | RESULT_DECRYPTION_FAILUREDecryption failure result code. |
static int | RESULT_FAILUREgeneric fail, other codes TBD |
static int | RESULT_KEY_REQUIREDRequest key required result code. |
static int | RESULT_LEASESET_LOOKUP_FAILURE |
static int | RESULT_LOOKUP_TYPE_UNSUPPORTED |
static int | RESULT_SECRET_AND_KEY_REQUIREDRequest secret and key required result code. |
static int | RESULT_SECRET_REQUIREDRequest secret required result code. |
static int | RESULT_SUCCESSRESULT_SUCCESS. |
| Constructor and Description |
|---|
HostReplyMessage()HostReplyMessage. |
HostReplyMessage(SessionId id,
Destination d,
long reqID,
Properties options)A message with RESULT_SUCCESS and a non-null Destination. |
HostReplyMessage(SessionId id,
int failureCode,
long reqID)A message with a failure code and no Destination. |
| Modifier and Type | Method and Description |
|---|---|
protected void | doReadMessage(InputStream in,
int size)doReadMessage. |
protected byte[] | doWriteMessage()doWriteMessage. |
Destination | getDestination()Gets the destination. |
Properties | getOptions()Non-null only if result code is zero and options are present. |
long | getReqID()Gets the request ID. |
int | getResultCode()Gets the result code. |
SessionId | getSessionId()Session id. |
int | getType()Type. |
SessionId | sessionId()Return the SessionId for this message. |
String | toString()Returns a string representation of this message. |
readBytes, readMessage, readMessage, writeBytes, writeMessagepublic static final int MESSAGE_TYPE
public static final int RESULT_DECRYPTION_FAILURE
public static final int RESULT_FAILURE
public static final int RESULT_KEY_REQUIRED
public static final int RESULT_LEASESET_LOOKUP_FAILURE
public static final int RESULT_LOOKUP_TYPE_UNSUPPORTED
public static final int RESULT_SECRET_AND_KEY_REQUIRED
public static final int RESULT_SECRET_REQUIRED
public static final int RESULT_SUCCESS
public HostReplyMessage()
public HostReplyMessage(SessionId id, Destination d, long reqID, Properties options)
id - the session idd - non-nullreqID - 0 to 2**32 - 1options - for replies to lookup types 2-4, may be null, see proposal 167public HostReplyMessage(SessionId id, int failureCode, long reqID)
id - the session idfailureCode - 1-255reqID - from the HostLookup 0 to 2**32 - 1protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException
doReadMessage in class I2CPMessageImplin - InputStreamsize - payload sizeI2CPMessageException - if the message format is invalidIOException - if there's an error reading from the streamprotected byte[] doWriteMessage()
throws I2CPMessageException,
IOExceptiondoWriteMessage in class I2CPMessageImplI2CPMessageException - if the message cannot be writtenIOException - if there's an error writing to the streampublic Destination getDestination()
public Properties getOptions()
public long getReqID()
public int getResultCode()
public SessionId getSessionId()
public int getType()
public SessionId sessionId()
sessionId in interface I2CPMessagesessionId in class I2CPMessageImpl