java.lang.Object
net.i2p.data.i2cp.I2CPMessageImpl
net.i2p.data.i2cp.ReconfigureSessionMessage
All Implemented Interfaces:
I2CPMessage

public class ReconfigureSessionMessageextends I2CPMessageImpl
Defines the message a client sends to a router when updating the config on an existing session.
  • Field Details

    • MESSAGE_TYPE

      public static final int MESSAGE_TYPE
      I2CP message type number identifying a session reconfiguration request.
      See Also:
    • _sessionId

      private SessionId _sessionId
      The session being reconfigured.
    • _sessionConfig

      private SessionConfig _sessionConfig
      The new options for that session.
  • Constructor Details

    • ReconfigureSessionMessage

      public ReconfigureSessionMessage()
      Creates an empty message, for I2CP deserialization.
  • Method Details

    • getSessionId

      public SessionId getSessionId()
      Session being reconfigured.
      Returns:
      the session id, null until set or read
    • sessionId

      public SessionId sessionId()
      Return the SessionId for this message.
      Specified by:
      sessionId in interface I2CPMessage
      Overrides:
      sessionId in class I2CPMessageImpl
      Returns:
      null always. Extending classes with a SessionId must override.
    • setSessionId

      public void setSessionId(SessionId id)
      Session ID for this message.
      Parameters:
      id - session to which this reconfiguration applies
    • getSessionConfig

      public SessionConfig getSessionConfig()
      New configuration to apply to the session.
      Returns:
      the session config, null until set or read
    • setSessionConfig

      public void setSessionConfig(SessionConfig config)
      Session config for this message.
      Parameters:
      config - new settings to apply to the client session
    • doReadMessage

      protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException
      Read the message body from the input stream.
      Specified by:
      doReadMessage in class I2CPMessageImpl
      Parameters:
      in - positioned just past the 4 byte size and 1 byte type header
      size - how many payload bytes remain to be read
      Throws:
      I2CPMessageException - if the message format is invalid
      IOException - if there's an error reading from the stream
    • doWriteMessage

      protected byte[] doWriteMessage() throws I2CPMessageException, IOException
      Write the message body to the output stream.
      Specified by:
      doWriteMessage in class I2CPMessageImpl
      Returns:
      byte array
      Throws:
      I2CPMessageException - if the message cannot be written
      IOException - 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

      public String toString()
      Returns a string representation of this message.
      Overrides:
      toString in class Object