Package net.shibboleth.metadata.pipeline
Class ScriptletStage<T>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.metadata.pipeline.AbstractStage<T>
net.shibboleth.metadata.pipeline.ScriptletStage<T>
- Type Parameters:
T- type of item the stage operates on
- All Implemented Interfaces:
Stage<T>,net.shibboleth.shared.component.Component,net.shibboleth.shared.component.DestructableComponent,net.shibboleth.shared.component.IdentifiableComponent,net.shibboleth.shared.component.IdentifiedComponent,net.shibboleth.shared.component.InitializableComponent
A pipeline stage that computes that transforms the collection of
Item via a script.
This stage requires the following properties be set prior to initialization:
scriptFile
This classes uses the JSR-223 scripting interface. As such, in order to use a language other than ECMAscript (a.k.a. javascript), you must ensure the scripting engine and any associated libraries necessary for its operation are on the classpath.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPerforms the stage processing on the given Item collection.protected voidfinal net.shibboleth.shared.scripting.EvaluableScriptGets the script executed by this stage.final StringGets the variable name to contain the list of items.voidsetScript(net.shibboleth.shared.scripting.EvaluableScript stageScript) Sets the script executed by this stage.final voidsetVariableName(String name) Sets the variable name to contain the list of items.Methods inherited from class net.shibboleth.metadata.pipeline.AbstractStage
execute, getCollectionPredicate, setCollectionPredicateMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
variableName
Name of the scriptlet attribute containing theItemcollection to be transformed.Defaults to
items. -
script
@NonnullAfterInit private net.shibboleth.shared.scripting.EvaluableScript scriptScript executed by this stage.
-
-
Constructor Details
-
ScriptletStage
public ScriptletStage()
-
-
Method Details
-
getVariableName
Gets the variable name to contain the list of items.- Returns:
- the variable name
-
setVariableName
Sets the variable name to contain the list of items.- Parameters:
name- the variable name
-
getScript
@NonnullAfterInit public final net.shibboleth.shared.scripting.EvaluableScript getScript()Gets the script executed by this stage.- Returns:
- the script executed by this stage
-
doExecute
protected void doExecute(@Nonnull @NonnullElements List<Item<T>> items) throws StageProcessingException Description copied from class:AbstractStagePerforms the stage processing on the given Item collection.The stage is guaranteed to be have been initialized and not destroyed when this is invoked.
- Specified by:
doExecutein classAbstractStage<T>- Parameters:
items- collection to be processed- Throws:
StageProcessingException- thrown if there is an unrecoverable problem when processing the stage
-
doInitialize
protected void doInitialize() throws net.shibboleth.shared.component.ComponentInitializationException- Overrides:
doInitializein classnet.shibboleth.shared.component.AbstractIdentifiedInitializableComponent- Throws:
net.shibboleth.shared.component.ComponentInitializationException
-