/** * Indicates whether this DN is an ancestor of the DN with the provided string * representation. It will be considered an ancestor of the provided DN if * the array of RDN components for the provided DN ends with the elements that * comprise the array of RDN components for this DN (i.e., if the provided DN * is subordinate to, or optionally equal to, this DN). The null DN will be * considered an ancestor for all other DNs (with the exception of the null DN * if {@code allowEquals} is {@code false}). * * @param s The string representation of the DN for which to make * the determination. * @param allowEquals Indicates whether a DN should be considered an * ancestor of itself. * * @return {@code true} if this DN may be considered an ancestor of the * provided DN, or {@code false} if not. * * @throws LDAPException If the provided string cannot be parsed as a DN. */ public boolean isAncestorOf(final String s, final boolean allowEquals) throws LDAPException { return isAncestorOf(new DN(s), allowEquals); }
/** * Indicates whether this DN is an ancestor of the DN with the provided string * representation. It will be considered an ancestor of the provided DN if * the array of RDN components for the provided DN ends with the elements that * comprise the array of RDN components for this DN (i.e., if the provided DN * is subordinate to, or optionally equal to, this DN). The null DN will be * considered an ancestor for all other DNs (with the exception of the null DN * if {@code allowEquals} is {@code false}). * * @param s The string representation of the DN for which to make * the determination. * @param allowEquals Indicates whether a DN should be considered an * ancestor of itself. * * @return {@code true} if this DN may be considered an ancestor of the * provided DN, or {@code false} if not. * * @throws LDAPException If the provided string cannot be parsed as a DN. */ public boolean isAncestorOf(final String s, final boolean allowEquals) throws LDAPException { return isAncestorOf(new DN(s), allowEquals); }
/** * Indicates whether the DN represented by the first string is an ancestor of * the DN represented by the second string. The first DN will be considered * an ancestor of the second DN if the array of RDN components for the first * DN ends with the elements that comprise the array of RDN components for the * second DN (i.e., if the first DN is subordinate to, or optionally equal to, * the second DN). The null DN will be considered an ancestor for all other * DNs (with the exception of the null DN if {@code allowEquals} is * {@code false}). * * @param s1 The string representation of the first DN for which to * make the determination. * @param s2 The string representation of the second DN for which * to make the determination. * @param allowEquals Indicates whether a DN should be considered an * ancestor of itself. * * @return {@code true} if the first DN may be considered an ancestor of the * second DN, or {@code false} if not. * * @throws LDAPException If either of the provided strings cannot be parsed * as a DN. */ public static boolean isAncestorOf(final String s1, final String s2, final boolean allowEquals) throws LDAPException { return new DN(s1).isAncestorOf(new DN(s2), allowEquals); }
/** * Indicates whether the DN represented by the first string is an ancestor of * the DN represented by the second string. The first DN will be considered * an ancestor of the second DN if the array of RDN components for the first * DN ends with the elements that comprise the array of RDN components for the * second DN (i.e., if the first DN is subordinate to, or optionally equal to, * the second DN). The null DN will be considered an ancestor for all other * DNs (with the exception of the null DN if {@code allowEquals} is * {@code false}). * * @param s1 The string representation of the first DN for which to * make the determination. * @param s2 The string representation of the second DN for which * to make the determination. * @param allowEquals Indicates whether a DN should be considered an * ancestor of itself. * * @return {@code true} if the first DN may be considered an ancestor of the * second DN, or {@code false} if not. * * @throws LDAPException If either of the provided strings cannot be parsed * as a DN. */ public static boolean isAncestorOf(final String s1, final String s2, final boolean allowEquals) throws LDAPException { return new DN(s1).isAncestorOf(new DN(s2), allowEquals); }
parsedDN2 = e2.getParsedDN(); if (parsedDN1.isAncestorOf(parsedDN2, false)) else if (parsedDN2.isAncestorOf(parsedDN1, false))
break; else if (restrictionDN.isAncestorOf(parsedBaseDN, false)) break; else if (restrictionDN.isAncestorOf(parsedBaseDN, false))