Interface RevokedTokenRepositoryAdapter

All Known Implementing Classes:
RevokedTokenRepositoryAdapterImpl

public interface RevokedTokenRepositoryAdapter
Adapter for revoked token operations with domain-specific exception handling. Translates database constraint violations into business exceptions.
  • Method Details

    • saveRevokedToken

      RevokedTokenEntity saveRevokedToken(String token, LocalDateTime expiresAt)
      Persists a revoked token with its expiration timestamp.
      Parameters:
      token - hashed refresh token to revoke
      expiresAt - token expiration timestamp
      Returns:
      persisted revoked token entity
      Throws:
      TokenAlreadyRevokedException - if token was already revoked
      FailedToRevokeTokenException - if persistence fails
    • isTokenRevoked

      boolean isTokenRevoked(String token)
      Checks if a token has been revoked.
      Parameters:
      token - hashed refresh token to check
      Returns:
      true if token exists in revoked tokens table
      Throws:
      FailedToCheckTokenRevokedException - if check fails
    • deleteExpiredTokens

      void deleteExpiredTokens(LocalDateTime now)
      Removes all revoked tokens that expired before the specified timestamp.
      Parameters:
      now - cutoff timestamp for deletion
      Throws:
      FailedToCleanRevokedTokensException - if cleanup fails