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 Summary
Modifier and TypeMethodDescriptionint
countConsideredUserResetPasswordAttempts
(String username, String authServerId) Read the number of failed and considered reset password attemptsint
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.createUserResetPasswordAttempt
(String username, String userId, String resetPasswordAttemptResult, String authServerId) Create a new user reset password attempt.void
purgeResetPasswordAttempts
(Duration resetPasswordAttemptAge, String authServerId) Purges any reset password attempts older than the specified duration.readConsideredUserResetPasswordAttempts
(String username, String authServerId, Duration age) Read failed and considered user reset password attempts for a specific period of time (e.g.void
resetResetPasswordAttempts
(String username, String authServerId) Reset user reset password attempts for a specific username and auth server ID.
-
Method Details
-
countConsideredUserResetPasswordAttempts
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 attemptauthServerId
- The auth server idage
- The period of time- Returns:
- The number of failed and considered reset password attempts
-
countConsideredUserResetPasswordAttempts
Read the number of failed and considered reset password attempts- Parameters:
username
- The username to read forauthServerId
- The auth server ID- Returns:
- The number of failed and considered reset password attempts
-
readConsideredUserResetPasswordAttempts
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 attemptauthServerId
- The auth server idage
- 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 usernameuserId
- 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. SeeUserAttemptResult
authServerId
- The auth server id- Returns:
- The newly created user reset password attempt
-
resetResetPasswordAttempts
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 forauthServerId
- The auth server ID
-
purgeResetPasswordAttempts
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.
-