Class GoogleAuthenticatorTokenCouchDbRepository
- java.lang.Object
-
- org.ektorp.support.CouchDbRepositorySupport<CouchDbGoogleAuthenticatorToken>
-
- org.apereo.cas.couchdb.gauth.token.GoogleAuthenticatorTokenCouchDbRepository
-
- All Implemented Interfaces:
org.ektorp.support.GenericRepository<CouchDbGoogleAuthenticatorToken>
public class GoogleAuthenticatorTokenCouchDbRepository extends org.ektorp.support.CouchDbRepositorySupport<CouchDbGoogleAuthenticatorToken>
- Since:
- 6.0.0
-
-
Constructor Summary
Constructors Constructor Description GoogleAuthenticatorTokenCouchDbRepository(org.ektorp.CouchDbConnector db, boolean createIfNotExists)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcount()Total number of tokens stored.longcountByUserId(java.lang.String userId)Token count for a user.voiddeleteToken(CouchDbGoogleAuthenticatorToken token)Delete record, ignoring rev.java.util.Collection<CouchDbGoogleAuthenticatorToken>findByIssuedDateTimeBefore(java.time.LocalDateTime localDateTime)Find by issued date.java.util.List<CouchDbGoogleAuthenticatorToken>findByToken(java.lang.Integer otp)Find by token.java.util.List<CouchDbGoogleAuthenticatorToken>findByUidForOtp(java.lang.String uid, java.lang.Integer otp)Find all by uid, otp pair.java.util.List<CouchDbGoogleAuthenticatorToken>findByUserId(java.lang.String userId)Find tokens by user id.CouchDbGoogleAuthenticatorTokenfindOneByUidForOtp(java.lang.String uid, java.lang.Integer otp)Find first by uid, otp pair.
-
-
-
Method Detail
-
findOneByUidForOtp
public CouchDbGoogleAuthenticatorToken findOneByUidForOtp(java.lang.String uid, java.lang.Integer otp)
Find first by uid, otp pair.- Parameters:
uid- uid to searchotp- otp to search- Returns:
- token for uid, otp pair
-
findByIssuedDateTimeBefore
public java.util.Collection<CouchDbGoogleAuthenticatorToken> findByIssuedDateTimeBefore(java.time.LocalDateTime localDateTime)
Find by issued date.- Parameters:
localDateTime- time to search for tokens before- Returns:
- tokens issued before given date
-
findByUserId
public java.util.List<CouchDbGoogleAuthenticatorToken> findByUserId(java.lang.String userId)
Find tokens by user id.- Parameters:
userId- user id to search for- Returns:
- tokens belonging to use id
-
countByUserId
public long countByUserId(java.lang.String userId)
Token count for a user.- Parameters:
userId- user to count tokens for- Returns:
- count of the user's tokens
-
count
public long count()
Total number of tokens stored.- Returns:
- number of tokens in database
-
deleteToken
public void deleteToken(CouchDbGoogleAuthenticatorToken token)
Delete record, ignoring rev.- Parameters:
token- token to delete
-
findByUidForOtp
public java.util.List<CouchDbGoogleAuthenticatorToken> findByUidForOtp(java.lang.String uid, java.lang.Integer otp)
Find all by uid, otp pair.- Parameters:
uid- uid to searchotp- otp to search- Returns:
- token for uid, otp pair
-
findByToken
public java.util.List<CouchDbGoogleAuthenticatorToken> findByToken(java.lang.Integer otp)
Find by token.- Parameters:
otp- token to search for- Returns:
- token for the otp
-
-