Class ScriptableFilter
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Filter
AbstractScriptableHeapObject
plus :
context
- the associated request contextrequest
- the HTTP requestnext
- the next handler in the filter chain.
Contains also easy access to attributes
from the AttributesContext
,
e.g: attributes.user = "jackson"
, instead of contexts.attributes.attributes.user = "jackson"
.
In the same way, it gives access to session
from the SessionContext
,
for example, you can use: session.put(...)
, instead of contexts.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
Modifier and TypeClassDescriptionstatic class
Creates and initializes a scriptable filter in a heap environment.Nested classes/interfaces inherited from class org.forgerock.openig.script.AbstractScriptableHeapObject
AbstractScriptableHeapObject.AbstractScriptableHeaplet<V>
-
Method Summary
Methods inherited from class org.forgerock.openig.script.AbstractScriptableHeapObject
close, runScript, runScriptAsync, setArgs, setClientHandler
-
Method Details
-
filter
public Promise<Response,NeverThrowsException> filter(Context context, Request request, Handler next) Description copied from interface:Filter
Filters the request and/or response of an exchange. To pass the request to the next filter or handler in the chain, the filter callsnext.handle(context, request)
.This method may elect not to pass the request to the next filter or handler, and instead handle the request itself. It can achieve this by merely avoiding a call to
next.handle(context, request)
and creating its own response object. The filter is also at liberty to replace a response with another of its own by intercepting the response returned by the next handler.
-