Class DynamicAttributePredicate
java.lang.Object
net.shibboleth.profile.context.logic.AbstractAttributePredicate
net.shibboleth.profile.context.logic.DynamicAttributePredicate
- All Implemented Interfaces:
Predicate<ProfileRequestContext>
Predicate over an
AttributeContext that derives the value(s) to match based
on one or more supplied Functions instead of static values.
Each function installed must return a value that matches a value of the attribute corresponding to the map key.
Functions may return a String or a Collection containing them.
- Since:
- 3.4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ListMultimap<String,Function<ProfileRequestContext, Object>> Map of attribute IDs to functions.private final org.slf4j.LoggerClass logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanfindMatch(String toMatch, IdPAttribute attribute) Look for a matching value in an attribute.protected booleanhasMatch(Map<String, IdPAttribute> attributeMap) Abstract implementation of the condition to evaluate.protected booleanhasMatch(ProfileRequestContext profileRequestContext, Map<String, IdPAttribute> attributeMap) Implementation of the condition to evaluate.voidSet the map of attribute/function pairs (as a map of function collections) to check for.booleantest(ProfileRequestContext input) Methods inherited from class net.shibboleth.profile.context.logic.AbstractAttributePredicate
allowNullAttributeContext, getAttributeContextLookupStrategy, isUseUnfilteredAttributes, setAttributeContextLookupStrategy, setUseUnfilteredAttributes
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
attributeFunctionMap
Map of attribute IDs to functions.
-
-
Constructor Details
-
DynamicAttributePredicate
public DynamicAttributePredicate()Constructor.
-
-
Method Details
-
setAttributeFunctionMap
public void setAttributeFunctionMap(@Nonnull Map<String, Collection<Function<ProfileRequestContext, Object>>> 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:
testin interfacePredicate<ProfileRequestContext>- Overrides:
testin classAbstractAttributePredicate
-
hasMatch
Abstract implementation of the condition to evaluate.- Specified by:
hasMatchin classAbstractAttributePredicate- Parameters:
attributeMap- the attributes to evaluate- Returns:
- the condition result
-
hasMatch
protected boolean hasMatch(@Nullable ProfileRequestContext profileRequestContext, @Nonnull 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
-