Interface UserChangePasswordAttemptService<P extends UserChangePasswordAttempt>

All Known Implementing Classes:
DefaultUserChangePasswordAttemptService

public interface UserChangePasswordAttemptService<P extends UserChangePasswordAttempt>
Service for managing UserChangePasswordAttempt.

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

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

    • countConsideredUserChangePasswordAttempts

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

      int countConsideredUserChangePasswordAttempts(String username, String authServerId)
      Count the number of failed and considered change password attempts
      Parameters:
      username - The username to read for
      authServerId - The auth server ID
      Returns:
      The number of failed and considered change password attempts
    • readConsideredUserChangePasswordAttempts

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

      P createUserChangePasswordAttempt(String username, String userId, String changePasswordAttemptResult, String authServerId)
      Create a new user change password attempt.
      Parameters:
      username - The username
      userId - The user ID. This should be non-null since a user can only change a password when they are logged in.
      changePasswordAttemptResult - The change password result. See UserAttemptResult
      authServerId - The auth server id
      Returns:
      The newly created user change password attempt
    • resetChangePasswordAttempts

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

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