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 TypeMethodDescriptionfindAllBySid(AclSid sid) List API tokens by sid.findByToken(String token) GetApiTokenbytokenvalue.listExpiredApiTokens(Instant cutoffDate) 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, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByToken
GetApiTokenbytokenvalue.- Parameters:
token- The token
-
findAllBySid
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
-