Class ActionRateLimiter

java.lang.Object
com.atlassian.confluence.impl.ratelimiter.ActionRateLimiter

public final class ActionRateLimiter extends Object
This class is for limiting the request and can be used in action classes.
Since:
8.7
  • Constructor Summary

    Constructors
    Constructor
    Description
    ActionRateLimiter(@NonNull String permitsPerSecondKey, @org.checkerframework.checker.nullness.qual.NonNull double defaultPermitsPerSecond, @NonNull String permitsPerSecondGlobalKey, @org.checkerframework.checker.nullness.qual.NonNull double defaultPermitsPerSecondGlobal, @NonNull String cacheExpiryLimitKey, @org.checkerframework.checker.nullness.qual.NonNull long defaultCacheExpiryLimit)
    This constructor is used to pass the system props and default value at the time of bean initialisation.
  • Method Summary

    Modifier and Type
    Method
    Description
    isRequestAllowed(String usernameOrEmail, String actionId)
    Fetch the ratelimiter by userName or email for any actionId and returns the action result.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ActionRateLimiter

      public ActionRateLimiter(@NonNull String permitsPerSecondKey, @org.checkerframework.checker.nullness.qual.NonNull double defaultPermitsPerSecond, @NonNull String permitsPerSecondGlobalKey, @org.checkerframework.checker.nullness.qual.NonNull double defaultPermitsPerSecondGlobal, @NonNull String cacheExpiryLimitKey, @org.checkerframework.checker.nullness.qual.NonNull long defaultCacheExpiryLimit)
      This constructor is used to pass the system props and default value at the time of bean initialisation. Multiple instances can be created with multiple default values as per action/functionality requirement in settingsContext.xml
  • Method Details

    • isRequestAllowed

      public String isRequestAllowed(String usernameOrEmail, String actionId)
      Fetch the ratelimiter by userName or email for any actionId and returns the action result.
      Parameters:
      usernameOrEmail -
      Returns:
      action result page