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
ConstructorsConstructorDescriptionDefaultRateThrottlingPolicy(ThrottlingRate defaultRate, ThrottlingPolicy delegate) Constructs a newDefaultRateThrottlingPolicy. -
Method Summary
Modifier and TypeMethodDescriptionReturns theThrottlingRatethat 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:ThrottlingPolicyReturns theThrottlingRatethat should be used for the provided request.- Specified by:
lookupin 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
Promiserepresenting theThrottlingRatethat should be used for the request.
-