Package net.shibboleth.idp.profile
Class ScriptedAction
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
An action which calls out to a supplied script.
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.
- Event:
EventIds.INVALID_PROFILE_CTX
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classEvaluator bound to the Action semantic. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default language is Javascript.private final org.slf4j.LoggerClass logger.private final ScriptedAction.ActionScriptEvaluatorEvaluator. -
Constructor Summary
ConstructorsConstructorDescriptionScriptedAction(EvaluableScript theScript) Constructor.ScriptedAction(EvaluableScript theScript, String extraInfo) Deprecated.... -
Method Summary
Modifier and TypeMethodDescriptionvoiddoExecute(ProfileRequestContext profileContext) protected voidReturn the custom (externally provided) object.(package private) static ScriptedActioninlineScript(String scriptSource) Factory to createScriptedActionfrom inline data.(package private) static ScriptedActioninlineScript(String engineName, String scriptSource) Factory to createScriptedActionfrom inline data.(package private) static ScriptedActionresourceScript(String engineName, Resource resource) Factory to createScriptedActionfrom aResource.(package private) static ScriptedActionresourceScript(Resource resource) Factory to createScriptedActionfrom aResource.voidsetCustomObject(Object object) Set the custom (externally provided) object.voidsetHideExceptions(boolean flag) Set whether to hide exceptions in script execution (default is false).Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
doPreExecute, getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
DEFAULT_ENGINE
The default language is Javascript.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
scriptEvaluator
Evaluator.
-
-
Constructor Details
-
ScriptedAction
Deprecated....Constructor.- Parameters:
theScript- the script we will evaluateextraInfo- debugging information
-
ScriptedAction
Constructor.- Parameters:
theScript- the script we will evaluate
-
-
Method Details
-
getCustomObject
Return the custom (externally provided) object.- Returns:
- the custom object
-
setCustomObject
Set the custom (externally provided) object.- Parameters:
object- the custom object
-
setHideExceptions
public void setHideExceptions(boolean flag) Set whether to hide exceptions in script execution (default is false).- Parameters:
flag- flag to set- Since:
- 3.4.0
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
resourceScript
static ScriptedAction resourceScript(@Nonnull @NotEmpty String engineName, @Nonnull Resource resource) throws ScriptException, IOException Factory to createScriptedActionfrom aResource.- Parameters:
resource- the resource to look atengineName- the language- Returns:
- the predicate
- Throws:
ScriptException- if the compile failsIOException- if the file doesn't exist.
-
resourceScript
static ScriptedAction resourceScript(@Nonnull Resource resource) throws ScriptException, IOException Factory to createScriptedActionfrom aResource.- Parameters:
resource- the resource to look at- Returns:
- the predicate
- Throws:
ScriptException- if the compile failsIOException- if the file doesn't exist.
-
inlineScript
static ScriptedAction inlineScript(@Nonnull @NotEmpty String engineName, @Nonnull @NotEmpty String scriptSource) throws ScriptException Factory to createScriptedActionfrom inline data.- Parameters:
scriptSource- the script, as a stringengineName- the language- Returns:
- the predicate
- Throws:
ScriptException- if the compile fails
-
inlineScript
Factory to createScriptedActionfrom inline data.- Parameters:
scriptSource- the script, as a string- Returns:
- the predicate
- Throws:
ScriptException- if the compile fails
-