Interface LoginAttemptManager

All Known Implementing Classes:
LoginAttemptManagerImpl

public interface LoginAttemptManager
Keeps track of login success and failures per user.
The logic to lock/unlock users is up to the implementation.
Since:
4.1.2
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Get the number of seconds left for the user to be unlocked, or 0 if the user is not locked.
    boolean
    isUserLocked(String username)
    Indicates if a user is currently locked.
    void
    loginFailed(String username)
    Notify this manager that a login attempt has failed for the given user.
    void
    Notify this manager that a login attempt has succeeded for the given user.
  • Method Details

    • isUserLocked

      boolean isUserLocked(String username)
      Indicates if a user is currently locked.
      A locked user is not allowed to log in
      Parameters:
      username - the username
      Returns:
      true if the user is locked, false otherwise
    • getUserLockTimeLeftSeconds

      long getUserLockTimeLeftSeconds(String username)
      Get the number of seconds left for the user to be unlocked, or 0 if the user is not locked.
      Parameters:
      username - the username
      Returns:
      the number of seconds left for the user to be unlocked, or 0 if the user is not locked.
    • loginSucceeded

      void loginSucceeded(String username)
      Notify this manager that a login attempt has succeeded for the given user.
      Parameters:
      username - the username
    • loginFailed

      void loginFailed(String username)
      Notify this manager that a login attempt has failed for the given user.
      Parameters:
      username - the username