public class SimpleAttributePredicate extends AbstractAttributePredicate
AttributeContext and checks
for particular attribute/value pairs.
A map to a collection of strings is used to represent the attribute(s) and value(s) to evaluate. The values are evaluated as a disjunction (OR) and the attributes are evaluated as a conjunction (AND).
This handles only simple string-valued data.
For the special case of checking for an attribute's presence, regardless of values, the '*' value is supported. Note that this does NOT exclude pathological cases such as empty or null values. A more advanced predicate should be used to deal with such cases.
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.collect.ListMultimap<String,String> |
attributeValueMap
Map of attribute IDs to values.
|
private org.slf4j.Logger |
log
Class logger.
|
| Constructor and Description |
|---|
SimpleAttributePredicate()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
allowNullAttributeContext()
Get the result of the predicate in the case the attribute context is null.
|
protected 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.
|
void |
setAttributeValueMap(Map<String,Collection<String>> map)
Set the map of attribute/value pairs (as a map of string collections) to check for.
|
apply, getAttributeContextLookupStrategy, isUseUnfilteredAttributes, setAttributeContextLookupStrategy, setUseUnfilteredAttributes@Nonnull private final org.slf4j.Logger log
@Nonnull @NonnullElements private com.google.common.collect.ListMultimap<String,String> attributeValueMap
public void setAttributeValueMap(@Nonnull@NonnullElements Map<String,Collection<String>> map)
map - map of attribute/value pairsprotected boolean allowNullAttributeContext()
allowNullAttributeContext in class AbstractAttributePredicateprotected boolean hasMatch(Map<String,IdPAttribute> attributeMap)
hasMatch in class AbstractAttributePredicateattributeMap - the attributes to evaluateprotected boolean findMatch(@Nonnull@NotEmpty String toMatch, @Nonnull IdPAttribute attribute)
toMatch - value to look forattribute - attribute to checkCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.