Class LDAPFilterMatcher

  • public class LDAPFilterMatcher
    extends Object
    Helper class to parse and evaluate if a LDAP filter expression matches a fetched LDAP entry.

    This is done by recursively evaluating the abstract syntax tree of the expression as parsed by an apache directory shared method.

    Olivier Grisel
    • Method Detail

      • match

        public boolean match​(Attributes attributes,
                             String filter)
        Check whether a raw string filter expression matches on the given LDAP entry.
        attributes - the ldap entry to match
        filter - a raw string filter expression (eg. (!(&(attr1=*)(attr2=value2)(attr3=val*))))
        true if the ldap entry matches the filter
      • simpleMatch

        protected static boolean simpleMatch​(Attributes attributes,
        Handle simple equality test on any non-null value (eg: (attr2=value2)).
        true if the equality holds
      • substringMatch

        protected boolean substringMatch​(Attributes attributes,
        Implement the substring match on any non-null value of a string attribute (eg: (attr3=val*)).
        the result of the regex evaluation