Class ScriptedMatcher
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.filter.matcher.impl.ScriptedMatcher
- All Implemented Interfaces:
Matcher,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent
@ThreadSafe
public class ScriptedMatcher
extends AbstractIdentifiableInitializableComponent
implements Matcher, UnmodifiableComponent
A
Matcher that delegates to a JSR-223 script for its actual processing.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classEvaluator bound to the Matcher semantic. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Collection<FilterScriptContextExtender>Extenders for script context.private ObjectCustom object for script.private final org.slf4j.LoggerClass logger.private EvaluableScriptThe script to evaluate.Evaluator.Fields inherited from interface net.shibboleth.idp.attribute.filter.Matcher
MATCHER_FAILS, MATCHES_ALL, MATCHES_NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleanReturn the custom (externally provided) object.getMatchingValues(IdPAttribute attribute, AttributeFilterContext filterContext) Perform the AttributeValueMatching.Gets the script to be evaluated.inthashCode()voidsetCustomObject(Object object) Set the custom (externally provided) object.voidsetScript(EvaluableScript matcherScript) Sets the script to be evaluated.voidSet any script context extenders to apply.toString()Methods 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, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
script
The script to evaluate. -
scriptEvaluator
Evaluator. -
contextExtenders
Extenders for script context. -
customObject
Custom object for script.
-
-
Constructor Details
-
ScriptedMatcher
public ScriptedMatcher()Constructor.
-
-
Method Details
-
getCustomObject
Return the custom (externally provided) object.- Returns:
- the custom object
-
setCustomObject
Set the custom (externally provided) object.- Parameters:
object- the custom object
-
getScript
Gets the script to be evaluated.- Returns:
- the script to be evaluated
-
setScriptContextExtenders
Set any script context extenders to apply.- Parameters:
extenders- script extenders- Since:
- 5.0.0
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
getMatchingValues
@Nullable @Unmodifiable public Set<IdPAttributeValue> getMatchingValues(@Nonnull IdPAttribute attribute, @Nonnull AttributeFilterContext filterContext) Perform the AttributeValueMatching.When the script is evaluated, the following properties will be available via the
ScriptContext:filterContext- the current instance ofAttributeFilterContextattribute- the attribute whose values are to be evaluated
The script MUST return a
Return thoseSetcontaining theIdPAttributeValueobjects that were matched.IdPAttributeValues which match this rule, or null if the matcher failed.- Specified by:
getMatchingValuesin interfaceMatcher- Parameters:
attribute- the attribute under question.filterContext- the filter context- Returns:
- The result of this rule. Null if we failed.
-
equals
-
hashCode
public int hashCode() -
toString
-