Class AttemptDefault
java.lang.Object
org.spincast.plugins.attemptslimiter.AttemptDefault
- All Implemented Interfaces:
Attempt
-
Constructor Summary
ConstructorDescriptionAttemptDefault
(SpincastAttemptsLimiterPluginRepository spincastAttemptsLimiterPlguinRepository, SpincastAttemptsLimiterPluginConfig spincastAttemptsLimiterPluginConfig, boolean maxReached, String actionName, AttemptCriteria... criterias) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes all attempts for this action and criterias.protected SpincastAttemptsLimiterPluginConfig
protected SpincastAttemptsLimiterPluginRepository
void
Increments the number of attempts.boolean
Max number of attempts reached.toString()
-
Constructor Details
-
AttemptDefault
public AttemptDefault(SpincastAttemptsLimiterPluginRepository spincastAttemptsLimiterPlguinRepository, SpincastAttemptsLimiterPluginConfig spincastAttemptsLimiterPluginConfig, boolean maxReached, String actionName, AttemptCriteria... criterias)
-
-
Method Details
-
getSpincastAttemptsLimiterPluginRepository
-
getSpincastAttemptsLimiterPluginConfig
-
getActionName
-
getCriterias
-
isMaxReached
public boolean isMaxReached()Description copied from interface:Attempt
Max number of attempts reached. Your code should deny the protected action.- Specified by:
isMaxReached
in interfaceAttempt
-
incrementAttemptsCount
public void incrementAttemptsCount()Description copied from interface:Attempt
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!
- Specified by:
incrementAttemptsCount
in interfaceAttempt
-
deleteAttempts
public void deleteAttempts()Description copied from interface:Attempt
Deletes all attempts for this action and criterias.In some situations, you may want to clear the attempts when an action is succesfull.
- Specified by:
deleteAttempts
in interfaceAttempt
-
toString
-