Class RevokedTokenRepositoryAdapterImpl
java.lang.Object
com.example.blogs.app.api.auth.repository.adapter.RevokedTokenRepositoryAdapterImpl
- All Implemented Interfaces:
RevokedTokenRepositoryAdapter
@Component
public class RevokedTokenRepositoryAdapterImpl
extends Object
implements RevokedTokenRepositoryAdapter
Translates database constraint violations and SQL errors into domain-specific exceptions
for revoked token operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves all revoked tokens that expired before the specified timestamp.booleanisTokenRevoked(String token) Checks if a token has been revoked.saveRevokedToken(String token, LocalDateTime expiresAt) Persists a revoked token with its expiration timestamp.
-
Constructor Details
-
RevokedTokenRepositoryAdapterImpl
public RevokedTokenRepositoryAdapterImpl()
-
-
Method Details
-
saveRevokedToken
Description copied from interface:RevokedTokenRepositoryAdapterPersists a revoked token with its expiration timestamp.- Specified by:
saveRevokedTokenin interfaceRevokedTokenRepositoryAdapter- Parameters:
token- hashed refresh token to revokeexpiresAt- token expiration timestamp- Returns:
- persisted revoked token entity
-
isTokenRevoked
Description copied from interface:RevokedTokenRepositoryAdapterChecks if a token has been revoked.- Specified by:
isTokenRevokedin interfaceRevokedTokenRepositoryAdapter- Parameters:
token- hashed refresh token to check- Returns:
- true if token exists in revoked tokens table
-
deleteExpiredTokens
Description copied from interface:RevokedTokenRepositoryAdapterRemoves all revoked tokens that expired before the specified timestamp.- Specified by:
deleteExpiredTokensin interfaceRevokedTokenRepositoryAdapter- Parameters:
now- cutoff timestamp for deletion
-