Record Class LoginAttemptDecision.LockedOut
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.bruteforce.LoginAttemptDecision.LockedOut
- Record Components:
remaining- remaining time before the lockout lifts; non-null, non-negativefailedAttempts- total failures observed for the locked key — informational, never echoed to clients
- All Implemented Interfaces:
LoginAttemptDecision
- Enclosing interface:
LoginAttemptDecision
public static record LoginAttemptDecision.LockedOut(Duration remaining, int failedAttempts)
extends Record
implements LoginAttemptDecision
The caller is locked out. The handler must skip the actual credential
check and respond with a generic "too many failed attempts" error.
-
Nested Class Summary
Nested classes/interfaces inherited from interface LoginAttemptDecision
LoginAttemptDecision.Allowed, LoginAttemptDecision.LockedOutModifier and TypeInterfaceDescriptionstatic final recordThe attempt may proceed.static final recordThe caller is locked out. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefailedAttemptsrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theremainingrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LockedOut
Creates an instance of aLockedOutrecord class.- Parameters:
remaining- the value for theremainingrecord componentfailedAttempts- the value for thefailedAttemptsrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
remaining
-
failedAttempts
public int failedAttempts()Returns the value of thefailedAttemptsrecord component.- Returns:
- the value of the
failedAttemptsrecord component
-