Class AttemptDefault
java.lang.Object
org.spincast.plugins.attemptslimiter.AttemptDefault
- All Implemented Interfaces:
Attempt
-
Constructor Summary
ConstructorsConstructorDescriptionAttemptDefault(SpincastAttemptsLimiterPluginRepository spincastAttemptsLimiterPlguinRepository, SpincastAttemptsLimiterPluginConfig spincastAttemptsLimiterPluginConfig, boolean maxReached, String actionName, AttemptCriteria... criterias) -
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes all attempts for this action and criterias.protected SpincastAttemptsLimiterPluginConfigprotected SpincastAttemptsLimiterPluginRepositoryvoidIncrements the number of attempts.booleanMax 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:AttemptMax number of attempts reached. Your code should deny the protected action.- Specified by:
isMaxReachedin interfaceAttempt
-
incrementAttemptsCount
public void incrementAttemptsCount()Description copied from interface:AttemptIncrements 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:
incrementAttemptsCountin interfaceAttempt
-
deleteAttempts
public void deleteAttempts()Description copied from interface:AttemptDeletes all attempts for this action and criterias.In some situations, you may want to clear the attempts when an action is succesfull.
- Specified by:
deleteAttemptsin interfaceAttempt
-
toString
-