public interface AttemptsManager
| Modifier and Type | Method and Description |
|---|---|
Attempt |
attempt(String attemptName,
AttemptCriteria... criterias)
Gets the current
Attempt, given the action to protect
and criterias. |
Attempt |
attempt(String attemptName,
AttemptsAutoIncrementType attemptsAutoIncrementType,
AttemptCriteria... criterias)
Gets the current
Attempt, given the action to protect
and criterias. |
Map<String,AttemptRule> |
getAttemptRulesByActionName()
Gets all the registered
AttemptRule rules,
by action names. |
void |
registerAttempRule(AttemptRule attemptRule)
Registers a
AttemptRule rule. |
void |
registerAttempRule(String actionName,
int nbrMaxAttemptsPerDuration,
Duration duration)
Creates and registers a
AttemptRule
rule from the required informations. |
Attempt attempt(String attemptName, AttemptCriteria... criterias)
Attempt, given the action to protect
and criterias. With this object you can:
Attempt.isMaxReached().
Attempt.incrementAttemptsCount(),
if you didn't let the {attempt(String, AttemptCriteria...)} method do
it automatically
(see SpincastAttemptsLimiterPluginConfig.getDefaultAttemptAutoIncrementType()).
Attempt attempt(String attemptName, AttemptsAutoIncrementType attemptsAutoIncrementType, AttemptCriteria... criterias)
Attempt, given the action to protect
and criterias. With this object you can:
Attempt.isMaxReached().
Attempt.incrementAttemptsCount(),
if you didn't let the {#attempt(String, AttemptAutoIncrementType, AttemptCriteria...))} method do
it automatically.
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.void registerAttempRule(AttemptRule attemptRule)
AttemptRule rule.void registerAttempRule(String actionName, int nbrMaxAttemptsPerDuration, Duration duration)
AttemptRule
rule from the required informations.Map<String,AttemptRule> getAttemptRulesByActionName()
AttemptRule rules,
by action names.Copyright © 2018. All rights reserved.