All Implemented Interfaces:
I2CPMessage

public class GetDateMessageextends I2CPMessageImpl
Request the other side to send us what they think the current time is. Only supported from client to router.

Since 0.8.7, optionally include a version string. Since 0.9.11, optionally include options.

  • Field Details

    • MESSAGE_TYPE

      public static final int MESSAGE_TYPE
      I2CP message type ID written to the wire header.
      See Also:
    • _version

      private String _version
      Version string of the client asking.
    • _options

      private Properties _options
      Configuration options of the client asking.
  • Constructor Details

    • GetDateMessage

      public GetDateMessage()
      Builds an empty time request; used by I2CP deserialization.
    • GetDateMessage

      public GetDateMessage(String version)
      Client's version String to be sent to the router; may be null.
      Parameters:
      version - the client's version String to be sent to the router; may be null
    • GetDateMessage

      public GetDateMessage(String version, Properties options)
      Defaults in GetDateMessage options are, in general, NOT honored. Defaults are not serialized out-of-JVM, and the router does not recognize defaults in-JVM. Client side must promote defaults to the primary map.
      Parameters:
      version - the client's version String to be sent to the router; may be null; must be non-null if options is non-null and non-empty.
      options - Client options to be sent to the router; primarily for authentication; may be null; keys and values 255 bytes (not chars) max each
  • Method Details

    • getVersion

      public String getVersion()
      Gets the protocol version.
      Returns:
      may be null
    • getOptions

      public Properties getOptions()
      Retrieve any configuration options for the connection. Primarily for authentication.
      Returns:
      may be null
    • 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()
      I2CP message type sent for this message.
      Returns:
      the I2CP type number of this message
    • toString

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