Class AttributePredicate
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.consent.logic.impl.AttributePredicate
-
- All Implemented Interfaces:
Predicate<net.shibboleth.idp.attribute.IdPAttribute>,net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.InitializableComponent,net.shibboleth.utilities.java.support.logic.Predicate<net.shibboleth.idp.attribute.IdPAttribute>
public class AttributePredicate extends net.shibboleth.utilities.java.support.component.AbstractInitializableComponent implements net.shibboleth.utilities.java.support.logic.Predicate<net.shibboleth.idp.attribute.IdPAttribute>Predicate to determine whether consent should be obtained for an attribute.
-
-
Field Summary
Fields Modifier and Type Field Description private Set<String>blacklistedAttributeIdsBlacklist of attribute IDs to deny.private PatternmatchExpressionRegular expression to apply for acceptance testing.private Set<String>whitelistedAttributeIdsWhitelist of attribute IDs to allow.
-
Constructor Summary
Constructors Constructor Description AttributePredicate()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanisEmpty(net.shibboleth.idp.attribute.IdPAttribute input)Whether the IdP attribute is empty.voidsetAttributeIdMatchExpression(Pattern expression)Set an attribute ID matching expression to apply for acceptance.voidsetBlacklistedAttributeIds(Collection<String> blacklist)Set the blacklisted attribute IDs.voidsetWhitelistedAttributeIds(Collection<String> whitelist)Set the whitelisted attribute IDs.booleantest(net.shibboleth.idp.attribute.IdPAttribute input)-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
whitelistedAttributeIds
@Nonnull @NonnullElements private Set<String> whitelistedAttributeIds
Whitelist of attribute IDs to allow.
-
blacklistedAttributeIds
@Nonnull @NonnullElements private Set<String> blacklistedAttributeIds
Blacklist of attribute IDs to deny.
-
matchExpression
@Nullable private Pattern matchExpression
Regular expression to apply for acceptance testing.
-
-
Method Detail
-
setWhitelistedAttributeIds
public void setWhitelistedAttributeIds(@Nonnull @NonnullElements Collection<String> whitelist)Set the whitelisted attribute IDs.- Parameters:
whitelist- whitelisted attribute IDs
-
setBlacklistedAttributeIds
public void setBlacklistedAttributeIds(@Nonnull @NonnullElements Collection<String> blacklist)Set the blacklisted attribute IDs.- Parameters:
blacklist- blacklisted attribute IDs
-
setAttributeIdMatchExpression
public void setAttributeIdMatchExpression(@Nullable Pattern expression)Set an attribute ID matching expression to apply for acceptance.- Parameters:
expression- an attribute ID matching expression
-
test
public boolean test(@Nullable net.shibboleth.idp.attribute.IdPAttribute input)
-
isEmpty
private boolean isEmpty(@Nonnull net.shibboleth.idp.attribute.IdPAttribute input)Whether the IdP attribute is empty.- Parameters:
input- the IdP Attribute- Returns:
- true if the IdP attribute has no values or empty values, false otherwise
-
-