Package net.shibboleth.idp.profile.logic
Class ScriptedPredicate
- java.lang.Object
-
- net.shibboleth.utilities.java.support.scripting.AbstractScriptEvaluator
-
- net.shibboleth.utilities.java.support.logic.ScriptedPredicate<org.opensaml.profile.context.ProfileRequestContext>
-
- net.shibboleth.idp.profile.logic.ScriptedPredicate
-
- All Implemented Interfaces:
Predicate<org.opensaml.profile.context.ProfileRequestContext>,net.shibboleth.utilities.java.support.logic.Predicate<org.opensaml.profile.context.ProfileRequestContext>
public class ScriptedPredicate extends net.shibboleth.utilities.java.support.logic.ScriptedPredicate<org.opensaml.profile.context.ProfileRequestContext>APredicatewhich calls out to a supplied script.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.
-
Constructor Summary
Constructors Constructor Description ScriptedPredicate(net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript)Constructor.ScriptedPredicate(net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript, String extraInfo)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ScriptedPredicateinlineScript(String scriptSource)Factory to createScriptedPredicatefrom inline data.static ScriptedPredicateinlineScript(String engineName, String scriptSource)Factory to createScriptedPredicatefrom inline data.protected voidprepareContext(ScriptContext scriptContext, Object... input)static ScriptedPredicateresourceScript(String engineName, Resource resource)Factory to createScriptedPredicatefrom aResource.static ScriptedPredicateresourceScript(Resource resource)Factory to createScriptedPredicatefrom aResource.-
Methods inherited from class net.shibboleth.utilities.java.support.logic.ScriptedPredicate
resourceScript, resourceScript, setReturnOnError, test
-
Methods inherited from class net.shibboleth.utilities.java.support.scripting.AbstractScriptEvaluator
evaluate, finalizeContext, getCustomObject, getHideExceptions, getLogPrefix, getOutputType, getReturnOnError, setCustomObject, setHideExceptions, setLogPrefix, setOutputType, setReturnOnError
-
-
-
-
Constructor Detail
-
ScriptedPredicate
public ScriptedPredicate(@Nonnull @NotEmpty @ParameterName(name="theScript") net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript, @Nullable @NotEmpty @ParameterName(name="extraInfo") String extraInfo)Constructor.- Parameters:
theScript- the script we will evaluate.extraInfo- debugging information.
-
ScriptedPredicate
public ScriptedPredicate(@Nonnull @NotEmpty @ParameterName(name="theScript") net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript)Constructor.- Parameters:
theScript- the script we will evaluate.
-
-
Method Detail
-
prepareContext
protected void prepareContext(@Nonnull ScriptContext scriptContext, @Nullable Object... input)- Overrides:
prepareContextin classnet.shibboleth.utilities.java.support.logic.ScriptedPredicate<org.opensaml.profile.context.ProfileRequestContext>
-
resourceScript
public static ScriptedPredicate resourceScript(@Nonnull @NotEmpty String engineName, @Nonnull Resource resource) throws ScriptException, IOException
Factory to createScriptedPredicatefrom 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
public static ScriptedPredicate resourceScript(Resource resource) throws ScriptException, IOException
Factory to createScriptedPredicatefrom aResource.- Parameters:
resource- the resource to look at- Returns:
- the predicate
- Throws:
ScriptException- if the compile failsIOException- if the file doesn't exist.
-
inlineScript
public static ScriptedPredicate inlineScript(@Nonnull @NotEmpty String engineName, @Nonnull @NotEmpty String scriptSource) throws ScriptException
Factory to createScriptedPredicatefrom inline data.- Parameters:
scriptSource- the script, as a stringengineName- the language- Returns:
- the predicate
- Throws:
ScriptException- if the compile fails
-
inlineScript
public static ScriptedPredicate inlineScript(@Nonnull @NotEmpty String scriptSource) throws ScriptException
Factory to createScriptedPredicatefrom inline data.- Parameters:
scriptSource- the script, as a string- Returns:
- the predicate
- Throws:
ScriptException- if the compile fails
-
-