public class DefaultLoginAttemptManager extends Object implements LoginAttemptManager, org.springframework.beans.factory.InitializingBean
| Constructor and Description |
|---|
DefaultLoginAttemptManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
LoginAttempt |
create(String username)
Init login attempt to specified username
|
LoginAttempt |
findByUsername(String username)
Get login attempt by specified username
|
long |
getAttemptTimeout() |
short |
getMaxAttempts() |
LoginAttempt |
increaseAttempt(String username)
Increase current attempt for specified username( if no login attempt found, will create one with zero value and increase to 1 )
|
boolean |
isAttemptExhausted(String username)
To judge the user exhaust all the attempt chance.
|
void |
reset(String username)
Set the login attempt (actually the login attempt is revoked from store)
|
void |
setAttemptTimeout(long loginAttemptTimeout) |
void |
setLoginAttemptProvider(LoginAttemptProvider loginAttemptProvider) |
void |
setMaxAttempts(short maxAttempts) |
public void setLoginAttemptProvider(LoginAttemptProvider loginAttemptProvider)
public short getMaxAttempts()
getMaxAttempts in interface LoginAttemptOptionspublic long getAttemptTimeout()
getAttemptTimeout in interface LoginAttemptOptionspublic void setMaxAttempts(short maxAttempts)
setMaxAttempts in interface LoginAttemptOptionsmaxAttempts - The max attempts count, once equals or greater than it , the user will be locked.public void setAttemptTimeout(long loginAttemptTimeout)
setAttemptTimeout in interface LoginAttemptOptionsloginAttemptTimeout - milli seconds , the user login attempts failure count duration ,once equals or greater than it , it will be reset or clear.public LoginAttempt create(String username)
LoginAttemptManagercreate in interface LoginAttemptManagerpublic LoginAttempt findByUsername(String username)
LoginAttemptManagerfindByUsername in interface LoginAttemptManagerpublic void reset(String username)
LoginAttemptManagerreset in interface LoginAttemptManagerpublic LoginAttempt increaseAttempt(String username)
LoginAttemptManagerincreaseAttempt in interface LoginAttemptManagerpublic boolean isAttemptExhausted(String username)
LoginAttemptManagerisAttemptExhausted in interface LoginAttemptManagerCopyright © 2018. All rights reserved.