Class UserCanTryAgainToLoginVerifier
- java.lang.Object
-
- org.silverpeas.core.security.authentication.verifier.UserCanTryAgainToLoginVerifier
-
public class UserCanTryAgainToLoginVerifier extends Object
Class that provides tools to verify if the user can try to log in one more time after a login error.- Author:
- Yohann Chastagnier Date: 05/02/13
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.silverpeas.kernel.bundle.SettingBundle
otherSettings
protected static org.silverpeas.kernel.bundle.SettingBundle
settings
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UserCanTryAgainToLoginVerifier
clearCache()
Clearing the cache associated to the user.void
clearSession(javax.servlet.http.HttpServletRequest request)
Clearing the HTTP session.protected static UserCanTryAgainToLoginVerifier
get(User user)
Gets a verifier of user connection for the specified user.String
getErrorDestination()
Gets the error destination.String
getMessage()
Gets the (warning) message according to connection attempts.protected static String
getString(String key, String language, String... params)
User
getUser()
Gets the user.protected static UserDetail
getUserById(String userId)
Gets a user from its identifier.boolean
isActivated()
Indicates if the verifier is activated.String
performRequestUrl(javax.servlet.http.HttpServletRequest request, String originalUrl)
Performs request and an original url.void
setUser(User user)
Sets the user.UserCanTryAgainToLoginVerifier
verify()
Verify user connection attempts and block user account if necessary.
-
-
-
Method Detail
-
isActivated
public boolean isActivated()
Indicates if the verifier is activated.- Returns:
- true if this verifier has to be used. False otherwise.
-
performRequestUrl
public String performRequestUrl(javax.servlet.http.HttpServletRequest request, String originalUrl)
Performs request and an original url.- Parameters:
request
- the incoming HTTP request for login.originalUrl
- the URL at which the user should be directed if all is ok.- Returns:
- the actual destination URL once this verifier completed its work.
-
getMessage
public String getMessage()
Gets the (warning) message according to connection attempts.- Returns:
- the message to render to the user for its login attempt.
-
getErrorDestination
public String getErrorDestination()
Gets the error destination.- Returns:
- relative URL of the web page for login errors.
-
verify
public UserCanTryAgainToLoginVerifier verify() throws AuthenticationNoMoreUserConnectionAttemptException
Verify user connection attempts and block user account if necessary.
-
clearCache
public UserCanTryAgainToLoginVerifier clearCache()
Clearing the cache associated to the user.
-
clearSession
public void clearSession(javax.servlet.http.HttpServletRequest request)
Clearing the HTTP session.
-
get
protected static UserCanTryAgainToLoginVerifier get(User user)
Gets a verifier of user connection for the specified user.- Parameters:
user
- the user behind the login attempt.- Returns:
- an instance of this verifier for the given user.
-
setUser
public void setUser(User user)
Sets the user.- Parameters:
user
- the user to set
-
getUser
public User getUser()
Gets the user.- Returns:
- the user
-
getUserById
protected static UserDetail getUserById(String userId)
Gets a user from its identifier.- Parameters:
userId
- the unique identifier of the user- Returns:
- the user
-
-