Class MemoryTokensStorage

  • All Implemented Interfaces:
    TokenStore

    public class MemoryTokensStorage
    extends Object
    implements TokenStore
    Represents an in-memory storage of tokens.
    • Constructor Detail

      • MemoryTokensStorage

        public MemoryTokensStorage()
    • Method Detail

      • load

        public String load​(String id)
                    throws IOException
        Description copied from interface: TokenStore
        Load the token data from storage for the given ID.
        Specified by:
        load in interface TokenStore
        Parameters:
        id - ID of token data to load.
        Returns:
        The loaded token data.
        Throws:
        IOException - An error loading the token data from storage.
      • store

        public void store​(String id,
                          String tokens)
                   throws IOException
        Description copied from interface: TokenStore
        Put the token data into storage for the given ID.
        Specified by:
        store in interface TokenStore
        Parameters:
        id - ID of token data to store.
        tokens - The token data to store.
        Throws:
        IOException - An error storing the token data.
      • delete

        public void delete​(String id)
                    throws IOException
        Description copied from interface: TokenStore
        Remove the token data from storage for the given ID.
        Specified by:
        delete in interface TokenStore
        Parameters:
        id - ID of token data to store.
        Throws:
        IOException - An error storing the token data.