/** * Get's a child using an rdn string. * * @param rdn the rdn to use as the node key * @return the child node corresponding to the rdn. */ public synchronized DnNode<N> getChild( Rdn rdn ) { if ( children.containsKey( rdn.getNormName() ) ) { return children.get( rdn.getNormName() ); } return null; }
/** * Tells if the current DnBranchNode contains another node associated * with an rdn. * * @param rdn The name we are looking for * @return <code>true</code> if the tree instance contains this name */ public synchronized boolean contains( Rdn rdn ) { return children.containsKey( rdn.getNormName() ); }
/** * Tells if the current DnBranchNode contains another node associated * with an rdn. * * @param rdn The name we are looking for * @return <code>true</code> if the tree instance contains this name */ public synchronized boolean contains( Rdn rdn ) { return children.containsKey( rdn.getNormName() ); }
/** * Get's a child using an rdn string. * * @param rdn the rdn to use as the node key * @return the child node corresponding to the rdn. */ public synchronized DnNode<N> getChild( Rdn rdn ) { if ( children.containsKey( rdn.getNormName() ) ) { return children.get( rdn.getNormName() ); } return null; }
sbNormName.append( rdn.getNormName() );
/** * rename the DnNode's Dn * * @param newRdn the new Rdn of this node * @throws LdapException If the rename failed */ public synchronized void rename( Rdn newRdn ) throws LdapException { Dn temp = nodeDn.getParent(); temp = temp.add( newRdn ); Rdn oldRdn = nodeRdn; nodeRdn = temp.getRdn(); nodeDn = temp; if ( parent != null ) { parent.children.remove( oldRdn.getNormName() ); parent.children.put( nodeRdn.getNormName(), this ); } updateAfterModDn( nodeDn ); }
/** * rename the DnNode's Dn * * @param newRdn the new Rdn of this node * @throws LdapException If the rename failed */ public synchronized void rename( Rdn newRdn ) throws LdapException { Dn temp = nodeDn.getParent(); temp = temp.add( newRdn ); Rdn oldRdn = nodeRdn; nodeRdn = temp.getRdn(); nodeDn = temp; if ( parent != null ) { parent.children.remove( oldRdn.getNormName() ); parent.children.put( nodeRdn.getNormName(), this ); } updateAfterModDn( nodeDn ); }
currentNode = currentNode.children.get( rdn.getNormName() );
currentNode = currentNode.children.get( rdn.getNormName() );
currentNode = currentNode.children.get( rdn.getNormName() );
sb.append( rdn.getNormName() ); rdns.add( rdn );
currentNode = currentNode.children.get( rdn.getNormName() );
sb.append( rdn.getNormName() ); rdns.add( rdn );
sb.append( rdn.getNormName() ); rdns.add( rdn );
currentNode = currentNode.children.get( rdn.getNormName() );
/** * Parses the given name string and fills the given Rdn object. * * @param schemaManager The SchemaManager * @param name the name to parse * @param rdn the Rdn to fill * * @throws LdapInvalidDnException the invalid name exception */ /* No protection*/static void parseRdn( SchemaManager schemaManager, String name, Rdn rdn ) throws LdapInvalidDnException { if ( Strings.isEmpty( name ) ) { throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13602_RDN_EMPTY ) ); } if ( rdn == null ) { throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13603_NULL_RDN ) ); } Position pos = new Position(); pos.start = 0; pos.length = name.length(); StringBuilder sb = new StringBuilder(); parseRdnInternal( schemaManager, name, pos, rdn ); sb.append( rdn.getNormName() ); }
/** * Parses the given name string and fills the given Rdn object. * * @param schemaManager The SchemaManager * @param name the name to parse * @param rdn the Rdn to fill * * @throws LdapInvalidDnException the invalid name exception */ /* No protection*/static void parseRdn( SchemaManager schemaManager, String name, Rdn rdn ) throws LdapInvalidDnException { if ( Strings.isEmpty( name ) ) { throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13602_RDN_EMPTY ) ); } if ( rdn == null ) { throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13603_NULL_RDN ) ); } Position pos = new Position(); pos.start = 0; pos.length = name.length(); StringBuilder sb = new StringBuilder(); parseRdnInternal( schemaManager, name, pos, rdn ); sb.append( rdn.getNormName() ); }
/** * Parses the given name string and fills the given Rdn object. * * @param schemaManager The SchemaManager * @param name the name to parse * @param rdn the Rdn to fill * * @throws LdapInvalidDnException the invalid name exception */ /* No protection*/static void parseRdn( SchemaManager schemaManager, String name, Rdn rdn ) throws LdapInvalidDnException { if ( Strings.isEmpty( name ) ) { throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13602_RDN_EMPTY ) ); } if ( rdn == null ) { throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13603_NULL_RDN ) ); } Position pos = new Position(); pos.start = 0; pos.length = name.length(); StringBuilder sb = new StringBuilder(); parseRdnInternal( schemaManager, name, pos, rdn ); sb.append( rdn.getNormName() ); }
parentNode.children.remove( rdn.getNormName() );
node.depth = node.nodeDn.size() + depth; rootNode.parent = node; node.children.put( rootNode.nodeRdn.getNormName(), rootNode ); rootNode = node;