Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 51313 invoked from network); 3 Sep 2009 21:47:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Sep 2009 21:47:41 -0000 Received: (qmail 82616 invoked by uid 500); 3 Sep 2009 21:47:41 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 82553 invoked by uid 500); 3 Sep 2009 21:47:41 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 82544 invoked by uid 99); 3 Sep 2009 21:47:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2009 21:47:41 +0000 X-ASF-Spam-Status: No, hits=-1999.6 required=10.0 tests=ALL_TRUSTED,SUBJECT_FUZZY_TION X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2009 21:47:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E778A23888E7; Thu, 3 Sep 2009 21:47:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r811141 - in /directory/apacheds/branches/apacheds-schema: core/src/main/java/org/apache/directory/server/core/ core/src/main/java/org/apache/directory/server/core/partition/ core/src/main/java/org/apache/directory/server/core/partition/imp... Date: Thu, 03 Sep 2009 21:47:18 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090903214718.E778A23888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Thu Sep 3 21:47:17 2009 New Revision: 811141 URL: http://svn.apache.org/viewvc?rev=811141&view=rev Log: o Get rid of all the upSuffix, suffix suffixDn to keep only one single element : a LdapDN suffix. o Removed the associated useless methods to keep only the LdapDN getSuffix() and setSuffix( String ) methods Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/NullPartition.java directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/Partition.java directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java directory/apacheds/branches/apacheds-schema/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java directory/apacheds/branches/apacheds-schema/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=811141&r1=811140&r2=811141&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original) +++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Thu Sep 3 21:47:17 2009 @@ -609,7 +609,7 @@ } RemoveContextPartitionOperationContext removePartitionCtx = - new RemoveContextPartitionOperationContext( adminSession, partition.getSuffixDn() ); + new RemoveContextPartitionOperationContext( adminSession, partition.getSuffix() ); partitionNexus.removeContextPartition( removePartitionCtx ); } @@ -1444,7 +1444,7 @@ if( changeLog.isExposed() && changeLog.isTagSearchSupported() ) { - String clSuffix = ( ( TaggableSearchableChangeLogStore ) changeLog.getChangeLogStore() ).getPartition().getSuffix(); + String clSuffix = ( ( TaggableSearchableChangeLogStore ) changeLog.getChangeLogStore() ).getPartition().getSuffix().getUpName(); partitionNexus.getRootDSE( null ).getOriginalEntry().add( SchemaConstants.CHANGELOG_CONTEXT_AT, clSuffix ); } } Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java?rev=811141&r1=811140&r2=811141&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java (original) +++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java Thu Sep 3 21:47:17 2009 @@ -25,6 +25,7 @@ import org.apache.directory.server.core.interceptor.context.EntryOperationContext; import org.apache.directory.server.core.interceptor.context.LookupOperationContext; +import javax.naming.InvalidNameException; import javax.naming.NameNotFoundException; @@ -82,7 +83,7 @@ /** * Override this method to put your initialization code. */ - protected void doInit() + protected void doInit() throws InvalidNameException { } Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/NullPartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/NullPartition.java?rev=811141&r1=811140&r2=811141&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/NullPartition.java (original) +++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/NullPartition.java Thu Sep 3 21:47:17 2009 @@ -24,6 +24,8 @@ import java.util.Iterator; import java.util.List; +import javax.naming.InvalidNameException; + import org.apache.commons.collections.iterators.EmptyIterator; import org.apache.directory.server.core.entry.ClonedServerEntry; import org.apache.directory.server.core.filtering.EntryFilter; @@ -52,9 +54,7 @@ public class NullPartition extends AbstractPartition { private String id; - private String suffix; - private LdapDN upSuffixDn; - private LdapDN normSuffixDn; + private LdapDN suffix; /** @@ -111,31 +111,13 @@ /* (non-Javadoc) * @see org.apache.directory.server.core.partition.Partition#getSuffix() */ - public String getSuffix() + public LdapDN getSuffix() { return suffix; } /* (non-Javadoc) - * @see org.apache.directory.server.core.partition.Partition#getSuffixDn() - */ - public LdapDN getSuffixDn() throws Exception - { - return normSuffixDn; - } - - - /* (non-Javadoc) - * @see org.apache.directory.server.core.partition.Partition#getUpSuffixDn() - */ - public LdapDN getUpSuffixDn() throws Exception - { - return upSuffixDn; - } - - - /* (non-Javadoc) * @see org.apache.directory.server.core.partition.Partition#list(org.apache.directory.server.core.interceptor.context.ListOperationContext) */ public EntryFilteringCursor list( ListOperationContext opContext ) throws Exception @@ -336,12 +318,12 @@ } - /* (non-Javadoc) - * @see org.apache.directory.server.core.partition.Partition#setSuffix(java.lang.String) + /** + * {@inheritDoc} */ - public void setSuffix( String suffix ) + public void setSuffix( String suffix ) throws InvalidNameException { - this.suffix = suffix; + this.suffix = new LdapDN( suffix ); } Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/Partition.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/Partition.java?rev=811141&r1=811140&r2=811141&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/Partition.java (original) +++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/Partition.java Thu Sep 3 21:47:17 2009 @@ -39,6 +39,7 @@ import org.apache.directory.shared.ldap.name.LdapDN; import javax.naming.Context; +import javax.naming.InvalidNameException; /** @@ -86,19 +87,20 @@ /** - * Gets the non-normalized suffix for this Partition as a string. + * Gets the non-normalized suffix for this Partition. * - * @return the suffix string for this Partition. + * @return the suffix for this Partition. */ - String getSuffix(); + LdapDN getSuffix(); /** * Sets the non-normalized suffix for this Partition as a string. * * @param suffix the suffix string for this Partition. + * @throws InvalidNameException If the suffix is not a valid DN */ - void setSuffix( String suffix ); + void setSuffix( String suffix ) throws InvalidNameException; /** @@ -154,28 +156,6 @@ /** - * Gets the distinguished/absolute name of the suffix for all entries - * stored within this ContextPartition. - * - * @return Name representing the distinguished/absolute name of this - * ContextPartitions root context. - * @throws Exception if access or suffix parsing fails - */ - LdapDN getSuffixDn() throws Exception; - - - /** - * Gets the distinguished/absolute name of the suffix for all entries - * stored within this ContextPartition. - * - * @return Name representing the distinguished/absolute name of this - * ContextPartitions root context. - * @throws Exception if access or suffix parsing fails - */ - LdapDN getUpSuffixDn() throws Exception; - - - /** * Deletes a leaf entry from this ContextPartition: non-leaf entries cannot be * deleted until this operation has been applied to their children. * Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?rev=811141&r1=811140&r2=811141&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java (original) +++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java Thu Sep 3 21:47:17 2009 @@ -279,7 +279,7 @@ } catch ( Exception e ) { - LOG.warn( "Failed to destroy a partition: " + partition.getSuffixDn(), e ); + LOG.warn( "Failed to destroy a partition: " + partition.getSuffix(), e ); } finally { @@ -346,7 +346,7 @@ system.add( addOperationContext ); } - String key = system.getSuffixDn().toString(); + String key = system.getSuffix().getUpName(); if ( partitions.containsKey( key ) ) { @@ -356,19 +356,19 @@ synchronized ( partitionLookupTree ) { partitions.put( key, system ); - partitionLookupTree.add( system.getSuffixDn(), system ); + partitionLookupTree.add( system.getSuffix(), system ); EntryAttribute namingContexts = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT ); if ( namingContexts == null ) { namingContexts = new DefaultServerAttribute( registries.getAttributeTypeRegistry().lookup( SchemaConstants.NAMING_CONTEXTS_AT ), - system.getUpSuffixDn().getUpName() ); + system.getSuffix().getUpName() ); rootDSE.put( namingContexts ); } else { - namingContexts.add( system.getUpSuffixDn().getUpName() ); + namingContexts.add( system.getSuffix().getUpName() ); } } @@ -435,9 +435,9 @@ * Always returns the empty String "". * @return the empty String "" */ - public String getSuffix() + public LdapDN getSuffix() { - return ""; + return LdapDN.EMPTY_LDAPDN; } @@ -454,24 +454,6 @@ /** * {@inheritDoc} */ - public LdapDN getSuffixDn() - { - return LdapDN.EMPTY_LDAPDN; - } - - - /** - * {@inheritDoc} - */ - public LdapDN getUpSuffixDn() - { - return LdapDN.EMPTY_LDAPDN; - } - - - /** - * {@inheritDoc} - */ public boolean isInitialized() { return initialized; @@ -1028,7 +1010,7 @@ Partition partition = opContext.getPartition(); // Turn on default indices - String key = partition.getSuffix(); + String key = partition.getSuffix().getNormName(); if ( partitions.containsKey( key ) ) { @@ -1042,7 +1024,7 @@ synchronized ( partitionLookupTree ) { - LdapDN partitionSuffix = partition.getSuffixDn(); + LdapDN partitionSuffix = partition.getSuffix(); if ( partitionSuffix == null ) { @@ -1050,26 +1032,19 @@ } partitions.put( partitionSuffix.toString(), partition ); - partitionLookupTree.add( partition.getSuffixDn(), partition ); + partitionLookupTree.add( partition.getSuffix(), partition ); EntryAttribute namingContexts = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT ); - LdapDN partitionUpSuffix = partition.getUpSuffixDn(); - - if ( partitionUpSuffix == null ) - { - throw new ConfigurationException( "The current partition does not have any user provided suffix: " + partition.getId() ); - } - if ( namingContexts == null ) { namingContexts = new DefaultServerAttribute( - registries.getAttributeTypeRegistry().lookup( SchemaConstants.NAMING_CONTEXTS_AT ), partitionUpSuffix.getUpName() ); + registries.getAttributeTypeRegistry().lookup( SchemaConstants.NAMING_CONTEXTS_AT ), partitionSuffix.getUpName() ); rootDSE.put( namingContexts ); } else { - namingContexts.add( partitionUpSuffix.getUpName() ); + namingContexts.add( partitionSuffix.getUpName() ); } } } @@ -1096,7 +1071,7 @@ throw new NameNotFoundException( msg ); } - String partitionSuffix = partition.getUpSuffixDn().getUpName(); + String partitionSuffix = partition.getSuffix().getUpName(); // Retrieve the namingContexts from the RootDSE : the partition // suffix must be present in those namingContexts @@ -1204,7 +1179,7 @@ public LdapDN getSuffix( GetSuffixOperationContext getSuffixContext ) throws Exception { Partition backend = getPartition( getSuffixContext.getDn() ); - return backend.getSuffixDn(); + return backend.getSuffix(); } @@ -1286,9 +1261,9 @@ if ( namingContexts != null ) { - namingContexts.remove( partition.getSuffixDn().getUpName() ); + namingContexts.remove( partition.getSuffix().getUpName() ); } - partitions.remove( partition.getSuffixDn().toString() ); + partitions.remove( partition.getSuffix().getUpName() ); } } Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=811141&r1=811140&r2=811141&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original) +++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Thu Sep 3 21:47:17 2009 @@ -47,6 +47,7 @@ import org.apache.directory.shared.ldap.schema.AttributeType; import org.apache.directory.shared.ldap.schema.registries.Registries; +import javax.naming.InvalidNameException; import javax.naming.directory.SearchControls; import java.util.Collections; import java.util.HashSet; @@ -88,8 +89,7 @@ protected String id; protected int cacheSize = -1; - protected LdapDN suffixDn; - protected String suffix; + protected LdapDN suffix; /** The rootDSE context */ protected ServerEntry contextEntry; @@ -486,9 +486,9 @@ /** * {@inheritDoc} */ - public void setSuffix( String suffix ) + public void setSuffix( String suffix ) throws InvalidNameException { - this.suffix = suffix; + this.suffix = new LdapDN( suffix ); } Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java?rev=811141&r1=811140&r2=811141&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java (original) +++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java Thu Sep 3 21:47:17 2009 @@ -168,7 +168,7 @@ content.add( mainPnl, java.awt.BorderLayout.NORTH ); getContentPane().add( content, BorderLayout.CENTER ); // set title - setTitle( "Partition: " + this.partition.getSuffixDn().toString() ); + setTitle( "Partition: " + this.partition.getSuffix().getUpName() ); // add status bar getContentPane().add( statusBar, BorderLayout.SOUTH ); // add menu bar @@ -376,7 +376,7 @@ try { TreePath path = tree.getSelectionModel().getSelectionPath(); - String parentDn = partition.getSuffixDn().toString(); + String parentDn = partition.getSuffix().getUpName(); if ( null != path ) { @@ -421,7 +421,7 @@ if ( null == path ) { - return partition.getSuffixDn().toString(); + return partition.getSuffix().getUpName(); } Object last = path.getLastPathComponent(); @@ -440,7 +440,7 @@ } else { - base = partition.getSuffixDn().toString(); + base = partition.getSuffix().getUpName(); } return base; @@ -572,7 +572,7 @@ } else { - dialog.setBase( partition.getSuffixDn().toString() ); + dialog.setBase( partition.getSuffix().getUpName() ); } dialog.addActionListener( new ActionListener() @@ -886,8 +886,8 @@ // boolean doFiltered = false; nodes = new HashMap(); - ServerEntry suffix = partition.lookup( partition.getEntryId( partition.getSuffixDn().toNormName() ) ); - Long id = partition.getEntryId( partition.getSuffixDn().toString() ); + ServerEntry suffix = partition.lookup( partition.getEntryId( partition.getSuffix().toNormName() ) ); + Long id = partition.getEntryId( partition.getSuffix().getUpName() ); root = new EntryNode( id, null, partition, suffix, nodes ); /* Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java?rev=811141&r1=811140&r2=811141&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java (original) +++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java Thu Sep 3 21:47:17 2009 @@ -24,6 +24,7 @@ import java.util.Map; import java.util.Set; +import javax.naming.InvalidNameException; import javax.naming.NamingException; import org.apache.directory.server.constants.ServerDNConstants; @@ -112,12 +113,6 @@ /** the wrapped Partition */ private Partition wrapped = new NullPartition(); - /** the user provided suffix DN for this Partition */ - private LdapDN upSuffixDn = new LdapDN(); - - /** the normalized suffix DN for this Partition */ - private LdapDN normSuffixDn = new LdapDN(); - /** the registries managed by this SchemaPartition */ private Registries registries = new Registries(); @@ -132,9 +127,6 @@ */ public SchemaPartition() throws Exception { - upSuffixDn.add( ServerDNConstants.OU_SCHEMA_DN ); - normSuffixDn.add( ServerDNConstants.OU_SCHEMA_DN_NORMALIZED ); - // ----------------------------------------------------------------------- // Load apachemeta schema from within the ldap-schema Jar with all the // schema it depends on. This is a minimal mandatory set of schemas. @@ -188,7 +180,7 @@ @Override - protected void doInit() + protected void doInit() throws InvalidNameException { wrapped.setId( ID ); wrapped.setSuffix( ServerDNConstants.OU_SCHEMA_DN ); @@ -336,30 +328,12 @@ } - /* (non-Javadoc) - * @see org.apache.directory.server.core.partition.Partition#getSuffix() - */ - public final String getSuffix() - { - return ServerDNConstants.CN_SCHEMA_DN; - } - - - /* (non-Javadoc) - * @see org.apache.directory.server.core.partition.Partition#getSuffixDn() - */ - public LdapDN getSuffixDn() throws Exception - { - return normSuffixDn; - } - - - /* (non-Javadoc) - * @see org.apache.directory.server.core.partition.Partition#getUpSuffixDn() + /** + * {@inheritDoc} */ - public LdapDN getUpSuffixDn() throws Exception + public final LdapDN getSuffix() { - return upSuffixDn; + return wrapped.getSuffix(); } Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java?rev=811141&r1=811140&r2=811141&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java (original) +++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java Thu Sep 3 21:47:17 2009 @@ -235,7 +235,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); if ( !cursor.next() ) @@ -281,7 +281,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); if ( !cursor.next() ) @@ -327,7 +327,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); if ( !cursor.next() ) @@ -373,7 +373,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); if ( !cursor.next() ) @@ -419,7 +419,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); if ( !cursor.next() ) @@ -515,7 +515,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); if ( !cursor.next() ) @@ -637,7 +637,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); while ( cursor.next() ) @@ -690,7 +690,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); while ( cursor.next() ) @@ -719,7 +719,7 @@ // (& (m-oid=*) (m-name=*) ) filter.addNode( new PresenceNode( M_OID_OID ) ); filter.addNode( new PresenceNode( M_NAME_OID ) ); - return partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + return partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); } @@ -767,7 +767,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); while ( cursor.next() ) @@ -816,7 +816,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); while ( cursor.next() ) @@ -859,7 +859,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); while ( cursor.next() ) @@ -939,7 +939,7 @@ try { - cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(), + cursor = partition.search( new SearchOperationContext( null, partition.getSuffix(), AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) ); while ( cursor.next() ) Modified: directory/apacheds/branches/apacheds-schema/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=811141&r1=811140&r2=811141&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java (original) +++ directory/apacheds/branches/apacheds-schema/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java Thu Sep 3 21:47:17 2009 @@ -84,9 +84,9 @@ // ------------------------------------------------------------------------ - public String getSuffix() + public LdapDN getSuffix() { - return super.suffix; + return suffix; } @@ -158,7 +158,10 @@ // initialize the store store.setCacheSize( cacheSize ); store.setName( id ); - store.setSuffixDn( suffix ); + + // Normalize the suffix + suffix.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() ); + store.setSuffixDn( suffix.getNormName() ); store.setWorkingDirectory( new File( directoryService.getWorkingDirectory().getPath() + File.separator + id ) ); Set> userIndices = new HashSet>(); Modified: directory/apacheds/branches/apacheds-schema/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java?rev=811141&r1=811140&r2=811141&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java (original) +++ directory/apacheds/branches/apacheds-schema/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java Thu Sep 3 21:47:17 2009 @@ -67,7 +67,7 @@ assertTrue( ((DnBranchNode)child).contains( "dc=example" ) ); child = ((DnBranchNode)child).getChild( "dc=example" ); - assertEquals( "dc=example, dc=com", ((DnLeafNode)child).getElement().getSuffix() ); + assertEquals( "dc=example, dc=com", ((DnLeafNode)child).getElement().getSuffix().getUpName() ); } @@ -98,7 +98,7 @@ DnNode child = ((DnBranchNode)partitionLookupTree).getChild( "ou=system" ); assertTrue( child instanceof DnLeafNode ); - assertEquals( "ou=system", ((DnLeafNode)child).getElement().getSuffix() ); + assertEquals( "ou=system", ((DnLeafNode)child).getElement().getSuffix().getUpName() ); child = ((DnBranchNode)partitionLookupTree).getChild( "dc=com" ); assertTrue( child instanceof DnBranchNode ); @@ -106,7 +106,7 @@ child = ((DnBranchNode)child).getChild( "dc=example" ); assertTrue( child instanceof DnLeafNode ); - assertEquals( "dc=example, dc=com", ((DnLeafNode)child).getElement().getSuffix() ); + assertEquals( "dc=example, dc=com", ((DnLeafNode)child).getElement().getSuffix().getUpName() ); } @@ -175,10 +175,10 @@ DnNode child1 = ((DnBranchNode)child).getChild( "dc=example1" ); assertTrue( child1 instanceof DnLeafNode ); - assertEquals( "dc=example1, dc=com", ((DnLeafNode)child1).getElement().getSuffix() ); + assertEquals( "dc=example1, dc=com", ((DnLeafNode)child1).getElement().getSuffix().getUpName() ); DnNode child2 = ((DnBranchNode)child).getChild( "dc=example1" ); assertTrue( child2 instanceof DnLeafNode ); - assertEquals( "dc=example1, dc=com", ((DnLeafNode)child2).getElement().getSuffix() ); + assertEquals( "dc=example1, dc=com", ((DnLeafNode)child2).getElement().getSuffix().getUpName() ); } }