Class TokenManagementServiceImpl

java.lang.Object
com.markvarga21.studentmanager.service.auth.impl.TokenManagementServiceImpl
All Implemented Interfaces:
TokenManagementService

@Service public class TokenManagementServiceImpl extends Object implements TokenManagementService
Service for managing tokens.
  • Constructor Details

    • TokenManagementServiceImpl

      public TokenManagementServiceImpl()
  • Method Details

    • blacklistToken

      public void blacklistToken(String token)
      Blacklist a token for revoking further usages of it.
      Specified by:
      blacklistToken in interface TokenManagementService
      Parameters:
      token - The token to blacklist.
    • isBlacklisted

      public boolean isBlacklisted(String token)
      Checks if a token is blacklisted or not.
      Specified by:
      isBlacklisted in interface TokenManagementService
      Parameters:
      token - The token to check.
      Returns:
      true if the token is blacklisted, false otherwise.
    • addToken

      public void addToken(String token)
      Adds a token to the database.
      Specified by:
      addToken in interface TokenManagementService
      Parameters:
      token - The token to add.
    • deleteExpiredTokens

      public void deleteExpiredTokens()
      Deletes expired tokens from the database.
      Specified by:
      deleteExpiredTokens in interface TokenManagementService