Class AbstractAttributePredicate

  • All Implemented Interfaces:
    Predicate<org.opensaml.profile.context.ProfileRequestContext>, net.shibboleth.utilities.java.support.logic.Predicate<org.opensaml.profile.context.ProfileRequestContext>
    Direct Known Subclasses:
    DateAttributePredicate, DynamicAttributePredicate, RegexAttributePredicate, SimpleAttributePredicate

    public abstract class AbstractAttributePredicate
    extends Object
    implements net.shibboleth.utilities.java.support.logic.Predicate<org.opensaml.profile.context.ProfileRequestContext>
    Abstract base class for predicates operating on an AttributeContext.
    • Field Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
      • attributeContextLookupStrategy

        @Nonnull
        private Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.attribute.context.AttributeContext> attributeContextLookupStrategy
        Strategy function to lookup AttributeContext.
      • useUnfilteredAttributes

        private boolean useUnfilteredAttributes
        Whether to look at filtered or unfiltered attributes.
    • Constructor Detail

      • AbstractAttributePredicate

        public AbstractAttributePredicate()
        Constructor.
    • Method Detail

      • getAttributeContextLookupStrategy

        @Nonnull
        public Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.attribute.context.AttributeContext> getAttributeContextLookupStrategy()
        Get the lookup strategy to use to locate the AttributeContext.
        Returns:
        lookup strategy to use
      • setAttributeContextLookupStrategy

        public void setAttributeContextLookupStrategy​(@Nonnull
                                                      Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.attribute.context.AttributeContext> strategy)
        Set the lookup strategy to use to locate the AttributeContext.
        Parameters:
        strategy - lookup function to use
      • isUseUnfilteredAttributes

        public boolean isUseUnfilteredAttributes()
        Get whether to source the input attributes from the unfiltered set.
        Returns:
        whether to source the input attributes from the unfiltered set
      • setUseUnfilteredAttributes

        public void setUseUnfilteredAttributes​(boolean flag)
        Set whether to source the input attributes from the unfiltered set.

        Defaults to true.

        Parameters:
        flag - flag to set
      • test

        public boolean test​(@Nullable
                            org.opensaml.profile.context.ProfileRequestContext input)
        Specified by:
        test in interface Predicate<org.opensaml.profile.context.ProfileRequestContext>
      • allowNullAttributeContext

        protected boolean allowNullAttributeContext()
        Get the result of the predicate in the case the attribute context is null.
        Returns:
        null context result
      • hasMatch

        protected abstract boolean hasMatch​(@Nonnull @NonnullElements
                                            Map<String,​net.shibboleth.idp.attribute.IdPAttribute> attributeMap)
        Abstract implementation of the condition to evaluate.
        Parameters:
        attributeMap - the attributes to evaluate
        Returns:
        the condition result