public class ScriptedAction extends AbstractProfileAction
The return value must be an event ID to signal. As this is a generic wrapper, the action may return any event depending on the context of the activity, and may manipulate the profile context tree as required.
EventIds.INVALID_PROFILE_CTX| Modifier and Type | Class and Description |
|---|---|
private class |
ScriptedAction.ActionScriptEvaluator
Evaluator bound to the Action semantic.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENGINE
The default language is Javascript.
|
private Logger |
log
Class logger.
|
private ScriptedAction.ActionScriptEvaluator |
scriptEvaluator
Evaluator.
|
| Constructor and Description |
|---|
ScriptedAction(EvaluableScript theScript)
Constructor.
|
ScriptedAction(EvaluableScript theScript,
String extraInfo)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
doExecute(ProfileRequestContext profileContext) |
protected void |
doInitialize() |
Object |
getCustomObject()
Return the custom (externally provided) object.
|
(package private) static ScriptedAction |
inlineScript(String scriptSource)
Factory to create
ScriptedAction from inline data. |
(package private) static ScriptedAction |
inlineScript(String engineName,
String scriptSource)
Factory to create
ScriptedAction from inline data. |
(package private) static ScriptedAction |
resourceScript(org.springframework.core.io.Resource resource)
Factory to create
ScriptedAction from a Resource. |
(package private) static ScriptedAction |
resourceScript(String engineName,
org.springframework.core.io.Resource resource)
Factory to create
ScriptedAction from a Resource. |
void |
setCustomObject(Object object)
Set the custom (externally provided) object.
|
void |
setHideExceptions(boolean flag)
Set whether to hide exceptions in script execution (default is false).
|
doExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategydoPreExecute, getActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitialized@Nonnull @NotEmpty public static final String DEFAULT_ENGINE
@Nonnull private final ScriptedAction.ActionScriptEvaluator scriptEvaluator
public ScriptedAction(@Nonnull EvaluableScript theScript, @Nullable String extraInfo)
theScript - the script we will evaluateextraInfo - debugging informationpublic ScriptedAction(@Nonnull EvaluableScript theScript)
theScript - the script we will evaluate@Nullable public Object getCustomObject()
@Nullable public void setCustomObject(@Nullable Object object)
object - the custom objectpublic void setHideExceptions(boolean flag)
flag - flag to setprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionpublic void doExecute(@Nullable ProfileRequestContext profileContext)
doExecute in class AbstractProfileActionstatic ScriptedAction resourceScript(@Nonnull@NotEmpty String engineName, @Nonnull org.springframework.core.io.Resource resource) throws ScriptException, IOException
ScriptedAction from a Resource.resource - the resource to look atengineName - the languageScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedAction resourceScript(@Nonnull org.springframework.core.io.Resource resource) throws ScriptException, IOException
ScriptedAction from a Resource.resource - the resource to look atScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedAction inlineScript(@Nonnull@NotEmpty String engineName, @Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedAction from inline data.scriptSource - the script, as a stringengineName - the languageScriptException - if the compile failsstatic ScriptedAction inlineScript(@Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedAction from inline data.scriptSource - the script, as a stringScriptException - if the compile failsCopyright © 1999–2020 Shibboleth Consortium. All rights reserved.