Class TokenManagementServiceImpl
java.lang.Object
com.markvarga21.studentmanager.service.auth.impl.TokenManagementServiceImpl
- All Implemented Interfaces:
TokenManagementService
Service for managing tokens.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a token to the database.void
blacklistToken
(String token) Blacklist a token for revoking further usages of it.void
Deletes expired tokens from the database.boolean
isBlacklisted
(String token) Checks if a token is blacklisted or not.
-
Constructor Details
-
TokenManagementServiceImpl
public TokenManagementServiceImpl()
-
-
Method Details
-
blacklistToken
Blacklist a token for revoking further usages of it.- Specified by:
blacklistToken
in interfaceTokenManagementService
- Parameters:
token
- The token to blacklist.
-
isBlacklisted
Checks if a token is blacklisted or not.- Specified by:
isBlacklisted
in interfaceTokenManagementService
- Parameters:
token
- The token to check.- Returns:
true
if the token is blacklisted,false
otherwise.
-
addToken
Adds a token to the database.- Specified by:
addToken
in interfaceTokenManagementService
- Parameters:
token
- The token to add.
-
deleteExpiredTokens
public void deleteExpiredTokens()Deletes expired tokens from the database.- Specified by:
deleteExpiredTokens
in interfaceTokenManagementService
-