Interface RateLimitingStorePlugin
- All Superinterfaces:
io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Plugin
- All Known Implementing Classes:
RateLimitingMemStorePlugin,RateLimitingRedisStorePlugin
public interface RateLimitingStorePlugin
extends io.vertigo.core.node.component.Plugin
-
Method Summary
Modifier and TypeMethodDescriptionvoidbanishUntil(String userKey, Instant banishUntil) Set banish until instant for a userKey.voidCancel all banishments.voidcancelBanishment(String userKey) Cancel banishment of a userkey.voidextendsWindow(String userKey, long newWindowSeconds) getBanishInstant(String userKey) Get banish until instant.longgetFirstHitAgeSecond(String userKey) Get first hit age for a userKey.intincrementBanishCounter(String userKey, long maxBanishSeconds) Prepare banishment, increment and get banish counter.longremainingSeconds(String userKey) Get remaining seconds in window for a userKey.longHit count by userKey, over a window.
-
Method Details
-
touch
Hit count by userKey, over a window.- Parameters:
userKey- user key (like ip)incrBy- increment bywindowSeconds- window in seconds
-
getFirstHitAgeSecond
Get first hit age for a userKey.- Parameters:
userKey- userKey user key (like ip)- Returns:
- age in second (-1 if unknown)
-
remainingSeconds
Get remaining seconds in window for a userKey.- Parameters:
userKey- user key (like ip)
-
incrementBanishCounter
Prepare banishment, increment and get banish counter.- Parameters:
userKey- user key (like ip)maxBanishSeconds- max seconds counting banishment (each banish reset this time)- Returns:
- current banish counter
-
cancelBanishment
Cancel banishment of a userkey.- Parameters:
userKey- user key to reset
-
cancelAllBanishments
void cancelAllBanishments()Cancel all banishments. -
getBanishments
- Returns:
- current banished userKey
-
banishUntil
Set banish until instant for a userKey.- Parameters:
userKey- userKey user key (like ip)banishUntil- banish until instant
-
getBanishInstant
Get banish until instant.- Parameters:
userKey- user key (like ip)- Returns:
- banish until instant.
-
extendsWindow
-