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 Details

    • touch

      long touch(String userKey, long incrBy, long windowSeconds)
      Hit count by userKey, over a window.
      Parameters:
      userKey - user key (like ip)
      incrBy - increment by
      windowSeconds - window in seconds
    • getFirstHitAgeSecond

      long getFirstHitAgeSecond(String userKey)
      Get first hit age for a userKey.
      Parameters:
      userKey - userKey user key (like ip)
      Returns:
      age in second (-1 if unknown)
    • remainingSeconds

      long remainingSeconds(String userKey)
      Get remaining seconds in window for a userKey.
      Parameters:
      userKey - user key (like ip)
    • incrementBanishCounter

      int incrementBanishCounter(String userKey, long maxBanishSeconds)
      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

      void cancelBanishment(String userKey)
      Cancel banishment of a userkey.
      Parameters:
      userKey - user key to reset
    • cancelAllBanishments

      void cancelAllBanishments()
      Cancel all banishments.
    • getBanishments

      Map<String,Instant> getBanishments()
      Returns:
      current banished userKey
    • banishUntil

      void banishUntil(String userKey, Instant banishUntil)
      Set banish until instant for a userKey.
      Parameters:
      userKey - userKey user key (like ip)
      banishUntil - banish until instant
    • getBanishInstant

      Instant getBanishInstant(String userKey)
      Get banish until instant.
      Parameters:
      userKey - user key (like ip)
      Returns:
      banish until instant.
    • extendsWindow

      void extendsWindow(String userKey, long newWindowSeconds)