Package org.jivesoftware.admin
Class LoginLimitManager
- java.lang.Object
-
- org.jivesoftware.admin.LoginLimitManager
-
public class LoginLimitManager extends Object
Handles recording admin console login attempts and handling temporary lockouts where necessary.- Author:
- Daniel Henninger
-
-
Field Summary
Fields Modifier and Type Field Description static SystemProperty<Long>
MAX_ATTEMPTS_PER_IP
static SystemProperty<Long>
MAX_ATTEMPTS_PER_USERNAME
static SystemProperty<Duration>
PER_IP_ATTEMPT_RESET_INTERVAL
static SystemProperty<Duration>
PER_USERNAME_ATTEMPT_RESET_INTERVAL
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LoginLimitManager
getInstance()
Returns a singleton instance of LoginLimitManager.boolean
hasHitConnectionLimit(String username, String address)
Returns true of the entered username or connecting IP address has hit it's attempt limit.void
recordFailedAttempt(String username, String address)
Records a failed connection attempt.void
recordSuccessfulAttempt(String username, String address)
Clears failed login attempts if a success occurs.
-
-
-
Field Detail
-
MAX_ATTEMPTS_PER_IP
public static final SystemProperty<Long> MAX_ATTEMPTS_PER_IP
-
PER_IP_ATTEMPT_RESET_INTERVAL
public static final SystemProperty<Duration> PER_IP_ATTEMPT_RESET_INTERVAL
-
MAX_ATTEMPTS_PER_USERNAME
public static final SystemProperty<Long> MAX_ATTEMPTS_PER_USERNAME
-
PER_USERNAME_ATTEMPT_RESET_INTERVAL
public static final SystemProperty<Duration> PER_USERNAME_ATTEMPT_RESET_INTERVAL
-
-
Method Detail
-
getInstance
public static LoginLimitManager getInstance()
Returns a singleton instance of LoginLimitManager.- Returns:
- a LoginLimitManager instance.
-
hasHitConnectionLimit
public boolean hasHitConnectionLimit(String username, String address)
Returns true of the entered username or connecting IP address has hit it's attempt limit.- Parameters:
username
- Username being checked.address
- IP address that is connecting.- Returns:
- True if the login attempt limit has been hit.
-
recordFailedAttempt
public void recordFailedAttempt(String username, String address)
Records a failed connection attempt.- Parameters:
username
- Username being attempted.address
- IP address that is attempting.
-
-