directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r810805 [1/2] - in /directory/apacheds/branches/apacheds-schema/avl-partition: ./ src/main/java/org/apache/directory/server/core/partition/avl/ src/main/java/org/apache/directory/server/core/partition/ldif/ src/main/resources/ src/test/java...
Date Thu, 03 Sep 2009 08:16:35 GMT
Author: elecharny
Date: Thu Sep  3 08:16:34 2009
New Revision: 810805

URL: http://svn.apache.org/viewvc?rev=810805&view=rev
Log:
Injected Kiran's patch (direct, no modification done)

Added:
    directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/
    directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/DitToLdifWriter.java
    directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
    directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java
    directory/apacheds/branches/apacheds-schema/avl-partition/src/main/resources/
    directory/apacheds/branches/apacheds-schema/avl-partition/src/main/resources/ads-2.ldif
    directory/apacheds/branches/apacheds-schema/avl-partition/src/main/resources/sample-config.ldif
Modified:
    directory/apacheds/branches/apacheds-schema/avl-partition/pom.xml
    directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
    directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
    directory/apacheds/branches/apacheds-schema/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java

Modified: directory/apacheds/branches/apacheds-schema/avl-partition/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/avl-partition/pom.xml?rev=810805&r1=810804&r2=810805&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/avl-partition/pom.xml (original)
+++ directory/apacheds/branches/apacheds-schema/avl-partition/pom.xml Thu Sep  3 08:16:34 2009
@@ -93,6 +93,16 @@
       <artifactId>shared-ldap-constants</artifactId>
       <version>${org.apache.directory.shared.version}</version>
     </dependency>    
+
+   <!-- this dependency exists only for using the DitToLdifWriter class.
+        should be dropped once the ldif partition moves into its own module -->
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-client-api</artifactId>
+      <version>${org.apache.directory.shared.version}</version>
+      <scope>test</scope>
+    </dependency>    
+
   </dependencies>
 
   <build>

Modified: directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java?rev=810805&r1=810804&r2=810805&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java (original)
+++ directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java Thu Sep  3 08:16:34 2009
@@ -514,4 +514,18 @@
         initRegistries( registries );
     }
 
+
+    /*
+     * TODO requires review 
+     * 
+     * This getter deviates from the norm. all the partitions
+     * so far written never return a reference to store but I think that in this 
+     * case the presence of this method gives significant ease and advantage to perform
+     * add/delete etc. operations without creating a operation context.
+     */
+    public AvlStore<ServerEntry> getStore()
+    {
+        return store;
+    }
+    
 }

