Class ScriptableHandler

  • All Implemented Interfaces:
    org.forgerock.http.Handler

    public class ScriptableHandler
    extends AbstractScriptableHeapObject<org.forgerock.http.protocol.Response>
    implements org.forgerock.http.Handler
    A scriptable handler. This handler acts as a simple wrapper around the scripting engine. Scripts are provided with the bindings provided by AbstractScriptableHeapObject plus :
    • context - the associated request context
    • request - the HTTP request

    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(...).

    • Method Detail

      • handle

        public org.forgerock.util.promise.Promise<org.forgerock.http.protocol.Response,​org.forgerock.util.promise.NeverThrowsException> handle​(org.forgerock.services.context.Context context,
                                                                                                                                                     org.forgerock.http.protocol.Request request)
        Specified by:
        handle in interface org.forgerock.http.Handler