Class ScriptableThrottlingPolicy
- java.lang.Object
-
- org.forgerock.openig.script.AbstractScriptableHeapObject<ThrottlingRate>
-
- org.forgerock.openig.filter.throttling.ScriptableThrottlingPolicy
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ThrottlingPolicy
public class ScriptableThrottlingPolicy extends AbstractScriptableHeapObject<ThrottlingRate> implements ThrottlingPolicy
A scriptable throttling datasource. This throttling datasource acts as a simple wrapper around the scripting engine. Scripts are provided with the bindings provided byAbstractScriptableHeapObject
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ScriptableThrottlingPolicy.Heaplet
Creates and initializes a scriptable object in a heap environment.-
Nested classes/interfaces inherited from class org.forgerock.openig.script.AbstractScriptableHeapObject
AbstractScriptableHeapObject.AbstractScriptableHeaplet<V>
-
-
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.-
Methods inherited from class org.forgerock.openig.script.AbstractScriptableHeapObject
close, runScript, runScriptAsync, setArgs, setClientHandler
-
-
-
-
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.
-
-