/** * Tells if the current Dn is a parent of another Dn.<br> * For instance, <b>dc=com</b> is a ancestor * of <b>dc=example, dc=com</b> * * @param dn The child * @return true if the current Dn is a parent of the given Dn */ public boolean isAncestorOf( Dn dn ) { if ( dn == null ) { return false; } return dn.isDescendantOf( this ); }
/** * Tells if the current Dn is a parent of another Dn.<br> * For instance, <b>dc=com</b> is a ancestor * of <b>dc=example, dc=com</b> * * @param dn The child * @return true if the current Dn is a parent of the given Dn */ public boolean isAncestorOf( Dn dn ) { if ( dn == null ) { return false; } return dn.isDescendantOf( this ); }
/** * Tells if the current Dn is a parent of another Dn.<br> * For instance, <b>dc=com</b> is a ancestor * of <b>dc=example, dc=com</b> * * @param dn The child * @return true if the current Dn is a parent of the given Dn */ public boolean isAncestorOf( Dn dn ) { if ( dn == null ) { return false; } return dn.isDescendantOf( this ); }
/** * Tells if a Dn is a child of another Dn.<br> * For instance, <b>dc=example, dc=com</b> is a descendant * of <b>dc=com</b> * * @param dn The parent * @return true if the current Dn is a child of the given Dn */ public boolean isDescendantOf( String dn ) { try { return isDescendantOf( new Dn( schemaManager, dn ) ); } catch ( LdapInvalidDnException lide ) { return false; } }
/** * Tells if a Dn is a child of another Dn.<br> * For instance, <b>dc=example, dc=com</b> is a descendant * of <b>dc=com</b> * * @param dn The parent * @return true if the current Dn is a child of the given Dn */ public boolean isDescendantOf( String dn ) { try { return isDescendantOf( new Dn( schemaManager, dn ) ); } catch ( LdapInvalidDnException lide ) { return false; } }
/** * Tells if a Dn is a child of another Dn.<br> * For instance, <b>dc=example, dc=com</b> is a descendant * of <b>dc=com</b> * * @param dn The parent * @return true if the current Dn is a child of the given Dn */ public boolean isDescendantOf( String dn ) { try { return isDescendantOf( new Dn( schemaManager, dn ) ); } catch ( LdapInvalidDnException lide ) { return false; } }
public String rewriteBase(final String base) { try { Dn lowerCasedContextDn = (contextDn == null) ? null : new Dn(contextDn.toString().toLowerCase()); Dn lowerCasedBaseDn = new Dn(base.toLowerCase()); if (!lowerCasedBaseDn.isDescendantOf(lowerCasedContextDn)) { return base; } if (lowerCasedBaseDn.equals(lowerCasedContextDn)) { return ""; } Dn lowerCasedRelativeDn = lowerCasedBaseDn.getDescendantOf(lowerCasedContextDn); return base.substring(0, lowerCasedRelativeDn.toString().length()); } catch (LdapInvalidDnException e) { throw new RuntimeException(e); } }
if ( !dn.isDescendantOf( ppolicyConfigDnRoot ) )
/** * {@inheritDoc} */ public boolean evaluate( ExprNode node, Dn dn, Entry record ) throws LdapException { ScopeNode snode = ( ScopeNode ) node; switch ( snode.getScope() ) { case OBJECT: return dn.equals( snode.getBaseDn() ); case ONELEVEL: if ( dn.isDescendantOf( snode.getBaseDn() ) ) { return ( snode.getBaseDn().size() + 1 ) == dn.size(); } case SUBTREE: return dn.isDescendantOf( snode.getBaseDn() ); default: throw new LdapInvalidSearchFilterException( I18n.err( I18n.ERR_247 ) ); } } }
if ( newParent.isDescendantOf( parent.nodeDn ) )
if ( newParent.isDescendantOf( parent.nodeDn ) )
subentryBaseDn = subentryBaseDn.add( subtree.getBase() ); if ( !entryDn.isDescendantOf( subentryBaseDn ) ) if ( entryRelativeDn.isDescendantOf( chopBeforeDn ) ) if ( entryRelativeDn.isDescendantOf( chopAfterDn ) && !chopAfterDn.equals( entryRelativeDn ) )
if ( entryDn.isDescendantOf( nc ) )
if ( entryDn.isDescendantOf( nc ) )
if ( entryDn.isDescendantOf( nc ) )
if ( !moveAndRenameContext.getNewSuperiorDn().isDescendantOf( consumerMsgLog.getSearchCriteria().getBase() ) )
if ( !moveContext.getNewSuperior().isDescendantOf( consumerMsgLog.getSearchCriteria().getBase() ) )
if ( ( getBaseDn() == null ) || ( !bindDn.isDescendantOf( getBaseDn() ) ) )