Interface UserResetPasswordAttemptService<P extends UserResetPasswordAttempt>

All Known Implementing Classes:
DefaultUserResetPasswordAttemptService

public interface UserResetPasswordAttemptService<P extends UserResetPasswordAttempt>
Service for managing UserResetPasswordAttempt.

This service should be used when performing CRUD operations using reset password attempts. Generally, reset password attempts should not be created directly, but instead allow UserLockoutService to manage creation of reset password attempts.

Since:
2.1.3
Author:
Julia Lopez-Pozas (jpozas)
  • Method Details

    • countConsideredUserResetPasswordAttempts

      int countConsideredUserResetPasswordAttempts(String username, String authServerId, Duration age)
      Count number of failed and considered user reset password attempts for a specific period of time (e.g. for the last 24 hours)
      Parameters:
      username - The username used in the reset password attempt
      authServerId - The auth server id
      age - The period of time
      Returns:
      The number of failed and considered reset password attempts
    • countConsideredUserResetPasswordAttempts

      int countConsideredUserResetPasswordAttempts(String username, String authServerId)
      Read the number of failed and considered reset password attempts
      Parameters:
      username - The username to read for
      authServerId - The auth server ID
      Returns:
      The number of failed and considered reset password attempts
    • readConsideredUserResetPasswordAttempts

      List<P> readConsideredUserResetPasswordAttempts(String username, String authServerId, Duration age)
      Read failed and considered user reset password attempts for a specific period of time (e.g. for the last 24 hours)
      Parameters:
      username - The username used in the reset password attempt
      authServerId - The auth server id
      age - The period of time
      Returns:
      The list of failed and considered reset password attempts
    • createUserResetPasswordAttempt

      P createUserResetPasswordAttempt(String username, @Nullable String userId, String resetPasswordAttemptResult, String authServerId)
      Create a new user reset password attempt.
      Parameters:
      username - The username
      userId - The user ID. This is nullable, as an attempt could be made to reset the password using a specific username, but no user exists for that username.
      resetPasswordAttemptResult - The reset password result. See UserAttemptResult
      authServerId - The auth server id
      Returns:
      The newly created user reset password attempt
    • resetResetPasswordAttempts

      void resetResetPasswordAttempts(String username, String authServerId)
      Reset user reset password attempts for a specific username and auth server ID. This should generally be called on a successful reset password attempt
      Parameters:
      username - The username to reset password reset attempts for
      authServerId - The auth server ID
    • purgeResetPasswordAttempts

      void purgeResetPasswordAttempts(Duration resetPasswordAttemptAge, @Nullable String authServerId)
      Purges any reset password attempts older than the specified duration.
      Parameters:
      resetPasswordAttemptAge - The age of reset password attempts to purge. Any attempts greater than or equal to this age will be deleted.
      authServerId - The auth server ID of reset password attempts to purge. Optional.