Class DefaultUserChangePasswordAttemptService<P extends UserChangePasswordAttempt,D extends com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware & com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable>
java.lang.Object
com.broadleafcommerce.auth.user.service.DefaultUserChangePasswordAttemptService<P,D>
- All Implemented Interfaces:
UserChangePasswordAttemptService<P>
public class DefaultUserChangePasswordAttemptService<P extends UserChangePasswordAttempt,D extends com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware & com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable>
extends Object
implements UserChangePasswordAttemptService<P>
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultUserChangePasswordAttemptService(UserChangePasswordAttemptRepository<D> repository, SimplePayloadMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionintcountConsideredUserChangePasswordAttempts(String username, String authServerId) Count the number of failed and considered change password attemptsintcountConsideredUserChangePasswordAttempts(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.protected SimplePayloadMapperprotected UserChangePasswordAttemptRepository<D>protected com.broadleafcommerce.common.extension.TypeFactoryvoidpurgeChangePasswordAttempts(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.voidresetChangePasswordAttempts(String username, String authServerId) Reset user change password attempts for a specific username and auth server ID.
-
Constructor Details
-
DefaultUserChangePasswordAttemptService
public DefaultUserChangePasswordAttemptService(UserChangePasswordAttemptRepository<D> repository, SimplePayloadMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
countConsideredUserChangePasswordAttempts
public int countConsideredUserChangePasswordAttempts(String username, String authServerId, Duration age) Description copied from interface:UserChangePasswordAttemptServiceCount number of failed and considered user change password attempts for a specific period of time (e.g. for the last 24 hours)- Specified by:
countConsideredUserChangePasswordAttemptsin interfaceUserChangePasswordAttemptService<P extends UserChangePasswordAttempt>- 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
Description copied from interface:UserChangePasswordAttemptServiceCount the number of failed and considered change password attempts- Specified by:
countConsideredUserChangePasswordAttemptsin interfaceUserChangePasswordAttemptService<P extends UserChangePasswordAttempt>- Parameters:
username- The username to read forauthServerId- The auth server ID- Returns:
- The number of failed and considered change password attempts
-
readConsideredUserChangePasswordAttempts
public List<P> readConsideredUserChangePasswordAttempts(String username, String authServerId, Duration age) Description copied from interface:UserChangePasswordAttemptServiceRead user failed and considered change password attempts for a specific period of time (e.g. for the last 24 hours)- Specified by:
readConsideredUserChangePasswordAttemptsin interfaceUserChangePasswordAttemptService<P extends UserChangePasswordAttempt>- 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
public P createUserChangePasswordAttempt(String username, String userId, String changePasswordAttemptResult, String authServerId) Description copied from interface:UserChangePasswordAttemptServiceCreate a new user change password attempt.- Specified by:
createUserChangePasswordAttemptin interfaceUserChangePasswordAttemptService<P extends UserChangePasswordAttempt>- 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. SeeUserAttemptResultauthServerId- The auth server id- Returns:
- The newly created user change password attempt
-
resetChangePasswordAttempts
Description copied from interface:UserChangePasswordAttemptServiceReset user change password attempts for a specific username and auth server ID. This should generally be called on a successful change password attempt- Specified by:
resetChangePasswordAttemptsin interfaceUserChangePasswordAttemptService<P extends UserChangePasswordAttempt>- Parameters:
username- The username to reset password change attempts forauthServerId- The auth server ID
-
purgeChangePasswordAttempts
public void purgeChangePasswordAttempts(Duration changePasswordAttemptAge, @Nullable String authServerId) Description copied from interface:UserChangePasswordAttemptServicePurges any change password attempts older than the specified duration.- Specified by:
purgeChangePasswordAttemptsin interfaceUserChangePasswordAttemptService<P extends UserChangePasswordAttempt>- 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.
-
getRepository
-
getMapper
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-