Class GoogleAuthenticatorTokenCouchDbRepository

    • Constructor Detail

      • GoogleAuthenticatorTokenCouchDbRepository

        public GoogleAuthenticatorTokenCouchDbRepository​(org.ektorp.CouchDbConnector db,
                                                         boolean createIfNotExists)
    • Method Detail

      • findOneByUidForOtp

        public CouchDbGoogleAuthenticatorToken findOneByUidForOtp​(java.lang.String uid,
                                                                  java.lang.Integer otp)
        Find first by uid, otp pair.
        Parameters:
        uid - uid to search
        otp - 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
      • 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 search
        otp - 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