Interface TokenStore

All Known Implementing Classes:
TokenMemoryCache

public interface TokenStore
Where a client keeps the address validation tokens servers send in NEW_TOKEN frames (RFC 9000 section 8.1.3), by server name, to present in the first Initial of a later connection so the server can skip its Retry round trip.

A token must never be handed out twice: reusing one would let observers link connections (RFC 9000 section 8.1.3). Implementations must be thread-safe.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TokenStore
    A store that keeps nothing.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    put(String serverName, byte[] token)
    Keeps a token for later, one-time use.
    byte[]
    take(String serverName)
    Takes a token for a server, removing it.
  • Field Details

    • NONE

      static final TokenStore NONE
      A store that keeps nothing.
  • Method Details

    • put

      void put(String serverName, byte[] token)
      Keeps a token for later, one-time use.
      Parameters:
      serverName - the server it came from
      token - the token
    • take

      byte[] take(String serverName)
      Takes a token for a server, removing it.
      Parameters:
      serverName - the server
      Returns:
      the token, or null if there is none