public.javadoc.org.spincast.plugins.attemptslimiter.Attempt.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.
Attempt (org.spincast:spincast-framework 1.13.0 API)
org.spincast.plugins.attemptslimiter
Interface Attempt
-
- All Known Implementing Classes:
- AttemptDefault
public interface Attempt
Represents the current attempt.
Use its isMaxReached()
method to know
if the action associated with this attempt should
be blocked or allowed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type
Method and Description
void
deleteAttempts()
Deletes all attempts for this action and criterias.
void
incrementAttemptsCount()
Increments the number of attempts.
boolean
isMaxReached()
Max number of attempts reached.
-
-
Method Detail
-
isMaxReached
boolean isMaxReached()
Max number of attempts reached. Your
code should deny the protected action.
-
incrementAttemptsCount
void incrementAttemptsCount()
Increments the number of attempts.
You have to call this method manually if
you don't let the AttemptsManager.attempt(String, org.spincast.plugins.attemptslimiter.AttemptCriteria...)
method do it.
Note that calling this method multiple times won't result in
multiple increments. The count will be incremented only once!
- See Also:
SpincastAttemptsLimiterPluginConfig#getDefaultAttemptAutoIncrementType()}
and {@link AttemptsManager#attempt(String, AttemptAutoIncrementType, AttemptCriteria...)}.
-
deleteAttempts
void deleteAttempts()
Deletes all attempts for this action and criterias.
In some situations, you may want to clear the attempts
when an action is succesfull.
Copyright © 2019. All rights reserved.