Class DefaultRateThrottlingPolicy
java.lang.Object
org.forgerock.openig.filter.throttling.DefaultRateThrottlingPolicy
- All Implemented Interfaces:
ThrottlingPolicy
A
DefaultRateThrottlingPolicy
is a delegating ThrottlingPolicy
that ensures the returned
ThrottlingRate
is never null. If the delegated ThrottlingPolicy
returns null
, then it
returns the specified default rate.-
Constructor Summary
ConstructorDescriptionDefaultRateThrottlingPolicy
(ThrottlingRate defaultRate, ThrottlingPolicy delegate) Constructs a newDefaultRateThrottlingPolicy
. -
Method Summary
Modifier and TypeMethodDescriptionReturns theThrottlingRate
that should be used for the provided request.
-
Constructor Details
-
DefaultRateThrottlingPolicy
Constructs a newDefaultRateThrottlingPolicy
.- Parameters:
defaultRate
- the rate to return if the one returned by the delegate is null.delegate
- the wrapped datasource to execute
-
-
Method Details
-
lookup
Description copied from interface:ThrottlingPolicy
Returns theThrottlingRate
that should be used for the provided request.- Specified by:
lookup
in interfaceThrottlingPolicy
- Parameters:
context
- The current context which might be used to retrieve the throttling rate.request
- The current request which might be used to retrieve the throttling rate.- Returns:
- A
Promise
representing theThrottlingRate
that should be used for the request.
-