Modified: directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java?rev=810805&r1=810804&r2=810805&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java (original)
+++ directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java Thu Sep  3 08:16:34 2009
@@ -479,6 +479,11 @@
      */
     public LdapDN getSuffix()
     {
+        if( suffixDn == null )
+        {
+            return null;
+        }
+        
         try
         {
             return new LdapDN( suffixDn.getNormName() );
@@ -498,6 +503,11 @@
      */
     public LdapDN getUpSuffix()
     {
+        if( suffixDn == null )
+        {
+            return null;
+        }
+        
         try
         {
             return new LdapDN( suffixDn.getUpName() );
@@ -514,6 +524,11 @@
 
     public String getSuffixDn()
     {
+        if( suffixDn == null )
+        {
+            return null;
+        }
+        
         return suffixDn.getUpName();
     }
 
@@ -1368,6 +1383,7 @@
      */
     public void setAliasIndex( Index<String, E> index ) throws Exception
     {
+        protect( "aliasIndex" );
         if ( index instanceof AvlIndex )
         {
             this.aliasIdx = ( AvlIndex<String, E> ) index;
@@ -1376,6 +1392,8 @@
         {
             this.aliasIdx = ( AvlIndex<String, E> ) convert( index );
         }
+        
+        systemIndices.put( index.getAttributeId(), aliasIdx );
     }
 
 
@@ -1393,6 +1411,7 @@
      */
     public void setNdnIndex( Index<String, E> index ) throws Exception
     {
+        protect( "ndnIndex" );
         if ( index instanceof AvlIndex )
         {
             this.ndnIdx = ( AvlIndex<String, E> ) index;
@@ -1401,6 +1420,8 @@
         {
             this.ndnIdx = ( AvlIndex<String, E> ) convert( index );
         }
+        
+        systemIndices.put( index.getAttributeId(), ndnIdx );
     }
 
 
@@ -1409,6 +1430,7 @@
      */
     public void setOneAliasIndex( Index<Long, E> index ) throws Exception
     {
+        protect( "oneAliasIndex" );
         if ( index instanceof AvlIndex )
         {
             this.oneAliasIdx = ( AvlIndex<Long, E> ) index;
@@ -1417,6 +1439,8 @@
         {
             this.oneAliasIdx = ( AvlIndex<Long, E> ) convert( index );
         }
+        
+        systemIndices.put( index.getAttributeId(), oneAliasIdx );
     }
 
 
@@ -1425,6 +1449,7 @@
      */
     public void setOneLevelIndex( Index<Long, E> index ) throws Exception
     {
+        protect( "oneLevelIndex" );
         if ( index instanceof AvlIndex )
         {
             this.oneLevelIdx = ( AvlIndex<Long, E> ) index;
@@ -1433,6 +1458,8 @@
         {
             this.oneLevelIdx = ( AvlIndex<Long, E> ) convert( index );
         }
+        
+        systemIndices.put( index.getAttributeId(), oneLevelIdx );
     }
 
 
@@ -1441,6 +1468,7 @@
      */
     public void setPresenceIndex( Index<String, E> index ) throws Exception
     {
+        protect( "presenceIndex" );
         if ( index instanceof AvlIndex )
         {
             this.existenceIdx = ( AvlIndex<String, E> ) index;
@@ -1449,6 +1477,8 @@
         {
             this.existenceIdx = ( AvlIndex<String, E> ) convert( index );
         }
+
+        systemIndices.put( index.getAttributeId(), existenceIdx );
     }
 
 
@@ -1466,6 +1496,7 @@
      */
     public void setSubAliasIndex( Index<Long, E> index ) throws Exception
     {
+        protect( "subAliasIndex" );
         if ( index instanceof AvlIndex )
         {
             this.subAliasIdx = ( AvlIndex<Long, E> ) index;
@@ -1474,6 +1505,8 @@
         {
             this.subAliasIdx = ( AvlIndex<Long, E> ) convert( index );
         }
+        
+        systemIndices.put( index.getAttributeId(), subAliasIdx );
     }
 
 
@@ -1482,6 +1515,7 @@
      */
     public void setSubLevelIndex( Index<Long, E> index ) throws Exception
     {
+        protect( "subLevelIndex" );
         if ( index instanceof AvlIndex )
         {
             this.subLevelIdx = ( AvlIndex<Long, E> ) index;
@@ -1490,6 +1524,8 @@
         {
             this.subLevelIdx = ( AvlIndex<Long, E> ) convert( index );
         }
+        
+        systemIndices.put( index.getAttributeId(), subLevelIdx );
     }
 
 
@@ -1514,6 +1550,7 @@
      */
     public void setUpdnIndex( Index<String, E> index ) throws Exception
     {
+        protect( "updnIndex" );
         if ( index instanceof AvlIndex )
         {
             this.updnIdx = ( AvlIndex<String, E> ) index;
@@ -1522,6 +1559,8 @@
         {
             this.updnIdx = ( AvlIndex<String, E> ) convert( index );
         }
+        
+        systemIndices.put( index.getAttributeId(), updnIdx );
     }
 
 
@@ -1536,7 +1575,7 @@
         {
             if ( index instanceof AvlIndex )
             {
-                this.userIndices.put( index.getAttribute().getOid(), ( AvlIndex<?, E> ) index );
+                this.userIndices.put( index.getAttributeId(), ( AvlIndex<?, E> ) index );
                 continue;
             }
 
@@ -1945,52 +1984,66 @@
     }
 
 
-    public void setEntryCsnIndex( Index<String, E> arg0 ) throws Exception
+    public void setEntryCsnIndex( Index<String, E> index ) throws Exception
     {
-        // TODO Auto-generated method stub
-
+        protect( "entryCsnIndex" );
+        
+        if( index instanceof AvlIndex )
+        {
+            this.entryCsnIdx = ( AvlIndex<String, E> ) index;
+        }
+        else
+        {
+            this.entryCsnIdx = ( AvlIndex<String, E> ) convert( index );
+        }
+        
+        systemIndices.put( index.getAttributeId(), entryCsnIdx );
     }
 
 
-    public void setSyncOnWrite( boolean arg0 )
+    public void setSyncOnWrite( boolean sync )
     {
-        // TODO Auto-generated method stub
-
+        // do nothing
     }
 
 
-    public void setWorkingDirectory( File arg0 )
+    public void setWorkingDirectory( File wkDir )
     {
-        // TODO Auto-generated method stub
-
+        //do nothing
     }
 
 
     public File getWorkingDirectory()
     {
-        // TODO Auto-generated method stub
+        // returns null always
         return null;
     }
 
 
     public boolean isSyncOnWrite()
     {
-        // TODO Auto-generated method stub
         return false;
     }
 
 
-    public void setCacheSize( int arg0 )
+    public void setCacheSize( int size )
     {
-        // TODO Auto-generated method stub
-
+        // do nothing
     }
 
 
     public void setObjectClassIndex( Index<String, E> index ) throws NamingException
     {
         protect( "objectClassIndex" );
-        objectClassIdx = convert( index );
+        if( index instanceof AvlIndex )
+        {
+            this.objectClassIdx = ( AvlIndex<String, E> ) index;
+        }
+        else
+        {
+            objectClassIdx = convert( index );
+        }
+        
         systemIndices.put( index.getAttributeId(), objectClassIdx );
     }
 
@@ -1998,7 +2051,15 @@
     public void setEntryUuidIndex( Index<byte[], E> index ) throws NamingException
     {
         protect( "entryUuidIndex" );
-        entryUuidIdx = convert( index );
+        if( index instanceof AvlIndex )
+        {
+            this.entryUuidIdx = ( AvlIndex<byte[], E> ) index;
+        }
+        else
+        {
+            entryUuidIdx = convert( index );
+        }
+
         systemIndices.put( index.getAttributeId(), entryUuidIdx );
     }
 

Added: directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/DitToLdifWriter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/DitToLdifWriter.java?rev=810805&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/DitToLdifWriter.java (added)
+++ directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/DitToLdifWriter.java Thu Sep  3 08:16:34 2009
@@ -0,0 +1,202 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+
+package org.apache.directory.server.core.partition.ldif;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileWriter;
+import java.util.List;
+
+import org.apache.directory.shared.ldap.client.api.LdapConnection;
+import org.apache.directory.shared.ldap.client.api.messages.AddResponse;
+import org.apache.directory.shared.ldap.client.api.messages.SearchResponse;
+import org.apache.directory.shared.ldap.client.api.messages.SearchResultEntry;
+import org.apache.directory.shared.ldap.cursor.Cursor;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
+import org.apache.directory.shared.ldap.ldif.LdifReader;
+import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A simple utility to dump the DIT data into LDIF files on FS.
+ * 
+ * The pattern followed is as follows on FS
+ * Each entry will have a directory with its DN as name and an LDIF file with the same DN'.ldif'
+ * as its name.
+ * 
+ * NOTE: this file depends on ldap-client-api module
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class DitToLdifWriter
+{
+
+    private LdapConnection connection;
+
+    private LdifReader ldifParser = new LdifReader();
+    
+    private FileFilter dirFilter = new FileFilter()
+    {
+        public boolean accept( File dir )
+        {
+            return dir.isDirectory();
+        }
+    };
+    
+    private static Logger LOG = LoggerFactory.getLogger( DitToLdifWriter.class );    
+    
+    public DitToLdifWriter()
+    {
+        connection = new LdapConnection( "localhost", 10389 );
+        try
+        {
+            connection.bind( "uid=admin,ou=system", "secret" );
+        }
+        catch( Exception e )
+        {
+            throw new RuntimeException( "Failed to connect to the server", e );
+        }
+    }
+
+    
+    public void dumpDitToFS( String dn, File baseDir ) throws Exception
+    {
+        Cursor<SearchResponse> cursor = connection.search( dn, "(objectclass=*)", SearchScope.SUBTREE, "*", "+" );
+        
+        StringBuilder filePath = new StringBuilder();
+
+        while( cursor.next() )
+        {
+            SearchResponse searchRes = cursor.get();
+            if( searchRes instanceof SearchResultEntry )
+            {
+                SearchResultEntry searchResultEntry = ( SearchResultEntry ) searchRes;
+                Entry entry = searchResultEntry.getEntry();
+         
+                LdapDN entryDn = entry.getDn();
+                int size = entryDn.size();
+                
+                filePath.append( baseDir.getAbsolutePath() ).append( File.separator );
+                for( int i =0; i< size; i++ )
+                {
+                    filePath.append( entryDn.getRdn( i ).getUpName().toLowerCase() ).append( File.separator );
+                }
+                
+                File dir = new File( filePath.toString() );
+                dir.mkdirs();
+                filePath.setLength( 0 );
+                String ldif = LdifUtils.convertEntryToLdif( entry );
+                
+                File ldifFile = new File( dir, entryDn.getRdn().getUpName().toLowerCase() + ".ldif" );
+                FileWriter fw = new FileWriter( ldifFile );
+                fw.write( ldif );
+                fw.close();
+            }
+        }
+        
+        cursor.close();
+    }
+
+    
+    public void loadConfig( File baseDir, String partitionSuffix ) throws Exception
+    {
+        File dir = new File( baseDir, partitionSuffix );
+        
+        if( ! dir.exists() )
+        {
+            throw new Exception( "The specified configuration dir" + partitionSuffix + " doesn't exist under " + baseDir.getAbsolutePath() );
+        }
+        
+        loadEntry( dir );
+    }
+
+    
+    private void loadEntry( File entryDir ) throws Exception
+    {
+        LOG.warn( "processing dir {}", entryDir.getName() );
+        File ldifFile = new File( entryDir, entryDir.getName() + ".ldif" );
+        
+        if( ldifFile.exists() )
+        {
+            LOG.warn( "ldif file {} exists", ldifFile.getName() );
+            List<LdifEntry> entries = ldifParser.parseLdifFile( ldifFile.getAbsolutePath() );
+            if( entries != null && !entries.isEmpty() )
+            {
+                LOG.warn( "adding entry {}", entries.get( 0 ) );
+                // this ldif will have only one entry
+                AddResponse resp = connection.add( entries.get( 0 ).getEntry() );
+                LOG.warn( "{}", resp.getLdapResult().getResultCode() );
+            }
+        }
+        else
+        {
+            LOG.warn( "ldif file doesn't exist {}", ldifFile.getAbsolutePath() );
+        }
+        
+        File[] dirs = entryDir.listFiles( dirFilter );
+        if( dirs != null )
+        {
+            for( File f : dirs )
+            {
+                loadEntry( f );
+            }
+        }
+    }
+
+    
+    public void close() throws Exception
+    {
+        connection.close();
+    }
+    
+    public static void main( String[] args ) throws Exception
+    {
+        DitToLdifWriter configWriter = new DitToLdifWriter();
+        String partitionSuffix = "ou=config";
+        File baseDir = new File( "/tmp" );
+        configWriter.dumpDitToFS( partitionSuffix, baseDir );
+//        configWriter.loadConfig( baseDir, partitionSuffix );
+        configWriter.close();
+
+        /*
+        LdifReader reader = new LdifReader( new File( "src/main/resources/ads-2.ldif" ) );
+        Iterator<LdifEntry> itr = reader.iterator();
+        while( itr.hasNext() )
+        {
+            try
+            {
+                LdifEntry entry = itr.next();
+                configWriter.connection.add( entry.getEntry() );
+            }
+            catch( Exception e )
+            {
+                e.printStackTrace();
+                System.exit( 1 );
+            }
+        }
+        */
+    }
+}

Added: directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=810805&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (added)
+++ directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Thu Sep  3 08:16:34 2009
@@ -0,0 +1,651 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+
+package org.apache.directory.server.core.partition.ldif;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileWriter;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ClonedServerEntry;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.BindOperationContext;
+import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
+import org.apache.directory.server.core.partition.avl.AvlPartition;
+import org.apache.directory.server.core.partition.impl.btree.BTreePartition;
+import org.apache.directory.server.xdbm.Index;
+import org.apache.directory.server.xdbm.IndexCursor;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
+import org.apache.directory.shared.ldap.ldif.LdifReader;
+import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * TODO LdifPartition.
+ * 
+ * @org.apache.xbean.XBean
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class LdifPartition extends BTreePartition
+{
+    private LdifReader ldifParser = new LdifReader();
+
+    private File configParentDirectory;
+
+    private DirectoryService directoryService;
+
+    private int ldifScanInterval;
+
+    private FileFilter dirFilter = new FileFilter()
+    {
+        public boolean accept( File dir )
+        {
+            return dir.isDirectory();
+        }
+    };
+
+    private static final String CONF_FILE_EXTN = ".ldif";
+
+    private static Logger LOG = LoggerFactory.getLogger( LdifPartition.class );
+
+    private AvlPartition wrappedPartition = new AvlPartition();
+
+    public LdifPartition()
+    {
+    }
+
+
+
+    public void init( DirectoryService directoryService ) throws Exception
+    {
+        wrappedPartition.init( directoryService );
+
+        this.directoryService = directoryService;
+        this.registries = directoryService.getRegistries();
+        this.searchEngine = wrappedPartition.getSearchEngine();
+
+        LOG.debug( "id is : {}", wrappedPartition.getId() );
+        this.configParentDirectory = new File( directoryService.getWorkingDirectory().getPath() + File.separator
+            + wrappedPartition.getId() );
+        //        configParentDirectory.mkdir();
+        // load the config 
+        loadConfig();
+    }
+
+
+    @Override
+    public void add( AddOperationContext addContext ) throws Exception
+    {
+        wrappedPartition.add( addContext );
+        add( addContext.getEntry() );
+    }
+
+
+    @Override
+    public void delete( Long id ) throws Exception
+    {
+        ServerEntry entry = lookup( id );
+
+        wrappedPartition.delete( id );
+
+        if ( entry != null )
+        {
+            File file = getFile( entry.getDn() ).getParentFile();
+            boolean deleted = deleteFile( file );
+            LOG.warn( "deleted file {} {}", file.getAbsoluteFile(), deleted );
+        }
+
+    }
+
+
+    private void entryMoved( LdapDN entryDn, Long entryId ) throws Exception
+    {
+        File file = getFile( entryDn ).getParentFile();
+        boolean deleted = deleteFile( file );
+        LOG.warn( "move operation: deleted file {} {}", file.getAbsoluteFile(), deleted );
+
+        add( lookup( entryId ) );
+
+        IndexCursor<Long, ServerEntry> cursor = getSubLevelIndex().forwardCursor( entryId );
+        while ( cursor.next() )
+        {
+            add( cursor.get().getObject() );
+        }
+
+        cursor.close();
+    }
+
+
+    @Override
+    public void modify( ModifyOperationContext modifyContext ) throws Exception
+    {
+        wrappedPartition.modify( modifyContext );
+        // just overwrite the existing file
+        add( modifyContext.getEntry() );
+    }
+
+
+    @Override
+    public void move( MoveOperationContext moveContext ) throws Exception
+    {
+        LdapDN oldDn = moveContext.getDn();
+        Long id = getEntryId( oldDn.getNormName() );
+
+        wrappedPartition.move( moveContext );
+
+        entryMoved( oldDn, id );
+    }
+
+
+    @Override
+    public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws Exception
+    {
+        LdapDN oldDn = moveAndRenameContext.getDn();
+        Long id = getEntryId( oldDn.getNormName() );
+
+        wrappedPartition.moveAndRename( moveAndRenameContext );
+
+        entryMoved( oldDn, id );
+    }
+
+
+    @Override
+    public void rename( RenameOperationContext renameContext ) throws Exception
+    {
+        LdapDN oldDn = renameContext.getDn();
+        Long id = getEntryId( oldDn.getNormName() );
+
+        wrappedPartition.rename( renameContext );
+
+        entryMoved( oldDn, id );
+    }
+
+
+    /**
+     * loads the configuration into the DIT from the file system
+     * Note that it assumes the presence of a directory with the partition suffix's upname
+     * under the partition's base dir
+     * 
+     * for ex. if 'config' is the partition's id and 'ou=config' is its suffix it looks for the dir with the path
+     * 
+     * <directory-service-working-dir>/config/ou=config
+     * e.x example.com/config/ou=config
+     * 
+     * NOTE: this dir setup is just to ease the testing of this partition, this needs to be 
+     * replaced with some kind of bootstrapping the default config from a jar file and
+     * write to the FS in LDIF format
+     * 
+     * @throws Exception
+     */
+    public void loadConfig() throws Exception
+    {
+        File dir = new File( configParentDirectory, wrappedPartition.getSuffixDn().getUpName() );
+
+        //        if( ! dir.exists() )
+        //        {
+        //            throw new Exception( "The specified configuration dir " + getSuffix().toLowerCase() + " doesn't exist under " + configParentDirectory.getAbsolutePath() );
+        //        }
+
+        loadEntry( dir );
+    }
+
+
+    /*
+     * recursively load the configuration entries
+     */
+    private void loadEntry( File entryDir ) throws Exception
+    {
+        LOG.error( "processing dir {}", entryDir.getName() );
+
+        File ldifFile = new File( entryDir, entryDir.getName() + CONF_FILE_EXTN );
+
+        if ( ldifFile.exists() )
+        {
+            LOG.debug( "parsing ldif file {}", ldifFile.getName() );
+            List<LdifEntry> entries = ldifParser.parseLdifFile( ldifFile.getAbsolutePath() );
+            if ( entries != null && !entries.isEmpty() )
+            {
+                // this ldif will have only one entry
+                LdifEntry ldifEntry = entries.get( 0 );
+                LOG.debug( "adding entry {}", ldifEntry );
+
+                ServerEntry serverEntry = new DefaultServerEntry( registries, ldifEntry.getEntry() );
+
+                // call add on the wrapped partition not on the self
+                wrappedPartition.getStore().add( serverEntry );
+            }
+        }
+        else
+        {
+            // TODO do we need to bomb out if the expected LDIF file doesn't exist
+            LOG.warn( "ldif file doesn't exist {}", ldifFile.getAbsolutePath() );
+        }
+
+        File[] dirs = entryDir.listFiles( dirFilter );
+        if ( dirs != null )
+        {
+            for ( File f : dirs )
+            {
+                loadEntry( f );
+            }
+        }
+    }
+
+
+    private File getFile( LdapDN entryDn )
+    {
+        int size = entryDn.size();
+
+        StringBuilder filePath = new StringBuilder();
+        filePath.append( configParentDirectory.getAbsolutePath() ).append( File.separator );
+
+        for ( int i = 0; i < size; i++ )
+        {
+            filePath.append( entryDn.getRdn( i ).getUpName().toLowerCase() ).append( File.separator );
+        }
+
+        File dir = new File( filePath.toString() );
+        dir.mkdirs();
+
+        return new File( dir, entryDn.getRdn().getUpName().toLowerCase() + CONF_FILE_EXTN );
+    }
+
+
+    private void add( ServerEntry entry ) throws Exception
+    {
+        FileWriter fw = new FileWriter( getFile( entry.getDn() ) );
+        fw.write( LdifUtils.convertEntryToLdif( entry ) );
+        fw.close();
+    }
+
+
+    private boolean deleteFile( File file )
+    {
+        if ( file.isDirectory() )
+        {
+            File[] files = file.listFiles();
+            for ( File f : files )
+            {
+                deleteFile( f );
+            }
+
+            return file.delete();
+        }
+        else
+        {
+            return file.delete();
+        }
+    }
+
+
+    @Override
+    public void addIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    {
+        wrappedPartition.addIndexOn( index );
+    }
+
+
+    @Override
+    public int count() throws Exception
+    {
+        return wrappedPartition.count();
+    }
+
+
+    @Override
+    public void destroy() throws Exception
+    {
+        wrappedPartition.destroy();
+    }
+
+
+    @Override
+    public Index<String, ServerEntry> getAliasIndex()
+    {
+        return wrappedPartition.getAliasIndex();
+    }
+
+
+    @Override
+    public int getChildCount( Long id ) throws Exception
+    {
+        return wrappedPartition.getChildCount( id );
+    }
+
+
+    @Override
+    public String getEntryDn( Long id ) throws Exception
+    {
+        return wrappedPartition.getEntryDn( id );
+    }
+
+
+    @Override
+    public Long getEntryId( String dn ) throws Exception
+    {
+        return wrappedPartition.getEntryId( dn );
+    }
+
+
+    @Override
+    public String getEntryUpdn( Long id ) throws Exception
+    {
+        return wrappedPartition.getEntryUpdn( id );
+    }
+
+
+    @Override
+    public String getEntryUpdn( String dn ) throws Exception
+    {
+        return wrappedPartition.getEntryUpdn( dn );
+    }
+
+
+    @Override
+    public Index<String, ServerEntry> getNdnIndex()
+    {
+        return wrappedPartition.getNdnIndex();
+    }
+
+
+    @Override
+    public Index<Long, ServerEntry> getOneAliasIndex()
+    {
+        return wrappedPartition.getOneAliasIndex();
+    }
+
+
+    @Override
+    public Index<Long, ServerEntry> getOneLevelIndex()
+    {
+        return wrappedPartition.getOneLevelIndex();
+    }
+
+
+    @Override
+    public Long getParentId( Long childId ) throws Exception
+    {
+        return wrappedPartition.getParentId( childId );
+    }
+
+
+    @Override
+    public Long getParentId( String dn ) throws Exception
+    {
+        return wrappedPartition.getParentId( dn );
+    }
+
+
+    @Override
+    public Index<String, ServerEntry> getPresenceIndex()
+    {
+        return wrappedPartition.getPresenceIndex();
+    }
+
+
+    @Override
+    public String getProperty( String propertyName ) throws Exception
+    {
+        return wrappedPartition.getProperty( propertyName );
+    }
+
+
+    @Override
+    public Index<Long, ServerEntry> getSubAliasIndex()
+    {
+        return wrappedPartition.getSubAliasIndex();
+    }
+
+
+    @Override
+    public Index<Long, ServerEntry> getSubLevelIndex()
+    {
+        return wrappedPartition.getSubLevelIndex();
+    }
+
+
+    @Override
+    public Index<?, ServerEntry> getSystemIndex( String id ) throws Exception
+    {
+        return wrappedPartition.getSystemIndex( id );
+    }
+
+
+    @Override
+    public Iterator<String> getSystemIndices()
+    {
+        return wrappedPartition.getSystemIndices();
+    }
+
+
+    @Override
+    public Index<String, ServerEntry> getUpdnIndex()
+    {
+        return wrappedPartition.getUpdnIndex();
+    }
+
+
+    @Override
+    public Index<?, ServerEntry> getUserIndex( String id ) throws Exception
+    {
+        return wrappedPartition.getUserIndex( id );
+    }
+
+
+    @Override
+    public Iterator<String> getUserIndices()
+    {
+        return wrappedPartition.getUserIndices();
+    }
+
+
+    @Override
+    public boolean hasSystemIndexOn( String id ) throws Exception
+    {
+        return wrappedPartition.hasSystemIndexOn( id );
+    }
+
+
+    @Override
+    public boolean hasUserIndexOn( String id ) throws Exception
+    {
+        return wrappedPartition.hasUserIndexOn( id );
+    }
+
+
+    @Override
+    public boolean isInitialized()
+    {
+        return wrappedPartition.isInitialized();
+    }
+
+
+    @Override
+    public IndexCursor<Long, ServerEntry> list( Long id ) throws Exception
+    {
+        return wrappedPartition.list( id );
+    }
+
+
+    @Override
+    public ClonedServerEntry lookup( Long id ) throws Exception
+    {
+        return wrappedPartition.lookup( id );
+    }
+
+
+    @Override
+    public void setAliasIndexOn( Index<String, ServerEntry> index ) throws Exception
+    {
+        wrappedPartition.setAliasIndexOn( index );
+    }
+
+
+    @Override
+    public void setNdnIndexOn( Index<String, ServerEntry> index ) throws Exception
+    {
+        wrappedPartition.setNdnIndexOn( index );
+    }
+
+
+    @Override
+    public void setOneAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    {
+        wrappedPartition.setOneAliasIndexOn( index );
+    }
+
+
+    @Override
+    public void setOneLevelIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    {
+        wrappedPartition.setOneLevelIndexOn( index );
+    }
+
+
+    @Override
+    public void setPresenceIndexOn( Index<String, ServerEntry> index ) throws Exception
+    {
+        wrappedPartition.setPresenceIndexOn( index );
+    }
+
+
+    @Override
+    public void setProperty( String propertyName, String propertyValue ) throws Exception
+    {
+        wrappedPartition.setProperty( propertyName, propertyValue );
+    }
+
+
+    @Override
+    public void setRegistries( Registries registries ) throws Exception
+    {
+        wrappedPartition.setRegistries( registries );
+    }
+
+
+    @Override
+    public void setSubAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    {
+        wrappedPartition.setSubAliasIndexOn( index );
+    }
+
+
+    @Override
+    public void setUpdnIndexOn( Index<String, ServerEntry> index ) throws Exception
+    {
+        wrappedPartition.setUpdnIndexOn( index );
+    }
+
+
+    @Override
+    public void sync() throws Exception
+    {
+        wrappedPartition.sync();
+        //TODO implement the File I/O here to push the update to entries to the corresponding LDIF file
+    }
+
+
+    public void bind( BindOperationContext bindContext ) throws Exception
+    {
+        wrappedPartition.bind( bindContext );
+    }
+
+
+    public String getSuffix()
+    {
+        return wrappedPartition.getSuffix();
+    }
+
+
+    public LdapDN getSuffixDn() throws Exception
+    {
+        return wrappedPartition.getSuffixDn();
+    }
+
+
+    public LdapDN getUpSuffixDn() throws Exception
+    {
+        return wrappedPartition.getUpSuffixDn();
+    }
+
+
+    public void unbind( UnbindOperationContext unbindContext ) throws Exception
+    {
+        wrappedPartition.unbind( unbindContext );
+    }
+
+
+    @Override
+    public int getCacheSize()
+    {
+        // TODO Auto-generated method stub
+        return super.getCacheSize();
+    }
+
+
+    @Override
+    public String getId()
+    {
+        // TODO Auto-generated method stub
+        return super.getId();
+    }
+
+
+    @Override
+    public void setId( String id )
+    {
+        super.setId( id );
+        wrappedPartition.setId( id );
+    }
+
+
+    @Override
+    public void setSuffix( String suffix )
+    {
+        super.setSuffix( suffix );
+        wrappedPartition.setSuffix( suffix );
+    }
+
+
+    /**
+     * the interval at which the config directory containing LDIF files
+     * should be scanned, default value is 10 min
+     * 
+     * @param ldifScanInterval the scan interval time in minutes
+     */
+    public void setLdifScanInterval( int ldifScanInterval )
+    {
+        this.ldifScanInterval = ldifScanInterval;
+    }
+    
+}
\ No newline at end of file

Added: directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java?rev=810805&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java (added)
+++ directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java Thu Sep  3 08:16:34 2009
@@ -0,0 +1,600 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+
+package org.apache.directory.server.core.partition.ldif;
+
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileWriter;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.partition.avl.AvlStore;
+import org.apache.directory.server.xdbm.Index;
+import org.apache.directory.server.xdbm.IndexCursor;
+import org.apache.directory.server.xdbm.IndexNotFoundException;
+import org.apache.directory.server.xdbm.Store;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
+import org.apache.directory.shared.ldap.ldif.LdifReader;
+import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * TODO LdifStore.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class LdifStore<E> implements Store<E>
+{
+
+    /** the working directory to use for files */
+    private File workingDirectory;
+
+    /** true if we sync disks on every write operation */
+    private boolean isSyncOnWrite = true;
+
+    /** in memory store used for serving the config data present in LDIF files  */
+    private AvlStore<E> wrappedStore = new AvlStore<E>();
+
+    private Registries registries;
+    
+    private LdifReader ldifParser = new LdifReader();
+    
+    private FileFilter dirFilter = new FileFilter()
+    {
+        public boolean accept( File dir )
+        {
+            return dir.isDirectory();
+        }
+    };
+
+    private static final String CONF_FILE_EXTN = ".ldif";
+
+    private static Logger LOG = LoggerFactory.getLogger( LdifStore.class );
+    
+    public void init( Registries registries ) throws Exception
+    {
+        this.registries = registries;
+        wrappedStore.init( registries );
+     
+        // load the config 
+        loadConfig();
+    }
+
+
+    /**
+     * loads the configuration into the DIT from the file system
+     * @throws Exception
+     */
+    public void loadConfig() throws Exception
+    {
+        String upsuffixDir = wrappedStore.getUpSuffix().getUpName().toLowerCase();
+        File dir = new File( workingDirectory, upsuffixDir );
+        
+        if( ! dir.exists() )
+        {
+            throw new Exception( "The specified configuration dir " + upsuffixDir + " doesn't exist under " + workingDirectory.getAbsolutePath() );
+        }
+        
+        loadEntry( dir );
+    }
+
+    
+    /*
+     * recursively load the configuration entries
+     */
+    private void loadEntry( File entryDir ) throws Exception
+    {
+        LOG.debug( "processing dir {}", entryDir.getName() );
+        
+        File ldifFile = new File( entryDir, entryDir.getName() + CONF_FILE_EXTN );
+        
+        if( ldifFile.exists() )
+        {
+            LOG.debug( "parsing ldif file {}", ldifFile.getName() );
+            List<LdifEntry> entries = ldifParser.parseLdifFile( ldifFile.getAbsolutePath() );
+            if( entries != null && !entries.isEmpty() )
+            {
+                // this ldif will have only one entry
+                LdifEntry ldifEntry = entries.get( 0 );
+                LOG.debug( "adding entry {}", ldifEntry );
+
+                ServerEntry serverEntry = new DefaultServerEntry( registries, ldifEntry.getEntry() );
+                
+                // call add on the wrapped store not on the self  
+                wrappedStore.add( serverEntry );
+            }
+        }
+        else
+        {
+            // TODO do we need to bomb out if the expected LDIF file doesn't exist
+            // I think so
+            LOG.warn( "ldif file doesn't exist {}", ldifFile.getAbsolutePath() );
+        }
+        
+        File[] dirs = entryDir.listFiles( dirFilter );
+        if( dirs != null )
+        {
+            for( File f : dirs )
+            {
+                loadEntry( f );
+            }
+        }
+    }
+
+
+    private File getFile( LdapDN entryDn )
+    {
+        int size = entryDn.size();
+        
+        StringBuilder filePath = new StringBuilder();
+        filePath.append( workingDirectory.getAbsolutePath() ).append( File.separator );
+        
+        for( int i =0; i< size; i++ )
+        {
+            filePath.append( entryDn.getRdn( i ).getUpName().toLowerCase() ).append( File.separator );
+        }
+        
+        File dir = new File( filePath.toString() );
+        dir.mkdirs();
+        
+        return new File( dir, entryDn.getRdn().getUpName().toLowerCase() + CONF_FILE_EXTN );
+    }
+
+    
+    public void add( ServerEntry entry ) throws Exception 
+    {
+        wrappedStore.add( entry );
+        
+        FileWriter fw = new FileWriter( getFile( entry.getDn() ) );
+        fw.write( LdifUtils.convertEntryToLdif( entry ) );
+        fw.close();
+    }
+    
+    
+    public void delete( Long id ) throws Exception
+    {
+        ServerEntry entry = lookup( id );
+        LOG.warn( "deleting the entry with id {} and dn {}", id, entry.getDn() );
+
+        LOG.warn( "having the parent id {}", getParentId( entry.getDn().getUpName() ) );
+        wrappedStore.delete( id );
+        
+        if( entry != null )
+        {
+            File file = getFile( entry.getDn() ).getParentFile();
+            boolean deleted = deleteFile( file );
+            LOG.warn( "deleted file {} {}", file.getAbsoluteFile(), deleted );
+        }
+    }
+
+
+    private boolean deleteFile( File file )
+    {
+        if( file.isDirectory() )
+        {
+            File[] files = file.listFiles();
+            for( File f : files )
+            {
+                deleteFile( f );
+            }
+        }
+        
+        return file.delete();
+    }
+    
+    
+    public void destroy() throws Exception
+    {
+        wrappedStore.destroy();
+    }
+
+
+    public void modify( LdapDN dn, List<Modification> mods ) throws Exception
+    {
+        wrappedStore.modify( dn, mods );
+    }
+
+
+    public void modify( LdapDN dn, ModificationOperation modOp, ServerEntry mods ) throws Exception
+    {
+        wrappedStore.modify( dn, modOp, mods );
+    }
+
+
+    public void move( LdapDN oldChildDn, LdapDN newParentDn, Rdn newRdn, boolean deleteOldRdn ) throws Exception
+    {
+        wrappedStore.move( oldChildDn, newParentDn, newRdn, deleteOldRdn );
+    }
+
+
+    public void move( LdapDN oldChildDn, LdapDN newParentDn ) throws Exception
+    {
+        wrappedStore.move( oldChildDn, newParentDn );
+    }
+
+
+    public void rename( LdapDN dn, Rdn newRdn, boolean deleteOldRdn ) throws Exception
+    {
+        wrappedStore.rename( dn, newRdn, deleteOldRdn );
+    }
+
+
+    public void sync() throws Exception
+    {
+        //TODO implement the File I/O here to push the update to entries to the corresponding LDIF file
+    }
+
+
+    public void setWorkingDirectory( File workingDirectory )
+    {
+        this.workingDirectory = workingDirectory;
+    }
+
+
+    public File getWorkingDirectory()
+    {
+        return workingDirectory;
+    }
+
+
+    public void setSyncOnWrite( boolean isSyncOnWrite )
+    {
+        this.isSyncOnWrite = isSyncOnWrite;
+    }
+
+
+    public boolean isSyncOnWrite()
+    {
+        return isSyncOnWrite;
+    }
+
+
+    public void addIndex( Index<?, E> index ) throws Exception
+    {
+        wrappedStore.addIndex( index );
+    }
+
+
+    public int count() throws Exception
+    {
+        return wrappedStore.count();
+    }
+
+
+    public Index<String, E> getAliasIndex()
+    {
+        return wrappedStore.getAliasIndex();
+    }
+
+
+    public int getChildCount( Long id ) throws Exception
+    {
+        return wrappedStore.getChildCount( id );
+    }
+
+
+    public String getEntryDn( Long id ) throws Exception
+    {
+        return wrappedStore.getEntryDn( id );
+    }
+
+
+    public Long getEntryId( String dn ) throws Exception
+    {
+        return wrappedStore.getEntryId( dn );
+    }
+
+
+    public String getEntryUpdn( Long arg0 ) throws Exception
+    {
+        return wrappedStore.getEntryUpdn( arg0 );
+    }
+
+
+    public String getEntryUpdn( String dn ) throws Exception
+    {
+        return wrappedStore.getEntryUpdn( dn );
+    }
+
+
+    public String getName()
+    {
+        return wrappedStore.getName();
+    }
+
+    
+    public Index<String, E> getNdnIndex()
+    {
+        return wrappedStore.getNdnIndex();
+    }
+
+
+    public Index<Long, E> getOneAliasIndex()
+    {
+        return wrappedStore.getOneAliasIndex();
+    }
+
+
+    public Index<Long, E> getOneLevelIndex()
+    {
+        return wrappedStore.getOneLevelIndex();
+    }
+
+
+    public Long getParentId( Long arg0 ) throws Exception
+    {
+        return wrappedStore.getParentId( arg0 );
+    }
+
+
+    public Long getParentId( String dn ) throws Exception
+    {
+        return wrappedStore.getParentId( dn );
+    }
+
+
+    public Index<String, E> getPresenceIndex()
+    {
+        return wrappedStore.getPresenceIndex();
+    }
+
+
+    public String getProperty( String propertyName ) throws Exception
+    {
+        return wrappedStore.getProperty( propertyName );
+    }
+
+
+    public Index<Long, E> getSubAliasIndex()
+    {
+        return wrappedStore.getSubAliasIndex();
+    }
+
+
+    public Index<Long, E> getSubLevelIndex()
+    {
+        return wrappedStore.getSubLevelIndex();
+    }
+
+
+    public Index<?, E> getSystemIndex( String id ) throws IndexNotFoundException
+    {
+        return wrappedStore.getSystemIndex( id );
+    }
+
+
+    public Index<String, E> getUpdnIndex()
+    {
+        return wrappedStore.getUpdnIndex();
+    }
+
+
+
+    public Index<?, E> getUserIndex( String id ) throws IndexNotFoundException
+    {
+        return wrappedStore.getUserIndex( id );
+    }
+
+
+    public Set<Index<?, E>> getUserIndices()
+    {
+        return wrappedStore.getUserIndices();
+    }
+
+
+    public boolean hasSystemIndexOn( String id ) throws Exception
+    {
+        return wrappedStore.hasSystemIndexOn( id );
+    }
+
+
+    public boolean hasUserIndexOn( String id ) throws Exception
+    {
+        return wrappedStore.hasUserIndexOn( id );
+    }
+
+
+    public void initRegistries( Registries registries )
+    {
+        wrappedStore.initRegistries( registries );
+    }
+
+
+    public boolean isInitialized()
+    {
+        return wrappedStore.isInitialized();
+    }
+
+
+    public IndexCursor<Long, E> list( Long id ) throws Exception
+    {
+        return wrappedStore.list( id );
+    }
+
+
+    public ServerEntry lookup( Long id ) throws Exception
+    {
+        return wrappedStore.lookup( id );
+    }
+
+
+    public void setAliasIndex( Index<String, E> index ) throws Exception
+    {
+        wrappedStore.setAliasIndex( index );
+    }
+
+
+    public void setName( String name )
+    {
+        wrappedStore.setName( name );
+    }
+
+
+    public void setNdnIndex( Index<String, E> index ) throws Exception
+    {
+        wrappedStore.setNdnIndex( index );
+    }
+
+
+    public void setOneAliasIndex( Index<Long, E> index ) throws Exception
+    {
+        wrappedStore.setOneAliasIndex( index );
+    }
+
+
+    public void setOneLevelIndex( Index<Long, E> index ) throws Exception
+    {
+        wrappedStore.setOneLevelIndex( index );
+    }
+
+
+    public void setPresenceIndex( Index<String, E> index ) throws Exception
+    {
+        wrappedStore.setPresenceIndex( index );
+    }
+
+
+    public void setProperty( String propertyName, String propertyValue ) throws Exception
+    {
+        wrappedStore.setProperty( propertyName, propertyValue );
+    }
+
+
+    public void setSubAliasIndex( Index<Long, E> index ) throws Exception
+    {
+        wrappedStore.setSubAliasIndex( index );
+    }
+
+
+    public void setSubLevelIndex( Index<Long, E> index ) throws Exception
+    {
+        wrappedStore.setSubLevelIndex( index );
+    }
+
+
+    public void setUpdnIndex( Index<String, E> index ) throws Exception
+    {
+        wrappedStore.setUpdnIndex( index );
+    }
+
+
+    public Iterator<String> systemIndices()
+    {
+        return wrappedStore.systemIndices();
+    }
+
+
+    public Iterator<String> userIndices()
+    {
+        return wrappedStore.userIndices();
+    }
+
+
+    //TODO manage the cache size??
+    public int getCacheSize()
+    {
+        return wrappedStore.getCacheSize();
+    }
+
+
+    public Index<String, E> getEntryCsnIndex()
+    {
+        return wrappedStore.getEntryCsnIndex();
+    }
+
+
+    public Index<byte[], E> getEntryUuidIndex()
+    {
+        return wrappedStore.getEntryUuidIndex();
+    }
+
+
+    public Index<String, E> getObjectClassIndex()
+    {
+        return wrappedStore.getObjectClassIndex();
+    }
+
+
+    public LdapDN getSuffix()
+    {
+        return wrappedStore.getSuffix();
+    }
+
+
+    public String getSuffixDn()
+    {
+        return wrappedStore.getSuffixDn();
+    }
+
+
+    public LdapDN getUpSuffix()
+    {
+        return wrappedStore.getUpSuffix();
+    }
+
+
+    public void setCacheSize( int size )
+    {
+        wrappedStore.setCacheSize( size );
+    }
+
+
+    public void setUserIndices( Set<Index<?, E>> userIndices )
+    {
+        wrappedStore.setUserIndices( userIndices );
+    }
+
+
+    public void setSuffixDn( String suffixDn )
+    {
+        wrappedStore.setSuffixDn( suffixDn );
+    }
+
+
+    public void setEntryCsnIndex( Index<String, E> index ) throws Exception
+    {
+        wrappedStore.setEntryCsnIndex( index );
+    }
+
+    
+    public void setEntryUuidIndex( Index<byte[], E> index ) throws Exception
+    {
+        wrappedStore.setEntryUuidIndex( index );
+    }
+ 
+    
+    public void setObjectClassIndex( Index<String, E> index ) throws Exception
+    {
+        wrappedStore.setObjectClassIndex( index );
+    }
+}



Mime
View raw message