java.lang.Object
net.i2p.data.i2cp.I2CPMessageImpl
net.i2p.data.i2cp.ReconfigureSessionMessage
- All Implemented Interfaces:
I2CPMessage
Defines the message a client sends to a router when updating the config on an existing session.
Field Summary
Modifier and TypeFieldDescriptionprivate SessionConfigThe new options for that session.private SessionIdThe session being reconfigured.static final intI2CP message type number identifying a session reconfiguration request.Constructor Summary
ConstructorsConstructorDescriptionCreates an empty message, for I2CP deserialization.Method Summary
Public MethodsModifier and TypeMethodDescriptionprotected voiddoReadMessage(InputStream in, int size) Read the message body from the input stream.protected byte[]Write the message body to the output stream.New configuration to apply to the session.Session being reconfigured.intgetType()Reports this message's I2CP type number.Return the SessionId for this message.voidsetSessionConfig(SessionConfig config) Session config for this message.voidSession ID for this message.toString()Returns a string representation of this message.Methods inherited from class I2CPMessageImpl
readBytes, readMessage, readMessage, writeBytes, writeMessageModifier and TypeMethodDescriptionvoidreadBytes(InputStream in) Read the message from the stream, wrapping I2CPMessageException inDataFormatException.voidValidate the type and size of the message, and then read the message into the data structures.voidreadMessage(InputStream in, int length, int type) Read the body into the data structures.voidwriteBytes(OutputStream out) Write the message to the stream, wrapping I2CPMessageException in DataFormatException.voidwriteMessage(OutputStream out) Write out the full message to the stream, including the 4 byte size and 1 byte type header.
Field Details
MESSAGE_TYPE
public static final int MESSAGE_TYPEI2CP message type number identifying a session reconfiguration request.- See Also:
_sessionId
The session being reconfigured._sessionConfig
The new options for that session.
Constructor Details
ReconfigureSessionMessage
public ReconfigureSessionMessage()Creates an empty message, for I2CP deserialization.
Method Details
getSessionId
Session being reconfigured.- Returns:
- the session id, null until set or read
sessionId
Return the SessionId for this message.- Specified by:
sessionIdin interfaceI2CPMessage- Overrides:
sessionIdin classI2CPMessageImpl- Returns:
- null always. Extending classes with a SessionId must override.
setSessionId
Session ID for this message.- Parameters:
id- session to which this reconfiguration applies
getSessionConfig
New configuration to apply to the session.- Returns:
- the session config, null until set or read
setSessionConfig
Session config for this message.- Parameters:
config- new settings to apply to the client session
doReadMessage
Read the message body from the input stream.- Specified by:
doReadMessagein classI2CPMessageImpl- Parameters:
in- positioned just past the 4 byte size and 1 byte type headersize- how many payload bytes remain to be read- Throws:
I2CPMessageException- if the message format is invalidIOException- if there's an error reading from the stream
doWriteMessage
Write the message body to the output stream.- Specified by:
doWriteMessagein classI2CPMessageImpl- Returns:
- byte array
- Throws:
I2CPMessageException- if the message cannot be writtenIOException- if there's an error writing to the stream
getType
public int getType()Reports this message's I2CP type number.- Returns:
- ReconfigureSessionMessage's I2CP type number, for dispatch
toString