Class Token


  • public class Token
    extends java.lang.Object
    Represents an OAuth Token
    • Constructor Summary

      Constructors 
      Constructor Description
      Token​(java.lang.String tokenId, java.lang.String type, java.lang.String subType, long createdAt, long lastUsedAt, int lifetime, java.lang.String scope, java.lang.String clientId, java.lang.String redirUri, java.lang.String username, java.lang.String stateId, java.lang.String enabled)
      Initialize this Token with the specified parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getClientId()
      Return the clientId of the authorization token.
      long getDateCreated()
      Return the creation date of the token.
      long getDateLastUsed()
      Return the date last used of the token.
      java.lang.String getId()
      Return the id of the token.
      int getLifetime()
      Return the life time of the token in seconds
      java.lang.String getRedirectUri()
      Return the redirectUri of the authorization token.
      java.lang.String getScope()
      Return the scope of the authorization token.
      java.lang.String getStateId()
      Return the StateId of the authorization token.
      java.lang.String getSubType()
      Return the sub-type of the token.
      java.lang.String getType()
      Return the type of the token.
      java.lang.String getUsername()
      Return the Username of the authorization token.
      boolean isEnabled()  
      boolean isExpired()  
      boolean updateUsernameCase​(java.lang.String username)
      Updates the Username's character case.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Token

        public Token​(java.lang.String tokenId,
                     java.lang.String type,
                     java.lang.String subType,
                     long createdAt,
                     long lastUsedAt,
                     int lifetime,
                     java.lang.String scope,
                     java.lang.String clientId,
                     java.lang.String redirUri,
                     java.lang.String username,
                     java.lang.String stateId,
                     java.lang.String enabled)
        Initialize this Token with the specified parameters.
        Parameters:
        tokenId -
        type -
        subType -
        createdAt -
        lastUsedAt -
        lifetime -
        scope -
    • Method Detail

      • getId

        public java.lang.String getId()
        Return the id of the token. If hashed storage is enabled, this will be the hashed value of the token, with a prefix of the hash algorithm
        Returns:
        The id of the token.
      • getType

        public java.lang.String getType()
        Return the type of the token.
        Returns:
        The type of the token.
      • getSubType

        public java.lang.String getSubType()
        Return the sub-type of the token.
        Returns:
        The sub-type of the token.
      • getDateCreated

        public long getDateCreated()
        Return the creation date of the token.
        Returns:
        The creation date of the token in milliseconds.
      • getDateLastUsed

        public long getDateLastUsed()
        Return the date last used of the token.
        Returns:
        The date last used for the token in milliseconds.
      • getLifetime

        public int getLifetime()
        Return the life time of the token in seconds
        Returns:
        The life time of the token.
      • getScope

        public java.lang.String getScope()
        Return the scope of the authorization token.
        Returns:
        The scope of the authorization token.
      • getClientId

        public java.lang.String getClientId()
        Return the clientId of the authorization token.
        Returns:
        The clientId of the authorization token.
      • getRedirectUri

        public java.lang.String getRedirectUri()
        Return the redirectUri of the authorization token.
        Returns:
        The redirectUri of the authorization token.
      • getUsername

        public java.lang.String getUsername()
        Return the Username of the authorization token.
        Returns:
        The Username of the authorization token.
      • updateUsernameCase

        public boolean updateUsernameCase​(java.lang.String username)
        Updates the Username's character case.
        Returns:
        Whether the Username matched and was updated.
      • getStateId

        public java.lang.String getStateId()
        Return the StateId of the authorization token.
        Returns:
        The StateId of the authorization token.
      • isEnabled

        public boolean isEnabled()
      • isExpired

        public boolean isExpired()