Package org.forgerock.openig.filter
Class ScriptableFilter
- java.lang.Object
-
- org.forgerock.openig.script.AbstractScriptableHeapObject<org.forgerock.http.protocol.Response>
-
- org.forgerock.openig.filter.ScriptableFilter
-
- All Implemented Interfaces:
org.forgerock.http.Filter
public class ScriptableFilter extends AbstractScriptableHeapObject<org.forgerock.http.protocol.Response> implements org.forgerock.http.Filter
A scriptable filter. This filter acts as a simple wrapper around the scripting engine. Scripts are provided with the bindings provided byAbstractScriptableHeapObjectplus :context- the associated request contextrequest- the HTTP requestnext- the next handler in the filter chain.
Contains also easy access to
attributesfrom theAttributesContext, e.g:attributes.user = "jackson", instead ofcontexts.attributes.attributes.user = "jackson".In the same way, it gives access to
sessionfrom theSessionContext, for example, you can use:session.put(...), instead ofcontexts.session.session.put(...).Like Java based filters, scripts are free to choose whether or not they forward the request to the next handler or, instead, return a response immediately.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScriptableFilter.HeapletCreates and initializes a scriptable filter in a heap environment.-
Nested classes/interfaces inherited from class org.forgerock.openig.script.AbstractScriptableHeapObject
AbstractScriptableHeapObject.AbstractScriptableHeaplet
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.forgerock.util.promise.Promise<org.forgerock.http.protocol.Response,org.forgerock.util.promise.NeverThrowsException>filter(org.forgerock.services.context.Context context, org.forgerock.http.protocol.Request request, org.forgerock.http.Handler next)-
Methods inherited from class org.forgerock.openig.script.AbstractScriptableHeapObject
runScript, setArgs, setClientHandler
-
-
-
-
Method Detail
-
filter
public org.forgerock.util.promise.Promise<org.forgerock.http.protocol.Response,org.forgerock.util.promise.NeverThrowsException> filter(org.forgerock.services.context.Context context, org.forgerock.http.protocol.Request request, org.forgerock.http.Handler next)- Specified by:
filterin interfaceorg.forgerock.http.Filter
-
-