Class FixedRateThrottlingPolicy
- java.lang.Object
-
- org.forgerock.openig.filter.throttling.FixedRateThrottlingPolicy
-
- All Implemented Interfaces:
ThrottlingPolicy
public class FixedRateThrottlingPolicy extends Object implements ThrottlingPolicy
An implementation of theThrottlingPolicy
that always returns the same throtlling rate.
-
-
Constructor Summary
Constructors Constructor Description FixedRateThrottlingPolicy(ThrottlingRate rate)
Constructs a new throttling policy that always returns the same throttling rate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Promise<ThrottlingRate,Exception>
lookup(Context context, Request request)
Returns theThrottlingRate
that should be used for the provided request.
-
-
-
Constructor Detail
-
FixedRateThrottlingPolicy
public FixedRateThrottlingPolicy(ThrottlingRate rate)
Constructs a new throttling policy that always returns the same throttling rate.- Parameters:
rate
- the rate to return
-
-
Method Detail
-
lookup
public Promise<ThrottlingRate,Exception> lookup(Context context, Request request)
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.
-
-