Class PredicatePolicyRule
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.filter.policyrule.impl.AbstractPolicyRule
net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl.PredicatePolicyRule
- All Implemented Interfaces:
PolicyRequirementRule
,Component
,DestructableComponent
,IdentifiableComponent
,IdentifiedComponent
,InitializableComponent
public class PredicatePolicyRule extends AbstractPolicyRule
Call out to an externally define predicate.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.shibboleth.idp.attribute.filter.PolicyRequirementRule
PolicyRequirementRule.Tristate
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.Logger
log
Class logger.private Function<AttributeFilterContext,ProfileRequestContext>
profileContextStrategy
How to get to theProfileRequestContext
from theAttributeFilterContext
.private Predicate<ProfileRequestContext>
rulePredicate
The predicate to use.Fields inherited from interface net.shibboleth.idp.attribute.filter.PolicyRequirementRule
MATCHES_ALL, MATCHES_NONE, REQUIREMENT_RULE_FAILS
-
Constructor Summary
Constructors Constructor Description PredicatePolicyRule()
Constructor. -
Method Summary
Modifier and Type Method Description protected void
doInitialize()
Function<AttributeFilterContext,ProfileRequestContext>
getProfileContextStrategy()
Set the context location strategy we'll use.Predicate<ProfileRequestContext>
getRulePredicate()
Get the Predicate we'll use.PolicyRequirementRule.Tristate
matches(AttributeFilterContext filterContext)
Compare the issuer from the context with the provided string.void
setProfileContextStrategy(Function<AttributeFilterContext,ProfileRequestContext> strategy)
Get the context location strategy we'll use.void
setRulePredicate(Predicate<ProfileRequestContext> predicate)
set the Predicate we'll use.Methods inherited from class net.shibboleth.idp.attribute.filter.policyrule.impl.AbstractPolicyRule
getLogPrefix
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
rulePredicate
The predicate to use. -
profileContextStrategy
How to get to theProfileRequestContext
from theAttributeFilterContext
.
-
-
Constructor Details
-
PredicatePolicyRule
public PredicatePolicyRule()Constructor.
-
-
Method Details
-
getRulePredicate
Get the Predicate we'll use.- Returns:
- Returns the Predicate.
-
setRulePredicate
set the Predicate we'll use.- Parameters:
predicate
- what to set.
-
getProfileContextStrategy
Set the context location strategy we'll use.- Returns:
- Returns the strategy.
-
setProfileContextStrategy
public void setProfileContextStrategy(Function<AttributeFilterContext,ProfileRequestContext> strategy)Get the context location strategy we'll use.- Parameters:
strategy
- what to set.
-
doInitialize
- Overrides:
doInitialize
in classAbstractPolicyRule
- Throws:
ComponentInitializationException
-
matches
Compare the issuer from the context with the provided string.- Parameters:
filterContext
- the context- Returns:
- whether it matches. All failure and navigation issues return
PolicyRequirementRule.Tristate.FAIL
. whether the rule holds
-