Interface PersistentResourceTokenService

  • All Known Implementing Classes:
    DefaultTokenService

    public interface PersistentResourceTokenService
    A service on the persistent token for Silverpeas entities. It wraps the mechanism to compute and to retrieve a token for a given resource handled in Silverpeas.
    Author:
    Yohann Chastagnier
    • Method Detail

      • initialize

        PersistentResourceToken initialize​(EntityReference resource)
                                    throws TokenException
        Initializes the token of the resource referred by the specified EntityReference. If the resource has already a token, this token is then renewed.
        Parameters:
        resource - a reference to the resource for which a token will be initialized.
        Returns:
        a token persisted for the specified resource.
        Throws:
        TokenException - if an unexpected error occurs while initializing a token.
      • get

        PersistentResourceToken get​(String token)
        Gets the token with the specified value from the data source. If no token exists with a such value, then PersistentResourceToken.NoneToken is returned.
        Parameters:
        token - the value of the token to get.
        Returns:
        either the token with the specified value or NoneToken if no such token exists.
      • remove

        void remove​(EntityReference resource)
        Removes quietly the token of the resource referred by the specified entity reference.
        Parameters:
        resource - the resource for which the token has to be removed.
      • remove

        void remove​(String token)
        Removes quietly the specified token.
        Parameters:
        token - the String representation of the token to remove.