Class ScriptedPolicyRule
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.filter.policyrule.impl.ScriptedPolicyRule
- All Implemented Interfaces:
PolicyRequirementRule,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent
@ThreadSafe
public class ScriptedPolicyRule
extends AbstractIdentifiableInitializableComponent
implements PolicyRequirementRule, UnmodifiableComponent
A
PolicyRequirementRule that delegates to a JSR-223 script for its actual
processing.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classEvaluator bound to the Matcher semantic.Nested classes/interfaces inherited from interface net.shibboleth.idp.attribute.filter.PolicyRequirementRule
PolicyRequirementRule.Tristate -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Collection<FilterScriptContextExtender>Extenders for script context.private ObjectThe custom object we inject into all scripts.private final org.slf4j.LoggerClass logger.private EvaluableScriptScript to be evaluated.Evaluator.Fields inherited from interface net.shibboleth.idp.attribute.filter.PolicyRequirementRule
MATCHES_ALL, MATCHES_NONE, REQUIREMENT_RULE_FAILS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleanReturn the custom (externally provided) object.private EvaluableScriptGets the script to be evaluated.inthashCode()matches(AttributeFilterContext filterContext) Evaluate what this rule means.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
Script to be evaluated. -
scriptEvaluator
Evaluator. -
contextExtenders
Extenders for script context. -
customObject
The custom object we inject into all scripts.
-
-
Constructor Details
-
ScriptedPolicyRule
public ScriptedPolicyRule()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
-
matches
@Nonnull public PolicyRequirementRule.Tristate matches(@Nonnull AttributeFilterContext filterContext) Evaluate what this rule means.- Specified by:
matchesin interfacePolicyRequirementRule- Parameters:
filterContext- the context.- Returns:
- whether the rule holds
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
equals
-
hashCode
public int hashCode() -
toString
-