java.lang.Object
net.i2p.router.transport.udp.EstablishmentManager.Token
Enclosing class:
EstablishmentManager

public static class EstablishmentManager.Tokenextends Object
Token used for SSU2 session establishment and validation. Contains expiration time and validation data.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    When the token was added, as an epoch second.
    private final int
    When the token expires, as an epoch second.
    private final long
    The token value itself.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Token(long tok, long exp, long now)
    Token for the given value and expiration.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    long
    The expiration time.
    long
    The token value.
    long
    When this token was added.
    String representation.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • token

      private final long token
      The token value itself.
    • expires

      private final int expires
      When the token expires, as an epoch second.
    • added

      private final int added
      When the token was added, as an epoch second.
  • Constructor Details

    • Token

      public Token(long tok, long exp, long now)
      Token for the given value and expiration.
      Parameters:
      tok - nonzero value we later match an inbound request against
      exp - absolute time, not relative to now
      now - absolute time the token was issued, for expiry reporting
  • Method Details

    • getToken

      public long getToken()
      The token value.
      Returns:
      the opaque value we match an incoming request against
    • getExpiration

      public long getExpiration()
      The expiration time.
      Returns:
      the absolute time after which the token is no longer accepted
    • getWhenAdded

      public long getWhenAdded()
      When this token was added.
      Returns:
      the absolute time the token was issued
    • toString

      public String toString()
      String representation.
      Overrides:
      toString in class Object