directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r763537 - in /directory/apacheds/branches/ldif-partition/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/jdbm: JdbmPartition.java JdbmStore.java
Date Thu, 09 Apr 2009 07:15:43 GMT
Author: akarasulu
Date: Thu Apr  9 07:15:42 2009
New Revision: 763537

URL: http://svn.apache.org/viewvc?rev=763537&view=rev
Log:
jdbm partition cleanup

 o removed cacheSize and suffix members which are managed in JdbmStore
 o added workingDirectory property methods delegating to JdbmStore
 o renamed and changed signature for init(DirectoryService) to initialize


Modified:
    directory/apacheds/branches/ldif-partition/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/jdbm/JdbmPartition.java
    directory/apacheds/branches/ldif-partition/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/jdbm/JdbmStore.java

Modified: directory/apacheds/branches/ldif-partition/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/jdbm/JdbmPartition.java?rev=763537&r1=763536&r2=763537&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/jdbm/JdbmPartition.java
(original)
+++ directory/apacheds/branches/ldif-partition/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/jdbm/JdbmPartition.java
Thu Apr  9 07:15:42 2009
@@ -21,9 +21,9 @@
 
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.server.xdbm.XdbmPartition;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.search.impl.CursorBuilder;
@@ -50,8 +50,6 @@
 {
     private boolean optimizerEnabled = true;
     private Set<JdbmIndex<?,ServerEntry>> indexedAttributes;
-    private int cacheSize;
-    private String suffix;
     
     
     // ------------------------------------------------------------------------
@@ -77,7 +75,6 @@
 
     public void setSuffix( String suffix ) throws Exception
     {
-        this.suffix = suffix;
         getStore().setUpSuffixString( suffix );
     }
 
@@ -87,7 +84,7 @@
      */
     public void setCacheSize( int cacheSize )
     {
-        this.cacheSize = cacheSize;
+        getJdbmStore().setCacheSize( cacheSize );
     }
 
 
@@ -96,7 +93,7 @@
      */
     public int getCacheSize()
     {
-        return cacheSize;
+        return getJdbmStore().getCacheSize();
     }
 
 
@@ -136,21 +133,33 @@
     }
 
 
+    public File getWorkingDirectory()
+    {
+        return getJdbmStore().getWorkingDirectory();
+    }
+    
+    
+    public void setWorkingDirectory( File workingDirectory )
+    {
+        getJdbmStore().setWorkingDirectory( workingDirectory );
+    }
+    
+    
     private JdbmStore<ServerEntry> getJdbmStore()
     {
         return ( JdbmStore<ServerEntry> ) getStore();
     }
     
-    
+
     // ------------------------------------------------------------------------
     // E N D   C O N F I G U R A T I O N   M E T H O D S
     // ------------------------------------------------------------------------
 
 
     @SuppressWarnings("unchecked")
-    public final void init( DirectoryService directoryService ) throws Exception
+    public final void initialize( Registries registries ) throws Exception
     {
-        setRegistries( directoryService.getRegistries() );
+        setRegistries( registries );
 
         EvaluatorBuilder evaluatorBuilder = new EvaluatorBuilder( getJdbmStore(), getRegistries()
);
         CursorBuilder cursorBuilder = new CursorBuilder( getJdbmStore(), evaluatorBuilder
);
@@ -168,10 +177,7 @@
         searchEngine = new DefaultSearchEngine( getJdbmStore(), cursorBuilder, evaluatorBuilder,
optimizer );
         
         // initialize the store
-        getJdbmStore().setCacheSize( getCacheSize() );
         getJdbmStore().setName( getId() );
-        getJdbmStore().setUpSuffixString( suffix );
-        getJdbmStore().setWorkingDirectory( new File( directoryService.getWorkingDirectory().getPath()
+ File.separator + getId() ) );
 
         Set<JdbmIndex<?,ServerEntry>> userIndices = new HashSet<JdbmIndex<?,ServerEntry>>();
         
@@ -240,6 +246,6 @@
             getJdbmStore().setUserIndices( userIndices );
         }
 
-        getJdbmStore().init( getRegistries() );
+        getJdbmStore().initialize( getRegistries() );
     }
 }

Modified: directory/apacheds/branches/ldif-partition/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/jdbm/JdbmStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/jdbm/JdbmStore.java?rev=763537&r1=763536&r2=763537&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/jdbm/JdbmStore.java
(original)
+++ directory/apacheds/branches/ldif-partition/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/jdbm/JdbmStore.java
Thu Apr  9 07:15:42 2009
@@ -223,7 +223,7 @@
      * @param registries the schema registries
      * @throws Exception on failure to lookup elements in registries or create database files
      */
-    public synchronized void init( Registries registries ) throws Exception
+    public synchronized void initialize( Registries registries ) throws Exception
     {
         this.oidRegistry = registries.getOidRegistry();
         this.attributeTypeRegistry = registries.getAttributeTypeRegistry();
@@ -948,9 +948,9 @@
          * ignored since everything is under its scope.  The first loop 
          * iteration shall handle the parents.
          */
-        while ( !ancestorDn.equals( normSuffix ) && null != ancestorId )
+        while ( ! ancestorDn.equals( normSuffix ) && null != ancestorId )
         {
-            if ( !NamespaceTools.isDescendant( ancestorDn, normalizedAliasTargetDn ) )
+            if ( ! NamespaceTools.isDescendant( ancestorDn, normalizedAliasTargetDn ) )
             {
                 subAliasIdx.add( ancestorId, targetId );
             }



Mime
View raw message