Package org.opensaml.saml.metadata.resolver.filter.impl

# Class ScriptedTrustedNamesFunction

java.lang.Object
net.shibboleth.shared.scripting.AbstractScriptEvaluator
org.opensaml.saml.metadata.resolver.filter.impl.ScriptedTrustedNamesFunction

All Implemented Interfaces:
  `Function<XMLObject,Set<String>>`

public class ScriptedTrustedNamesFunction extends AbstractScriptEvaluator implements Function<XMLObject,Set<String>>
A scripted `Function` which can be injected into `SignatureValidationFilter.setDynamicTrustedNamesStrategy(Function)`.

## Field Summary

### Fields inherited from class net.shibboleth.shared.scripting.AbstractScriptEvaluator

`DEFAULT_ENGINE`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`ScriptedTrustedNamesFunction(EvaluableScript theScript)`
Constructor.
`protected`
`ScriptedTrustedNamesFunction(EvaluableScript theScript, String extraInfo)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Set<String>`
`apply(XMLObject context)`
`Object`
`getCustomObject()`
`(package private) static ScriptedTrustedNamesFunction`
`inlineScript(String scriptSource)`
Factory to create `ScriptedTrustedNamesFunction` for `SignatureValidationFilter`s from inline data.
`(package private) static ScriptedTrustedNamesFunction`
`inlineScript(String engineName, String scriptSource)`
Factory to create `ScriptedTrustedNamesFunction` for `SignatureValidationFilter`s from inline data.
`protected void`
`prepareContext(ScriptContext scriptContext, Object... input)`
`(package private) static ScriptedTrustedNamesFunction`
`resourceScript(String engineName, Resource resource)`
Factory to create `ScriptedTrustedNamesFunction` for `SignatureValidationFilter`s from a `Resource`.
`(package private) static ScriptedTrustedNamesFunction`
`resourceScript(Resource resource)`
Factory to create `ScriptedTrustedNamesFunction` from a `Resource`.

### Methods inherited from class net.shibboleth.shared.scripting.AbstractScriptEvaluator

`evaluate, finalizeContext, getHideExceptions, getLogPrefix, getOutputType, getReturnOnError, setContextExtenders, setCustomObject, setHideExceptions, setLogPrefix, setOutputType, setReturnOnError`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.function.Function

`andThen, compose`

## Constructor Details

### ScriptedTrustedNamesFunction

protected ScriptedTrustedNamesFunction(@Nonnull EvaluableScript theScript, @Nullable String extraInfo)
Constructor.

Parameters:
  `theScript` - the script we will evaluate.
  `extraInfo` - debugging information.

### ScriptedTrustedNamesFunction

protected ScriptedTrustedNamesFunction(@Nonnull EvaluableScript theScript)
Constructor.

Parameters:
  `theScript` - the script we will evaluate.

## Method Details

### getCustomObject

@Nullable public Object getCustomObject()

Overrides:
  `getCustomObject` in class `AbstractScriptEvaluator`

### apply

@Nullable public Set<String> apply(@Nullable XMLObject context)

Specified by:
  `apply` in interface `Function<XMLObject,Set<String>>`

### prepareContext

protected void prepareContext(@Nonnull ScriptContext scriptContext, @Nullable Object... input)

Specified by:
  `prepareContext` in class `AbstractScriptEvaluator`

### resourceScript

@Nonnull static ScriptedTrustedNamesFunction resourceScript(@Nonnull @NotEmpty @ParameterName(name="engineName") String engineName, @Nonnull @ParameterName(name="resource") Resource resource) throws ScriptException, IOException, ComponentInitializationException
Factory to create `ScriptedTrustedNamesFunction` for `SignatureValidationFilter`s from a `Resource`.

Parameters:
  `engineName` - the language
  `resource` - the resource to look at
Returns:
  the function
Throws:
  `ScriptException` - if the compile fails
  `IOException` - if the file doesn't exist.
  `ComponentInitializationException` - if the scripting initialization fails

### resourceScript

@Nonnull static ScriptedTrustedNamesFunction resourceScript(@Nonnull @ParameterName(name="resource") Resource resource) throws ScriptException, IOException, ComponentInitializationException
Factory to create `ScriptedTrustedNamesFunction` from a `Resource`.

Parameters:
  `resource` - the resource to look at
Returns:
  the function
Throws:
  `ScriptException` - if the compile fails
  `IOException` - if the file doesn't exist.
  `ComponentInitializationException` - if the scripting initialization fails

### inlineScript

@Nonnull static ScriptedTrustedNamesFunction inlineScript(@Nonnull @NotEmpty @ParameterName(name="engineName") String engineName, @Nonnull @NotEmpty @ParameterName(name="scriptSource") String scriptSource) throws ScriptException, ComponentInitializationException
Factory to create `ScriptedTrustedNamesFunction` for `SignatureValidationFilter`s from inline data.

Parameters:
  `scriptSource` - the script, as a string
  `engineName` - the language
Returns:
  the function
Throws:
  `ScriptException` - if the compile fails
  `ComponentInitializationException` - if the scripting initialization fails

### inlineScript

@Nonnull static ScriptedTrustedNamesFunction inlineScript(@Nonnull @NotEmpty @ParameterName(name="scriptSource") String scriptSource) throws ScriptException, ComponentInitializationException
Factory to create `ScriptedTrustedNamesFunction` for `SignatureValidationFilter`s from inline data.

Parameters:
  `scriptSource` - the script, as a string
Returns:
  the function
Throws:
  `ScriptException` - if the compile fails
  `ComponentInitializationException` - if the scripting initialization fails