public class SimpleAttributePredicate extends Object implements com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext>
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.
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,AttributeContext> |
attributeContextLookupStrategy
Strategy function to lookup
AttributeContext. |
private com.google.common.collect.ListMultimap<String,String> |
attributeValueMap
Map of attribute IDs to values.
|
private Logger |
log
Class logger.
|
| Constructor and Description |
|---|
SimpleAttributePredicate()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(org.opensaml.profile.context.ProfileRequestContext input) |
private boolean |
findMatch(String toMatch,
IdPAttribute attribute)
Look for a matching value in an attribute.
|
void |
setAttributeContextLookupStrategy(com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,AttributeContext> strategy)
Set the lookup strategy to use to locate the
AttributeContext. |
void |
setAttributeValueMap(Map<String,Collection<String>> map)
Set the map of attribute/value pairs (as a map of string collections) to check for.
|
@Nonnull private com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,AttributeContext> attributeContextLookupStrategy
AttributeContext.public void setAttributeContextLookupStrategy(@Nonnull com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,AttributeContext> strategy)
AttributeContext.strategy - lookup function to usepublic void setAttributeValueMap(@Nonnull@NonnullElements Map<String,Collection<String>> map)
map - map of attribute/value pairspublic boolean apply(@Nullable org.opensaml.profile.context.ProfileRequestContext input)
apply in interface com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext>private boolean findMatch(@Nonnull@NotEmpty String toMatch, @Nonnull IdPAttribute attribute)
toMatch - value to look forattribute - attribute to checkCopyright © 1999–2014. All rights reserved.