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>
public class DynamicAttributePredicate extends AbstractAttributePredicate
Predicate over anAttributeContextthat derives the value(s) to match based on one or more supplied Functions instead of static values.- Since:
- 3.4.0
-
-
Field Summary
Fields Modifier and Type Field Description private ListMultimap<String,Function<ProfileRequestContext,String>>attributeFunctionMapMap of attribute IDs to functions.private org.slf4j.LoggerlogClass logger.
-
Constructor Summary
Constructors Constructor Description DynamicAttributePredicate()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.voidsetAttributeFunctionMap(Map<String,Collection<Function<ProfileRequestContext,String>>> map)Set the map of attribute/function pairs (as a map of function collections) to check for.booleantest(ProfileRequestContext input)-
Methods inherited from class net.shibboleth.idp.profile.logic.AbstractAttributePredicate
allowNullAttributeContext, getAttributeContextLookupStrategy, isUseUnfilteredAttributes, setAttributeContextLookupStrategy, setUseUnfilteredAttributes
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
attributeFunctionMap
@Nonnull @NonnullElements private ListMultimap<String,Function<ProfileRequestContext,String>> attributeFunctionMap
Map of attribute IDs to functions.
-
-
Method Detail
-
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
public boolean test(@Nullable ProfileRequestContext input)- Specified by:
testin interfacePredicate<ProfileRequestContext>- Overrides:
testin classAbstractAttributePredicate
-
hasMatch
protected boolean hasMatch(@Nonnull @NonnullElements Map<String,IdPAttribute> attributeMap)
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 @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
protected boolean findMatch(@Nonnull @NotEmpty String toMatch, @Nonnull IdPAttribute attribute)
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
-
-