public class ScriptedPredicate extends Object implements com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext>
Predicate which calls out to a supplied script.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENGINE
The default language is Javascript.
|
private Logger |
log
log.
|
private String |
logPrefix
Debugging info.
|
private net.shibboleth.utilities.java.support.scripting.EvaluableScript |
script
The script we care about.
|
| Constructor and Description |
|---|
ScriptedPredicate(net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript)
Constructor.
|
ScriptedPredicate(net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript,
String extraInfo)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(org.opensaml.profile.context.ProfileRequestContext profileContext) |
(package private) static ScriptedPredicate |
inlineScript(String scriptSource)
Factory to create
ScriptedPredicate from inline data. |
(package private) static ScriptedPredicate |
inlineScript(String engineName,
String scriptSource)
Factory to create
ScriptedPredicate from inline data. |
(package private) static ScriptedPredicate |
resourceScript(Resource resource)
Factory to create
ScriptedPredicate from a Resource. |
(package private) static ScriptedPredicate |
resourceScript(String engineName,
Resource resource)
Factory to create
ScriptedPredicate from a Resource. |
public static final String DEFAULT_ENGINE
private final Logger log
@Nonnull private final net.shibboleth.utilities.java.support.scripting.EvaluableScript script
public ScriptedPredicate(@Nonnull net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript, @Nullable String extraInfo)
theScript - the script we will evaluate.extraInfo - debugging information.public ScriptedPredicate(@Nonnull net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript)
theScript - the script we will evaluate.public boolean apply(@Nullable org.opensaml.profile.context.ProfileRequestContext profileContext)
apply in interface com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext>static ScriptedPredicate resourceScript(@Nonnull@NotEmpty String engineName, @Nonnull Resource resource) throws ScriptException, IOException
ScriptedPredicate from a Resource.resource - the resource to look atengineName - the languageScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedPredicate resourceScript(Resource resource) throws ScriptException, IOException
ScriptedPredicate from a Resource.resource - the resource to look atScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedPredicate inlineScript(@Nonnull@NotEmpty String engineName, @Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedPredicate from inline data.scriptSource - the script, as a stringengineName - the languageScriptException - if the compile failsstatic ScriptedPredicate inlineScript(@Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedPredicate from inline data.scriptSource - the script, as a stringScriptException - if the compile failsCopyright © 1999–2014. All rights reserved.