Interface TokenGenerator

  • All Known Implementing Classes:
    PersistentResourceTokenGenerator, SynchronizerTokenGenerator

    public interface TokenGenerator
    A generator of tokens. A token isn't simply just an atom or a symbol. It has a type that is related to the way it is used. Because the use of tokens differ, their value (the atom) cannot follow the same pattern and therefore they have to be generated in the way that matches their use. It is why the tokens differ by their type and each type of token has their own generator. As a generator is mapped with a token type, it is expected that such generator is indicated by the annotation TokenGenerator with a token class declaration.
    Author:
    mmoquillon
    • Method Detail

      • generate

        <T extends Token> T generate​(TokenGenerationParameter... parameter)
        Generates a new token by taking into account any of the specified generation parameters.
        Type Parameters:
        T - the concrete type of the token to generate.
        Parameters:
        parameter - the parameter of the token generation.
        Returns:
        a new token.
      • renew

        <T extends Token> T renew​(T token)
        Renews the specified token. The token value will be regenerated.
        Type Parameters:
        T - the concrete type of the token to renew.
        Parameters:
        token - the token to renew.
        Returns:
        the renewed token.