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