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 | Field and Description |
|---|---|
private Object |
customObject
The custom object we can inject.
|
static String |
DEFAULT_ENGINE
The default language is Javascript.
|
private org.slf4j.Logger |
log
Class logger.
|
private String |
logPrefix
Debugging info.
|
private EvaluableScript |
script
The script we care about.
|
| Constructor and Description |
|---|
ScriptedAction(EvaluableScript theScript)
Constructor.
|
ScriptedAction(EvaluableScript theScript,
String extraInfo)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
doExecute(ProfileRequestContext profileContext) |
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(Resource resource)
Factory to create
ScriptedAction from a Resource. |
(package private) static ScriptedAction |
resourceScript(String engineName,
Resource resource)
Factory to create
ScriptedAction from a Resource. |
void |
setCustomObject(Object object)
Set the custom (externally provided) object.
|
doExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategydoPreExecute, getActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, doInitialize, 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 org.slf4j.Logger log
@Nonnull private final EvaluableScript script
public ScriptedAction(@Nonnull EvaluableScript theScript, @Nullable String extraInfo)
theScript - the script we will evaluate.extraInfo - debugging information.public ScriptedAction(@Nonnull EvaluableScript theScript)
theScript - the script we will evaluate.@Nullable public Object getCustomObject()
@Nullable public void setCustomObject(Object object)
object - the custom objectpublic void doExecute(@Nullable ProfileRequestContext profileContext)
doExecute in class AbstractProfileActionstatic ScriptedAction resourceScript(@Nonnull@NotEmpty String engineName, @Nonnull 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 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–2017 Shibboleth Consortium. All rights reserved.