Class AuthenticationTokenManager.Token

java.lang.Object
org.ametys.core.authentication.token.AuthenticationTokenManager.Token
Enclosing class:
AuthenticationTokenManager

public static class AuthenticationTokenManager.Token extends Object
An Ametys authentication token
  • Field Details

  • Constructor Details

    • Token

      protected Token(Integer id, String type, String comment, Date creationDate, Date endDate, Date lastUpdateDate, Integer nbUsesLeft, Long autoRenewDuration, Set<String> contexts)
      Creates a Token
      Parameters:
      id - The identifier
      type - The type of token
      comment - The comment. Can be null.
      creationDate - The creation date. Can be null.
      endDate - The end date. Can be null.
      lastUpdateDate - The last update date. Can be null.
      nbUsesLeft - nb of uses left for this token (null for no limitation)
      autoRenewDuration - duration that will be added (from "now") each time the token is updated
      contexts - contexts of the token (ressource id for example)
  • Method Details

    • getId

      public Integer getId()
      Get the token identifier
      Returns:
      The identifier
    • getType

      public String getType()
      Get the token type
      Returns:
      The type
    • getComment

      public String getComment()
      Get the associated creation comment
      Returns:
      The comment or null
    • getCreationDate

      Get the creation date of the token
      Returns:
      The creation date or null
    • getEndDate

      public Date getEndDate()
      Get the end date of the token validity
      Returns:
      The end date or null
    • getLastUpdateDate

      Get the last update date of the token
      Returns:
      The last update date or null
    • getAutoRenewDuration

      Get the duration which the token should be automatically renewed on each use, in seconds
      Returns:
      The auto renewal duration in seconds or null if not applicable
    • getContexts

      public Set<String> getContexts()
      Get the context on which the token can be used
      Returns:
      The token contexts or null if not applicable
    • getNbUsesLeft

      Get the number of uses allowed for this token
      Returns:
      The number of allowed uses or null if not applicable