Interface TokenStorageAdapter


  • public interface TokenStorageAdapter
    Adapts the token to some activity against the connection type.
    • Method Detail

      • create

        Token create​(Token token,
                     Options options)
              throws DataLayerException
        Create the Token in the database.
        Parameters:
        token - Non null Token to create.
        options - Non null Options to pass through to the underlying implementation.
        Returns:
        token The instance of the newly created token. The newly created token would contain the additional etag information.
        Throws:
        DataLayerException - If the operation failed for a known reason.
      • read

        Token read​(String tokenId,
                   Options options)
            throws DataLayerException
        Performs a read against the database connection and converts the result into a Token.
        Parameters:
        tokenId - The id of the Token to read.
        options - Non null Options to pass through to the underlying implementation.
        Returns:
        Token if found, otherwise null.
        Throws:
        DataLayerException
      • update

        Token update​(Token previous,
                     Token updated,
                     Options options)
              throws DataLayerException
        Update the Token based on whether there were any changes between the two.
        Parameters:
        previous - The non null previous Token to check against.
        updated - The non null Token to update with.
        options - Non null Options to pass through to the underlying implementation.
        Returns:
        A copy of the updated token. The token would contain the updated etag.
        Throws:
        DataLayerException - If the operation failed for a known reason.
      • query

        Collection<Token> query​(TokenFilter query,
                                Options options)
                         throws DataLayerException
        Performs a full-token query using the provided filter.
        Parameters:
        query - The non null filter specification.
        options - Non null Options to pass through to the underlying implementation.
        Throws:
        DataLayerException - If the operation failed, this exception will capture the reason.