Interface ApiTokenPersistence

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

public interface ApiTokenPersistence extends org.springframework.data.jpa.repository.JpaRepository<ApiToken,Long>
ApiToken persistence.
  • Method Summary

    Modifier and Type
    Method
    Description
    List API tokens by sid.
    Get ApiToken by token value.
    List API tokens with expiration date before the cut-off date.

    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, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlush

    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

    • findByToken

      Optional<ApiToken> findByToken(String token)
      Get ApiToken by token value.
      Parameters:
      token - The token
    • findAllBySid

      List<ApiToken> findAllBySid(AclSid sid)
      List API tokens by sid.
      Parameters:
      sid - The sid
      Returns:
      the list of tokens
    • listExpiredApiTokens

      @Query("select apitoken from ApiToken apitoken where apitoken.expires > :cutoffDate") List<AclSid> listExpiredApiTokens(Instant cutoffDate)
      List API tokens with expiration date before the cut-off date.
      Parameters:
      cutoffDate - The cut-off time
      Returns:
      the list of tokens with expiration date earlier than before