Interface TokenStorageAdapter

  • All Known Implementing Classes:
    LdapAdapter, TokenStorageAdapter

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

      • create

        Token create​(Token token,
                     org.forgerock.util.Options options)
              throws DataLayerException
        Create the Token in the database.
        Parameters:
        token - Non null Token to create.
        options - Non null Options for the operations.
        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,
                   org.forgerock.util.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 for the operations.
        Returns:
        Token if found, otherwise null.
        Throws:
        DataLayerException
      • update

        Token update​(Token previous,
                     Token updated,
                     org.forgerock.util.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 - The non null Options for the operation.
        Returns:
        A copy of the updated token. The token would contain the updated etag.
        Throws:
        DataLayerException - If the operation failed for a known reason.
        OptimisticConcurrencyCheckFailedException - If the operation failed due to an assertion on the tokens ETag.