Class MemoryTokensStorage

  • All Implemented Interfaces:
    TokenStore

    public class MemoryTokensStorage
    extends java.lang.Object
    implements TokenStore
    Represents an in-memory storage of tokens.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.lang.String> tokensStorage  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete​(java.lang.String id)
      Remove the token data from storage for the given ID.
      java.lang.String load​(java.lang.String id)
      Load the token data from storage for the given ID.
      void store​(java.lang.String id, java.lang.String tokens)
      Put the token data into storage for the given ID.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • tokensStorage

        private final java.util.Map<java.lang.String,​java.lang.String> tokensStorage
    • Constructor Detail

      • MemoryTokensStorage

        public MemoryTokensStorage()
    • Method Detail

      • load

        public java.lang.String load​(java.lang.String id)
                              throws java.io.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:
        java.io.IOException - An error loading the token data from storage.
      • store

        public void store​(java.lang.String id,
                          java.lang.String tokens)
                   throws java.io.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:
        java.io.IOException - An error storing the token data.
      • delete

        public void delete​(java.lang.String id)
                    throws java.io.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:
        java.io.IOException - An error storing the token data.