Class ScriptedAction

  • All Implemented Interfaces:
    net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent, org.opensaml.profile.action.ProfileAction, Aware, MessageSource, MessageSourceAware, Action

    public class ScriptedAction
    extends AbstractProfileAction
    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
    • Constructor Detail

      • ScriptedAction

        @Deprecated
        public ScriptedAction​(@Nonnull
                              net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript,
                              @Nullable
                              String extraInfo)
        Deprecated.
        ...
        Constructor.
        Parameters:
        theScript - the script we will evaluate
        extraInfo - debugging information
      • ScriptedAction

        public ScriptedAction​(@Nonnull
                              net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript)
        Constructor.
        Parameters:
        theScript - the script we will evaluate
    • Method Detail

      • getCustomObject

        @Nullable
        public Object getCustomObject()
        Return the custom (externally provided) object.
        Returns:
        the custom object
      • setCustomObject

        @Nullable
        public void setCustomObject​(@Nullable
                                    Object object)
        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

        protected void doInitialize()
                             throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
        Overrides:
        doInitialize in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
        Throws:
        net.shibboleth.utilities.java.support.component.ComponentInitializationException
      • doExecute

        public void doExecute​(@Nullable
                              org.opensaml.profile.context.ProfileRequestContext profileContext)
        Overrides:
        doExecute in class org.opensaml.profile.action.AbstractProfileAction
      • inlineScript

        static ScriptedAction inlineScript​(@Nonnull @NotEmpty
                                           String engineName,
                                           @Nonnull @NotEmpty
                                           String scriptSource)
                                    throws ScriptException
        Factory to create ScriptedAction from inline data.
        Parameters:
        scriptSource - the script, as a string
        engineName - the language
        Returns:
        the predicate
        Throws:
        ScriptException - if the compile fails