Class ActionRateLimiter
java.lang.Object
com.atlassian.confluence.impl.ratelimiter.ActionRateLimiter
This class is for limiting the request and can be used in action classes.
- Since:
- 8.7
-
Constructor Summary
ConstructorDescriptionActionRateLimiter
(@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 TypeMethodDescriptionisRequestAllowed
(String usernameOrEmail, String actionId) Fetch the ratelimiter by userName or email for any actionId and returns the action result.
-
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 insettingsContext.xml
-
-
Method Details
-
isRequestAllowed
Fetch the ratelimiter by userName or email for any actionId and returns the action result.- Parameters:
usernameOrEmail
-- Returns:
- action result page
-