public abstract class AbstractScriptableHeapObject extends GenericHeapObject
filters
and handlers
. This heap
object acts as a simple wrapper around the scripting engine. Scripts are
provided with the following variable bindings:
globals
- the Map of global variables which persist across
successive invocations of the script
exchange
- the HTTP exchange
http
- an OpenIG HTTP client which may be used for
performing outbound HTTP requests
ldap
- an OpenIG LDAP client which may be used for
performing LDAP requests such as LDAP authentication
logger
- the OpenIG logger
next
- if the heap object is a filter then this variable
will contain the next handler in the filter chain.
NOTE: at the moment only Groovy is supported.
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractScriptableHeapObject.AbstractScriptableHeaplet
Creates and initializes a capture filter in a heap environment.
|
logger, storage
Modifier | Constructor and Description |
---|---|
protected |
AbstractScriptableHeapObject(Script compiledScript)
Creates a new scriptable heap object using the provided compiled script.
|
Modifier and Type | Method and Description |
---|---|
protected void |
runScript(Exchange exchange,
Handler next)
Runs the compiled script using the provided exchange and optional
forwarding handler.
|
void |
setArgs(Map<String,Object> args)
Sets the parameters which should be made available to scripts.
|
void |
setHttpClient(HttpClient client)
Sets the HTTP client which should be made available to scripts.
|
protected AbstractScriptableHeapObject(Script compiledScript)
compiledScript
- The compiled script.public void setHttpClient(HttpClient client)
client
- The HTTP client which should be made available to scripts.public void setArgs(Map<String,Object> args)
args
- The parameters which should be made available to scripts.protected final void runScript(Exchange exchange, Handler next) throws HandlerException, IOException
exchange
- The HTTP exchange.next
- The next handler in the chain if applicable, may be
null
.HandlerException
- If an error occurred while evaluating the script.IOException
- If an I/O exception occurs.Copyright © 2014 ForgeRock AS. All rights reserved.