T - the specific type of contextpublic class ScriptedContextLookupFunction<T extends org.opensaml.messaging.context.BaseContext> extends Object implements org.opensaml.messaging.context.navigate.ContextDataLookupFunction<T,Object>
Function over a BaseContext which calls out to a supplied script.| Modifier and Type | Field and Description |
|---|---|
private Object |
customObject
The custom object we can be injected into the script.
|
static String |
DEFAULT_ENGINE
The default language is Javascript.
|
private boolean |
hideExceptions
Whether to raise runtime exceptions if a script fails.
|
private Class<T> |
inputClass
What class we want the input to test against.
|
private org.slf4j.Logger |
log
Class logger.
|
private String |
logPrefix
Debugging info.
|
private Class |
outputClass
What class we want the output to test against.
|
private EvaluableScript |
script
The script we care about.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ScriptedContextLookupFunction(Class<T> inClass,
EvaluableScript theScript)
Constructor.
|
protected |
ScriptedContextLookupFunction(Class<T> inClass,
EvaluableScript theScript,
String extraInfo)
Constructor.
|
protected |
ScriptedContextLookupFunction(Class<T> inClass,
EvaluableScript theScript,
String extraInfo,
Class outputType)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
apply(T context) |
Object |
getCustomObject()
Return the custom (externally provided) object.
|
(package private) static ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> |
inlineMessageContextScript(String scriptSource)
Factory to create
ScriptedContextLookupFunction for MessageContexts from inline data. |
(package private) static ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> |
inlineMessageContextScript(String scriptSource,
Class outputType)
Factory to create
ScriptedContextLookupFunction for MessageContexts from inline data. |
(package private) static ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> |
inlineMessageContextScript(String engineName,
String scriptSource)
Factory to create
ScriptedContextLookupFunction for MessageContexts from inline data. |
(package private) static ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> |
inlineMessageContextScript(String engineName,
String scriptSource,
Class outputType)
Factory to create
ScriptedContextLookupFunction for MessageContexts from inline data. |
(package private) static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> |
inlineScript(String scriptSource)
Factory to create
ScriptedContextLookupFunction for ProfileRequestContexts from inline data. |
(package private) static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> |
inlineScript(String scriptSource,
Class outputType)
Factory to create
ScriptedContextLookupFunction for ProfileRequestContexts from inline data. |
(package private) static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> |
inlineScript(String engineName,
String scriptSource)
Factory to create
ScriptedContextLookupFunction for ProfileRequestContexts from inline data. |
(package private) static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> |
inlineScript(String engineName,
String scriptSource,
Class outputType)
Factory to create
ScriptedContextLookupFunction for ProfileRequestContexts from inline data. |
(package private) static ScriptedContextLookupFunction |
resourceMessageContextScript(org.springframework.core.io.Resource resource)
|
(package private) static ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> |
resourceMessageContextScript(org.springframework.core.io.Resource resource,
Class outputType)
|
(package private) static ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> |
resourceMessageContextScript(String engineName,
org.springframework.core.io.Resource resource)
|
(package private) static ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> |
resourceMessageContextScript(String engineName,
org.springframework.core.io.Resource resource,
Class outputType)
|
(package private) static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> |
resourceScript(org.springframework.core.io.Resource resource)
Factory to create
ScriptedContextLookupFunction from a Resource. |
(package private) static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> |
resourceScript(org.springframework.core.io.Resource resource,
Class outputType)
|
(package private) static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> |
resourceScript(String engineName,
org.springframework.core.io.Resource resource)
|
(package private) static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> |
resourceScript(String engineName,
org.springframework.core.io.Resource resource,
Class outputType)
|
void |
setCustomObject(Object object)
Set the custom (externally provided) object.
|
void |
setHideExceptions(boolean flag)
Set whether to hide exceptions in script execution (default is false).
|
@Nonnull @NotEmpty public static final String DEFAULT_ENGINE
@Nonnull private final org.slf4j.Logger log
@Nonnull private final EvaluableScript script
@Nonnull private final Class<T extends org.opensaml.messaging.context.BaseContext> inputClass
@Nullable private Object customObject
private boolean hideExceptions
protected ScriptedContextLookupFunction(@Nonnull Class<T> inClass, @Nonnull EvaluableScript theScript, @Nullable String extraInfo)
inClass - the class we accept as input.theScript - the script we will evaluate.extraInfo - debugging information.protected ScriptedContextLookupFunction(@Nonnull Class<T> inClass, @Nonnull EvaluableScript theScript)
inClass - the class we accept as input.theScript - the script we will evaluate.protected ScriptedContextLookupFunction(@Nonnull Class<T> inClass, @Nonnull EvaluableScript theScript, @Nullable String extraInfo, @Nullable Class outputType)
inClass - the class we accept as input.theScript - the script we will evaluate.extraInfo - debugging information.outputType - the type to test against.@Nullable public Object getCustomObject()
@Nullable public void setCustomObject(Object object)
object - the custom objectpublic void setHideExceptions(boolean flag)
flag - flag to setstatic ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> resourceScript(@Nonnull@NotEmpty String engineName, @Nonnull org.springframework.core.io.Resource resource) throws ScriptException, IOException
resource - the resource to look atengineName - the languageScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> resourceScript(@Nonnull@NotEmpty String engineName, @Nonnull org.springframework.core.io.Resource resource, @Nullable Class outputType) throws ScriptException, IOException
resource - the resource to look atengineName - the languageoutputType - the type to test against.ScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> resourceScript(org.springframework.core.io.Resource resource) throws ScriptException, IOException
ScriptedContextLookupFunction from a Resource.resource - the resource to look atScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> resourceScript(org.springframework.core.io.Resource resource, @Nullable Class outputType) throws ScriptException, IOException
resource - the resource to look atoutputType - the type to test against.ScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> inlineScript(@Nonnull@NotEmpty String engineName, @Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedContextLookupFunction for ProfileRequestContexts from inline data.scriptSource - the script, as a stringengineName - the languageScriptException - if the compile failsstatic ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> inlineScript(@Nonnull@NotEmpty String engineName, @Nonnull@NotEmpty String scriptSource, @Nullable Class outputType) throws ScriptException
ScriptedContextLookupFunction for ProfileRequestContexts from inline data.scriptSource - the script, as a stringengineName - the languageoutputType - the type to test against.ScriptException - if the compile failsstatic ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> inlineScript(@Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedContextLookupFunction for ProfileRequestContexts from inline data.scriptSource - the script, as a stringScriptException - if the compile failsstatic ScriptedContextLookupFunction<org.opensaml.profile.context.ProfileRequestContext> inlineScript(@Nonnull@NotEmpty String scriptSource, @Nullable Class outputType) throws ScriptException
ScriptedContextLookupFunction for ProfileRequestContexts from inline data.scriptSource - the script, as a stringoutputType - the type to test against.ScriptException - if the compile failsstatic ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> resourceMessageContextScript(@Nonnull@NotEmpty String engineName, @Nonnull org.springframework.core.io.Resource resource) throws ScriptException, IOException
resource - the resource to look atengineName - the languageScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> resourceMessageContextScript(@Nonnull@NotEmpty String engineName, @Nonnull org.springframework.core.io.Resource resource, @Nullable Class outputType) throws ScriptException, IOException
resource - the resource to look atengineName - the languageoutputType - the type to test against.ScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedContextLookupFunction resourceMessageContextScript(org.springframework.core.io.Resource resource) throws ScriptException, IOException
resource - the resource to look atScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> resourceMessageContextScript(org.springframework.core.io.Resource resource, @Nullable Class outputType) throws ScriptException, IOException
resource - the resource to look atoutputType - the type to test against.ScriptException - if the compile failsIOException - if the file doesn't exist.static ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> inlineMessageContextScript(@Nonnull@NotEmpty String engineName, @Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedContextLookupFunction for MessageContexts from inline data.scriptSource - the script, as a stringengineName - the languageScriptException - if the compile failsstatic ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> inlineMessageContextScript(@Nonnull@NotEmpty String engineName, @Nonnull@NotEmpty String scriptSource, @Nullable Class outputType) throws ScriptException
ScriptedContextLookupFunction for MessageContexts from inline data.scriptSource - the script, as a stringengineName - the languageoutputType - the type to test against.ScriptException - if the compile failsstatic ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> inlineMessageContextScript(@Nonnull@NotEmpty String scriptSource) throws ScriptException
ScriptedContextLookupFunction for MessageContexts from inline data.scriptSource - the script, aMessageContexts a stringScriptException - if the compile failsstatic ScriptedContextLookupFunction<org.opensaml.messaging.context.MessageContext> inlineMessageContextScript(@Nonnull@NotEmpty String scriptSource, @Nullable Class outputType) throws ScriptException
ScriptedContextLookupFunction for MessageContexts from inline data.scriptSource - the script, as a stringoutputType - the type to test against.ScriptException - if the compile failsCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.