Class ScriptedContextLookupFunction<T extends BaseContext>
java.lang.Object
net.shibboleth.shared.scripting.AbstractScriptEvaluator
net.shibboleth.profile.context.navigate.ScriptedContextLookupFunction<T>
- Type Parameters:
T- the specific type of context
- All Implemented Interfaces:
Function<T,,Object> ContextDataLookupFunction<T,Object>
public class ScriptedContextLookupFunction<T extends BaseContext>
extends AbstractScriptEvaluator
implements ContextDataLookupFunction<T,Object>
A
Function over a BaseContext
which calls out to a supplied script.-
Field Summary
FieldsModifier and TypeFieldDescriptionWhat class we want the input to test against.Fields inherited from class net.shibboleth.shared.scripting.AbstractScriptEvaluator
DEFAULT_ENGINE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedScriptedContextLookupFunction(Class<T> inClass, EvaluableScript theScript) Constructor.protectedScriptedContextLookupFunction(Class<T> inClass, EvaluableScript theScript, String extraInfo) Constructor.protectedScriptedContextLookupFunction(Class<T> inClass, EvaluableScript theScript, String extraInfo, Class<?> outputType) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioninlineMessageContextScript(String scriptSource) Factory to createScriptedContextLookupFunctionforMessageContexts from inline data.inlineMessageContextScript(String scriptSource, Class<?> outputType) Factory to createScriptedContextLookupFunctionforMessageContexts from inline data.inlineMessageContextScript(String engineName, String scriptSource) Factory to createScriptedContextLookupFunctionforMessageContexts from inline data.inlineMessageContextScript(String engineName, String scriptSource, Class<?> outputType) Factory to createScriptedContextLookupFunctionforMessageContexts from inline data.inlineScript(String scriptSource) Factory to createScriptedContextLookupFunctionforProfileRequestContexts from inline data.inlineScript(String scriptSource, Class<?> outputType) Factory to createScriptedContextLookupFunctionforProfileRequestContexts from inline data.inlineScript(String engineName, String scriptSource) Factory to createScriptedContextLookupFunctionforProfileRequestContexts from inline data.inlineScript(String engineName, String scriptSource, Class<?> outputType) Factory to createScriptedContextLookupFunctionforProfileRequestContexts from inline data.protected voidprepareContext(ScriptContext scriptContext, Object... input) resourceMessageContextScript(String engineName, Resource resource) resourceMessageContextScript(String engineName, Resource resource, Class<?> outputType) resourceMessageContextScript(Resource resource) resourceMessageContextScript(Resource resource, Class<?> outputType) resourceScript(String engineName, Resource resource) resourceScript(String engineName, Resource resource, Class<?> outputType) resourceScript(Resource resource) Factory to createScriptedContextLookupFunctionfrom aResource.resourceScript(Resource resource, Class<?> outputType) Methods inherited from class net.shibboleth.shared.scripting.AbstractScriptEvaluator
evaluate, finalizeContext, getHideExceptions, getLogPrefix, getOutputType, getReturnOnError, setContextExtenders, setCustomObject, setHideExceptions, setLogPrefix, setOutputType, setReturnOnError
-
Field Details
-
inputClass
What class we want the input to test against.
-
-
Constructor Details
-
Method Details
-
getCustomObject
- Overrides:
getCustomObjectin classAbstractScriptEvaluator
-
apply
- Specified by:
applyin interfaceFunction<T extends BaseContext,Object>
-
prepareContext
- Specified by:
prepareContextin classAbstractScriptEvaluator
-
inlineScript
@Nonnull public static ScriptedContextLookupFunction<ProfileRequestContext> inlineScript(@Nonnull @NotEmpty @ParameterName(name="engineName") String engineName, @Nonnull @NotEmpty @ParameterName(name="scriptSource") String scriptSource) throws ScriptException, ComponentInitializationException Factory to createScriptedContextLookupFunctionforProfileRequestContexts from inline data.- Parameters:
scriptSource- the script, as a stringengineName- the language- Returns:
- the function
- Throws:
ScriptException- if the compile failsComponentInitializationException- if the scripting initialization fails
-
inlineScript
@Nonnull public static ScriptedContextLookupFunction<ProfileRequestContext> inlineScript(@Nonnull @NotEmpty @ParameterName(name="engineName") String engineName, @Nonnull @NotEmpty @ParameterName(name="scriptSource") String scriptSource, @Nullable @ParameterName(name="outputType") Class<?> outputType) throws ScriptException, ComponentInitializationException Factory to createScriptedContextLookupFunctionforProfileRequestContexts from inline data.- Parameters:
scriptSource- the script, as a stringengineName- the languageoutputType- the type to test against.- Returns:
- the function
- Throws:
ScriptException- if the compile failsComponentInitializationException- if the scripting initialization fails
-
inlineScript
@Nonnull public static ScriptedContextLookupFunction<ProfileRequestContext> inlineScript(@Nonnull @NotEmpty @ParameterName(name="scriptSource") String scriptSource) throws ScriptException, ComponentInitializationException Factory to createScriptedContextLookupFunctionforProfileRequestContexts from inline data.- Parameters:
scriptSource- the script, as a string- Returns:
- the function
- Throws:
ScriptException- if the compile failsComponentInitializationException- if the scripting initialization fails
-
inlineScript
@Nonnull public static ScriptedContextLookupFunction<ProfileRequestContext> inlineScript(@Nonnull @NotEmpty @ParameterName(name="scriptSource") String scriptSource, @Nullable @ParameterName(name="outputType") Class<?> outputType) throws ScriptException, ComponentInitializationException Factory to createScriptedContextLookupFunctionforProfileRequestContexts from inline data.- Parameters:
scriptSource- the script, as a stringoutputType- the type to test against.- Returns:
- the function
- Throws:
ScriptException- if the compile failsComponentInitializationException- if the scripting initialization fails
-
inlineMessageContextScript
@Nonnull public static ScriptedContextLookupFunction<MessageContext> inlineMessageContextScript(@Nonnull @NotEmpty @ParameterName(name="engineName") String engineName, @Nonnull @NotEmpty @ParameterName(name="scriptSource") String scriptSource) throws ScriptException, ComponentInitializationException Factory to createScriptedContextLookupFunctionforMessageContexts from inline data.- Parameters:
scriptSource- the script, as a stringengineName- the language- Returns:
- the function
- Throws:
ScriptException- if the compile failsComponentInitializationException- if the scripting initialization fails
-
inlineMessageContextScript
@Nonnull public static ScriptedContextLookupFunction<MessageContext> inlineMessageContextScript(@Nonnull @NotEmpty @ParameterName(name="engineName") String engineName, @Nonnull @NotEmpty @ParameterName(name="scriptSource") String scriptSource, @Nullable @ParameterName(name="outputType") Class<?> outputType) throws ScriptException, ComponentInitializationException Factory to createScriptedContextLookupFunctionforMessageContexts from inline data.- Parameters:
scriptSource- the script, as a stringengineName- the languageoutputType- the type to test against.- Returns:
- the function
- Throws:
ScriptException- if the compile failsComponentInitializationException- if the scripting initialization fails
-
inlineMessageContextScript
@Nonnull public static ScriptedContextLookupFunction<MessageContext> inlineMessageContextScript(@Nonnull @NotEmpty @ParameterName(name="scriptSource") String scriptSource) throws ScriptException, ComponentInitializationException Factory to createScriptedContextLookupFunctionforMessageContexts from inline data.- Parameters:
scriptSource- the script, aMessageContexts a string- Returns:
- the function
- Throws:
ScriptException- if the compile failsComponentInitializationException- if the scripting initialization fails
-
inlineMessageContextScript
@Nonnull public static ScriptedContextLookupFunction<MessageContext> inlineMessageContextScript(@Nonnull @NotEmpty @ParameterName(name="scriptSource") String scriptSource, @Nullable @ParameterName(name="outputType") Class<?> outputType) throws ScriptException, ComponentInitializationException Factory to createScriptedContextLookupFunctionforMessageContexts from inline data.- Parameters:
scriptSource- the script, as a stringoutputType- the type to test against.- Returns:
- the function
- Throws:
ScriptException- if the compile failsComponentInitializationException- if the scripting initialization fails
-