Class 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 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.
    • Constructor Detail

      • AttributePredicate

        public AttributePredicate()
        Constructor.
    • 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)
        Specified by:
        test in interface Predicate<net.shibboleth.idp.attribute.IdPAttribute>
      • 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