
public.javadoc.org.spincast.plugins.attemptslimiter.AttemptsManager.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
AttemptsManager (org.spincast:spincast-framework 2.1.1 API)
Interface AttemptsManager
- All Known Implementing Classes:
AttemptsManagerDefault
public interface AttemptsManager
Attempts manager.
-
Method Summary
Modifier and Type
Method
Description
attempt(String attemptName,
AttemptCriteria... criterias)
Gets the current Attempt
, given the action to protect
and criterias.
attempt(String attemptName,
AttemptsAutoIncrementType attemptsAutoIncrementType,
AttemptCriteria... criterias)
Gets the current Attempt
, given the action to protect
and criterias.
Gets all the registered AttemptRule
rules,
by action names.
void
registerAttempRule(String actionName,
int nbrMaxAttemptsPerDuration,
Duration duration)
Creates and registers a AttemptRule
rule from the required informations.
void
registerAttempRule(AttemptRule attemptRule)
Registers a AttemptRule
rule.
-
Method Details
-
attempt
Gets the current Attempt
, given the action to protect
and criterias. With this object you can:
-
Know if the action should be allowed or blocked,
by calling
Attempt.isMaxReached()
.
-
Manually increment the number of attempts using
Attempt.incrementAttemptsCount()
,
if you didn't let the {attempt(String, AttemptCriteria...)
} method do
it automatically
(see SpincastAttemptsLimiterPluginConfig.getDefaultAttemptAutoIncrementType()
).
-
attempt
Attempt attempt(String attemptName,
AttemptsAutoIncrementType attemptsAutoIncrementType,
AttemptCriteria... criterias)
Gets the current Attempt
, given the action to protect
and criterias. With this object you can:
-
Know if the action should be allowed or blocked,
by calling
Attempt.isMaxReached()
.
-
Manually increment the number of attempts using
Attempt.incrementAttemptsCount()
,
if you didn't let the {{@link #attempt(String, AttemptAutoIncrementType, AttemptCriteria...))}} method do
it automatically.
- Parameters:
attemptsAutoIncrementType
- Specifies if the method should increment the
number of attempts by itself. If you don't let it do it, you need to increment
the number of attempts by yourself, by calling Attempt.incrementAttemptsCount()
on the returned object.
-
registerAttempRule
Registers a AttemptRule
rule.
-
registerAttempRule
Creates and registers a AttemptRule
rule from the required informations.
-
getAttemptRulesByActionName
Map<String,AttemptRule> getAttemptRulesByActionName()
Gets all the registered AttemptRule
rules,
by action names.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy