directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r368608 - in /directory/trunks/apacheds/src/main/java/org/apache/ldap/server: configuration/DirectoryPartitionConfiguration.java partition/DefaultDirectoryPartitionNexus.java
Date Fri, 13 Jan 2006 06:02:15 GMT
Author: trustin
Date: Thu Jan 12 22:02:10 2006
New Revision: 368608

URL: http://svn.apache.org/viewcvs?rev=368608&view=rev
Log:
Resolve issue: DIREVE-301 (An Attempt to Use a New Type of Partition Configuration Fails)
* Default index attributes are added in DirectoryPartitionConfiguration instead of DefaultDirectoryPartitionNexus
now to avoid copying partition configurations.

Modified:
    directory/trunks/apacheds/src/main/java/org/apache/ldap/server/configuration/DirectoryPartitionConfiguration.java
    directory/trunks/apacheds/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java

Modified: directory/trunks/apacheds/src/main/java/org/apache/ldap/server/configuration/DirectoryPartitionConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/src/main/java/org/apache/ldap/server/configuration/DirectoryPartitionConfiguration.java?rev=368608&r1=368607&r2=368608&view=diff
==============================================================================
--- directory/trunks/apacheds/src/main/java/org/apache/ldap/server/configuration/DirectoryPartitionConfiguration.java
(original)
+++ directory/trunks/apacheds/src/main/java/org/apache/ldap/server/configuration/DirectoryPartitionConfiguration.java
Thu Jan 12 22:02:10 2006
@@ -31,6 +31,7 @@
 import org.apache.ldap.common.name.LdapName;
 import org.apache.ldap.common.schema.Normalizer;
 import org.apache.ldap.server.partition.DirectoryPartition;
+import org.apache.ldap.server.partition.Oid;
 import org.apache.ldap.server.partition.impl.btree.jdbm.JdbmDirectoryPartition;
 import org.apache.ldap.server.schema.MatchingRuleRegistry;
 
@@ -48,7 +49,7 @@
 
     private String name;
     private String suffix;
-    private Set indexedAttributes = new HashSet(); // Set<String>
+    private Set indexedAttributes; // Set<String>
     private Attributes contextEntry = new BasicAttributes( true );
     private DirectoryPartition contextPartition = new JdbmDirectoryPartition();
     
@@ -57,6 +58,7 @@
      */
     protected DirectoryPartitionConfiguration()
     {
+        setIndexedAttributes( new HashSet() );
     }
     
     /**
@@ -102,6 +104,16 @@
             // TODO Attribute name must be normalized and validated
             newIndexedAttributes.add( attribute );
         }
+        
+        // Add default indices
+        newIndexedAttributes.add( Oid.ALIAS );
+        newIndexedAttributes.add( Oid.EXISTANCE );
+        newIndexedAttributes.add( Oid.HIERARCHY );
+        newIndexedAttributes.add( Oid.NDN );
+        newIndexedAttributes.add( Oid.ONEALIAS );
+        newIndexedAttributes.add( Oid.SUBALIAS );
+        newIndexedAttributes.add( Oid.UPDN );
+
         this.indexedAttributes = newIndexedAttributes;
     }
     

Modified: directory/trunks/apacheds/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java?rev=368608&r1=368607&r2=368608&view=diff
==============================================================================
--- directory/trunks/apacheds/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java
(original)
+++ directory/trunks/apacheds/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java
Thu Jan 12 22:02:10 2006
@@ -416,30 +416,13 @@
         DirectoryPartition partition = config.getContextPartition();
 
         // Turn on default indices
-        MutableDirectoryPartitionConfiguration mcfg =
-            new MutableDirectoryPartitionConfiguration();
-        mcfg.setName( config.getName() );
-        mcfg.setSuffix( config.getSuffix() );
-        mcfg.setContextEntry( config.getContextEntry() );
-        mcfg.setContextPartition( partition );
-        
-        Set indexedAttrs = config.getIndexedAttributes();
-        indexedAttrs.add( Oid.ALIAS );
-        indexedAttrs.add( Oid.EXISTANCE );
-        indexedAttrs.add( Oid.HIERARCHY );
-        indexedAttrs.add( Oid.NDN );
-        indexedAttrs.add( Oid.ONEALIAS );
-        indexedAttrs.add( Oid.SUBALIAS );
-        indexedAttrs.add( Oid.UPDN );
-        mcfg.setIndexedAttributes( indexedAttrs );
-        
         String key = config.getSuffix();
         if( partitions.containsKey( key ) )
         {
             throw new ConfigurationException( "Duplicate partition suffix: " + key );
         }
 
-        partition.init( factoryCfg, mcfg );
+        partition.init( factoryCfg, config );
         partitions.put( partition.getSuffix( true ).toString(), partition );
         
         Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );



Mime
View raw message