Class NoopLoginAttemptPolicy
java.lang.Object
com.svenruppert.jsentinel.bruteforce.NoopLoginAttemptPolicy
- All Implemented Interfaces:
LoginAttemptPolicy
Default
LoginAttemptPolicy — never throttles, never records.
Used as the resolver fallback when no SPI implementation is registered.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeforeAttempt(LoginAttemptContext context) Decides whether the attempt described bycontextmay proceed.voidrecordFailure(LoginAttemptContext context) Records a failed attempt.voidrecordSuccess(LoginAttemptContext context) Records a successful attempt.
-
Field Details
-
INSTANCE
Singleton instance.
-
-
Constructor Details
-
NoopLoginAttemptPolicy
public NoopLoginAttemptPolicy()Public forServiceLoaderdiscovery. PreferINSTANCE.
-
-
Method Details
-
beforeAttempt
Description copied from interface:LoginAttemptPolicyDecides whether the attempt described bycontextmay proceed. Implementations must not mutate the failure counter here — that is the responsibility ofLoginAttemptPolicy.recordSuccess(LoginAttemptContext)/LoginAttemptPolicy.recordFailure(LoginAttemptContext)after the actual check.- Specified by:
beforeAttemptin interfaceLoginAttemptPolicy- Parameters:
context- attempt context- Returns:
- decision; never
null
-
recordSuccess
Description copied from interface:LoginAttemptPolicyRecords a successful attempt. Implementations typically reset the per-key failure counter so a successful login lifts a partial lockout immediately.- Specified by:
recordSuccessin interfaceLoginAttemptPolicy- Parameters:
context- attempt context
-
recordFailure
Description copied from interface:LoginAttemptPolicyRecords a failed attempt. Implementations typically increment a per-key counter and may escalate the throttling decision.- Specified by:
recordFailurein interfaceLoginAttemptPolicy- Parameters:
context- attempt context
-