Package net.shibboleth.idp.profile.logic
Class DynamicAttributePredicate
java.lang.Object
net.shibboleth.idp.profile.logic.AbstractAttributePredicate
net.shibboleth.idp.profile.logic.DynamicAttributePredicate
- All Implemented Interfaces:
Predicate<ProfileRequestContext>
,Predicate<ProfileRequestContext>
Predicate over an
AttributeContext
that derives the value(s) to match based
on one or more supplied Functions instead of static values.- Since:
- 3.4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ListMultimap<String,
Function<ProfileRequestContext, String>> Map of attribute IDs to functions.private final org.slf4j.Logger
Class logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
findMatch
(String toMatch, IdPAttribute attribute) Look for a matching value in an attribute.protected boolean
hasMatch
(Map<String, IdPAttribute> attributeMap) Abstract implementation of the condition to evaluate.protected boolean
hasMatch
(ProfileRequestContext profileRequestContext, Map<String, IdPAttribute> attributeMap) Implementation of the condition to evaluate.void
Set the map of attribute/function pairs (as a map of function collections) to check for.boolean
test
(ProfileRequestContext input) Methods inherited from class net.shibboleth.idp.profile.logic.AbstractAttributePredicate
allowNullAttributeContext, getAttributeContextLookupStrategy, isUseUnfilteredAttributes, setAttributeContextLookupStrategy, setUseUnfilteredAttributes
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
attributeFunctionMap
@Nonnull @NonnullElements private ListMultimap<String,Function<ProfileRequestContext, attributeFunctionMapString>> Map of attribute IDs to functions.
-
-
Constructor Details
-
DynamicAttributePredicate
public DynamicAttributePredicate()Constructor.
-
-
Method Details
-
setAttributeFunctionMap
public void setAttributeFunctionMap(@Nonnull @NonnullElements Map<String, Collection<Function<ProfileRequestContext, String>>> map) Set the map of attribute/function pairs (as a map of function collections) to check for.- Parameters:
map
- map of attribute/function pairs
-
test
- Specified by:
test
in interfacePredicate<ProfileRequestContext>
- Overrides:
test
in classAbstractAttributePredicate
-
hasMatch
Abstract implementation of the condition to evaluate.- Specified by:
hasMatch
in classAbstractAttributePredicate
- Parameters:
attributeMap
- the attributes to evaluate- Returns:
- the condition result
-
hasMatch
protected boolean hasMatch(@Nullable ProfileRequestContext profileRequestContext, @Nonnull @NonnullElements Map<String, IdPAttribute> attributeMap) Implementation of the condition to evaluate.- Parameters:
profileRequestContext
- current profile request contextattributeMap
- the attributes to evaluate- Returns:
- the condition result
-
findMatch
Look for a matching value in an attribute.- Parameters:
toMatch
- value to look forattribute
- attribute to check- Returns:
- true iff the value is one of the attribute's values
-