Class PersistentResourceTokenGenerator

  • All Implemented Interfaces:
    TokenGenerator

    public class PersistentResourceTokenGenerator
    extends Object
    implements TokenGenerator
    A generator of PersistentResourceToken instances.
    Author:
    mmoquillon
    • Field Detail

      • RESOURCE_PARAM

        public static final String RESOURCE_PARAM
        The parameter refers the resource for which the token is. The value of the parameter must be an EntityReference to the resource.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PersistentResourceTokenGenerator

        public PersistentResourceTokenGenerator()
    • Method Detail

      • generate

        public PersistentResourceToken generate​(TokenGenerationParameter... parameters)
        Description copied from interface: TokenGenerator
        Generates a new token by taking into account any of the specified generation parameters.
        Specified by:
        generate in interface TokenGenerator
        Parameters:
        parameters - both the identifier and the type of the resource the token to generate has to be belong.
        Returns:
        a new token.
      • renew

        public <T extends Token> T renew​(T token)
        Description copied from interface: TokenGenerator
        Renews the specified token. The token value will be regenerated.
        Specified by:
        renew in interface TokenGenerator
        Type Parameters:
        T - the concrete type of the token to renew.
        Parameters:
        token - the token to renew.
        Returns:
        the renewed token.