Interface RevokedTokenRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<RevokedTokenEntity,Long>, org.springframework.data.jpa.repository.JpaRepository<RevokedTokenEntity,Long>, org.springframework.data.repository.ListCrudRepository<RevokedTokenEntity,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<RevokedTokenEntity,Long>, org.springframework.data.repository.PagingAndSortingRepository<RevokedTokenEntity,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<RevokedTokenEntity>, org.springframework.data.repository.Repository<RevokedTokenEntity,Long>

public interface RevokedTokenRepository extends org.springframework.data.jpa.repository.JpaRepository<RevokedTokenEntity,Long>
Data access for revoked token entities with operations for token validation and cleanup.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deletes all revoked tokens that expired before the specified timestamp.
    boolean
    Checks if a token exists in the revoked tokens table.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • existsByToken

      boolean existsByToken(String token)
      Checks if a token exists in the revoked tokens table.
      Parameters:
      token - hashed token to check
      Returns:
      true if token is revoked, false otherwise
    • deleteByExpiresAtBefore

      void deleteByExpiresAtBefore(LocalDateTime now)
      Deletes all revoked tokens that expired before the specified timestamp. Used by scheduled cleanup tasks to prevent unbounded table growth.
      Parameters:
      now - cutoff timestamp for deletion