Interface TokenStore

All Known Implementing Classes:
InMemoryTokenStore

public interface TokenStore
Pluggable token persistence strategy for AuthenticatedClient.

The SDK ships an InMemoryTokenStore as the default. Adopters implement this SAM to back tokens by an on-disk file, a secret manager, etc. The SDK calls load() once at session start to seed any previously cached token, save(AuthTokenResponse) after every successful authenticate() / refresh, and clear() when the session is explicitly invalidated.

Implementations are expected to be thread-safe.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Drop any persisted token.
    com.qtsurfer.api.client.model.AuthTokenResponse
    Return the persisted token, or null if none.
    void
    save(com.qtsurfer.api.client.model.AuthTokenResponse token)
    Persist the token returned by POST /v1/auth/token.
  • Method Details

    • load

      com.qtsurfer.api.client.model.AuthTokenResponse load()
      Return the persisted token, or null if none.
    • save

      void save(com.qtsurfer.api.client.model.AuthTokenResponse token)
      Persist the token returned by POST /v1/auth/token.
    • clear

      void clear()
      Drop any persisted token.