Return-Path: Delivered-To: apmail-incubator-directory-cvs-archive@www.apache.org Received: (qmail 59858 invoked from network); 2 Mar 2005 14:07:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Mar 2005 14:07:55 -0000 Received: (qmail 43589 invoked by uid 500); 2 Mar 2005 14:07:53 -0000 Delivered-To: apmail-incubator-directory-cvs-archive@incubator.apache.org Received: (qmail 43509 invoked by uid 500); 2 Mar 2005 14:07:53 -0000 Mailing-List: contact directory-cvs-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: directory-dev@incubator.apache.org Delivered-To: mailing list directory-cvs@incubator.apache.org Received: (qmail 43361 invoked by uid 99); 2 Mar 2005 14:07:52 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 02 Mar 2005 06:07:51 -0800 Received: (qmail 59686 invoked by uid 65534); 2 Mar 2005 14:07:49 -0000 Message-ID: <20050302140749.59685.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Wed, 02 Mar 2005 14:07:49 -0000 Subject: svn commit: r155921 - in incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server: db/jdbm/JdbmDatabase.java jndi/ServerContextFactory.java To: directory-cvs@incubator.apache.org From: akarasulu@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Wed Mar 2 06:07:47 2005 New Revision: 155921 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D155921 Log: committing endi partion patch Modified: incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/db/jdbm/JdbmDatabase.java incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/jndi/ServerContextFactory.java Modified: incubator/directory/apacheds/trunk/core/src/main/java/org/apache/= ldap/server/db/jdbm/JdbmDatabase.java URL: http://svn.apache.org/viewcvs/incubator/directory/apacheds/trunk/core/= src/main/java/org/apache/ldap/server/db/jdbm/JdbmDatabase.java?view=3Ddiff&= r1=3D155920&r2=3D155921 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/db/jdbm/JdbmDatabase.java (original) +++ incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/db/jdbm/JdbmDatabase.java Wed Mar 2 06:07:47 2005 @@ -58,8 +58,10 @@ { /** the JDBM record manager used by this database */ private final RecordManager recMan; - /** the suffix of this backend database */ - private final Name suffix; + /** the user provided suffix of this backend database */ + private final Name upSuffix; + /** the normalized suffix of this backend database */ + private final Name normSuffix; /** the working directory to use for files */ private final String wkdir; /** the master table storing entries by primary key */ @@ -96,14 +98,16 @@ /** * Creates a Databased based on JDBM B+Trees. * - * @param suffix the user provided suffix name=20 + * @param upSuffix the user provided suffix name + * @param normSuffix the normalized suffix name * @param wkdirPath the path to the working directory where the db res= ides * @throws NamingException if db cannot be created */ - public JdbmDatabase ( final Name suffix, final String wkdirPath ) + public JdbmDatabase ( final Name upSuffix, final Name normSuffix, fina= l String wkdirPath ) throws NamingException { - this.suffix =3D suffix; + this.upSuffix =3D upSuffix; + this.normSuffix =3D normSuffix; this.wkdir =3D wkdirPath; =20 try=20 @@ -495,14 +499,14 @@ * make all other aliases to the target inconsistent. *=20 * We need to walk up the path of alias ancestors until we reach t= he=20 - * suffix, deleting each ( ancestorId, targetId ) tuple in the=20 + * upSuffix, deleting each ( ancestorId, targetId ) tuple in the * subtree scope alias. We only need to do this for the direct pa= rent * of the alias on the one level subtree. */ oneAliasIdx.drop( ancestorId, targetId ); subAliasIdx.drop( ancestorId, targetId ); =20 - while ( ! ancestorDn.equals( suffix ) ) + while ( ! ancestorDn.equals( upSuffix ) ) { ancestorDn =3D ancestorDn.getSuffix( 1 ); ancestorId =3D getEntryId( ancestorDn.toString() ); @@ -568,13 +572,13 @@ * id may be null but the alias may be to a valid entry in=20 * another namingContext. Such aliases are not allowed and we * need to point it out to the user instead of saying the target - * does not exist when it potentially could outside of this suffix. + * does not exist when it potentially could outside of this upSuff= ix. */ - if ( ! targetDn.startsWith( suffix ) ) + if ( ! targetDn.startsWith( upSuffix ) ) { // Complain specifically about aliases to outside naming conte= xts throw new NamingException( "[36] aliasDereferencingProblem -" - + " the alias points to an entry outside of the " + suffix + + " the alias points to an entry outside of the " + upSuff= ix + " namingContext to an object whose existance cannot be" + " determined." ); } @@ -636,14 +640,14 @@ /* * Handle Sub Level Scope Alias Index *=20 - * Walk the list of relatives from the parents up to the suffix, t= esting + * Walk the list of relatives from the parents up to the upSuffix,= testing * to see if the alias' target is a descendant of the relative. I= f the * alias target is not a descentant of the relative it extends the= scope - * and is added to the sub tree scope alias index. The suffix nod= e is + * and is added to the sub tree scope alias index. The upSuffix n= ode is * ignored since everything is under its scope. The first loop=20 * iteration shall handle the parents. */ - while ( ! ancestorDn.equals( suffix ) && null !=3D ancestorId ) + while ( ! ancestorDn.equals( upSuffix ) && null !=3D ancestorId ) { if ( ! NamespaceTools.isDescendant( ancestorDn, targetDn ) ) { @@ -672,7 +676,7 @@ // entry sequences start at 1. // =20 - if ( dn.equals( suffix ) ) + if ( dn.equals( normSuffix ) ) { parentId =3D BigInteger.ZERO; } @@ -760,7 +764,7 @@ updnIdx.drop( id ); heirarchyIdx.drop( id ); =20 - // Remove parent's reference to entry only if entry is not the suf= fix =20 + // Remove parent's reference to entry only if entry is not the upS= uffix if ( ! parentId.equals( BigInteger.ZERO ) ) { heirarchyIdx.drop( parentId, id ); @@ -811,7 +815,7 @@ */ public Name getSuffix() { - return suffix; + return upSuffix; } =20 =20 @@ -820,7 +824,7 @@ */ public Attributes getSuffixEntry() throws NamingException { - BigInteger id =3D getEntryId( suffix.toString() ); + BigInteger id =3D getEntryId( upSuffix.toString() ); =20 if ( null =3D=3D id ) { @@ -1637,7 +1641,7 @@ * make all other aliases to the target inconsistent. *=20 * We need to walk up the path of alias ancestors right above the = moved=20 - * base until we reach the suffix, deleting each ( ancestorId,=20 + * base until we reach the upSuffix, deleting each ( ancestorId, * targetId ) tuple in the subtree scope alias. We only need to d= o=20 * this for the direct parent of the alias on the one level subtre= e if * the moved base is the alias. @@ -1649,7 +1653,7 @@ =20 subAliasIdx.drop( ancestorId, targetId ); =20 - while ( ! ancestorDn.equals( suffix ) ) + while ( ! ancestorDn.equals( upSuffix ) ) { ancestorDn =3D ancestorDn.getSuffix( 1 ); ancestorId =3D getEntryId( ancestorDn.toString() ); Modified: incubator/directory/apacheds/trunk/core/src/main/java/org/apache/= ldap/server/jndi/ServerContextFactory.java URL: http://svn.apache.org/viewcvs/incubator/directory/apacheds/trunk/core/= src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java?view=3D= diff&r1=3D155920&r2=3D155921 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/jndi/ServerContextFactory.java (original) +++ incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/jndi/ServerContextFactory.java Wed Mar 2 06:07:47 2005 @@ -447,7 +447,7 @@ =20 LdapName suffix =3D new LdapName(); suffix.add( SystemPartition.SUFFIX ); - Database db =3D new JdbmDatabase( suffix, wkdir ); + Database db =3D new JdbmDatabase( suffix, suffix, wkdir ); =20 AttributeTypeRegistry attributeTypeRegistry; attributeTypeRegistry =3D bootstrapRegistries @@ -628,7 +628,7 @@ .getNormalizer(); Name normSuffix =3D new LdapName( ( String ) dnNorm .normalize( configs[ii].getSuffix() ) ); - Database db =3D new JdbmDatabase( upSuffix, wkdir ); + Database db =3D new JdbmDatabase( upSuffix, normSuffix, wkdir = ); =20 // -----------------------------------------------------------= ----- // create the search engine using db, enumerators and evaluato= rs