Interface TokenStore

All Known Implementing Classes:
AbstractTokenService, CookieTokenService, PlainTokenService, RemindPasswordTokenService, TransientTokenService

public interface TokenStore
The token store is a place where temporary tokens are held.
Version:
$Revision$
Author:
Julien Viet
  • Method Summary

    Modifier and Type
    Method
    Description
    createToken(String username)
    Create a token and returns it.
    validateToken(String tokenKey, boolean remove)
    Validates a token.
  • Method Details

    • createToken

      Create a token and returns it. The store state is modified as it retains the token until it is removed either explicitely or because the token validity is expired.
      Parameters:
      username - the username related to the token
      Returns:
      the token key
      Throws:
      IllegalArgumentException - if the validity is not greater than zero
      NullPointerException - if the payload is null
    • validateToken

      String validateToken(String tokenKey, boolean remove) throws NullPointerException
      Validates a token. If the token is valid it returns the attached credentials. The store state may be modified by the removal of the token. The token is removed either if the remove argument is set to true of if the token is not anymore valid.
      Parameters:
      tokenKey - the token key
      remove - true if the token must be removed regardless its validity
      Returns:
      the attached credentials or null
      Throws:
      NullPointerException - if the token key argument is null