directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r897434 - in /directory/apacheds/trunk: avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ core/src/main/java/org/apache/directory/server/cor...
Date Sat, 09 Jan 2010 12:34:45 GMT
Author: seelmann
Date: Sat Jan  9 12:34:44 2010
New Revision: 897434

URL: http://svn.apache.org/viewvc?rev=897434&view=rev
Log:
o moved remaining classes of package o.a.d.server.core.partition.impl.btree to apacheds-xdbm-base
o removed gui reference in BTreePartition
o moved package o.a.d.server.core.partition.impl.btree.gui to apacheds-xdbm-tools
o added AbstractXdbmPartition class for common code of XDBM partitions (AvlPartition and JdbmPartition)


Added:
    directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
      - copied, changed from r897348, directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
    directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ServerEntryCursorAdaptor.java
      - copied unchanged from r897348, directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ServerEntryCursorAdaptor.java
    directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/
      - copied from r897348, directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/
Removed:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ServerEntryCursorAdaptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/
Modified:
    directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
    directory/apacheds/trunk/xdbm-base/pom.xml

Modified: directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java?rev=897434&r1=897433&r2=897434&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
(original)
+++ directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
Sat Jan  9 12:34:44 2010
@@ -21,24 +21,13 @@
 
 
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
 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.impl.btree.BTreePartition;
 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.AbstractXdbmPartition;
 import org.apache.directory.server.xdbm.search.impl.CursorBuilder;
 import org.apache.directory.server.xdbm.search.impl.DefaultOptimizer;
 import org.apache.directory.server.xdbm.search.impl.DefaultSearchEngine;
@@ -46,7 +35,6 @@
 import org.apache.directory.server.xdbm.search.impl.NoOpOptimizer;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Modification;
-import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -55,28 +43,24 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class AvlPartition extends BTreePartition
+public class AvlPartition extends AbstractXdbmPartition
 {
-    private boolean optimizerEnabled = true;
     private Set<AvlIndex<?, ServerEntry>> indexedAttributes;
 
-    private AvlStore<ServerEntry> store;
-
-
-    // ------------------------------------------------------------------------
-    // C O N S T R U C T O R S
-    // ------------------------------------------------------------------------
 
     /**
      * Creates a store based on AVL Trees.
      */
     public AvlPartition()
     {
-        store = new AvlStore<ServerEntry>();
+        super( new AvlStore<ServerEntry>() );
         indexedAttributes = new HashSet<AvlIndex<?, ServerEntry>>();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void initialize( ) throws Exception
     {
         setSchemaManager( schemaManager );
@@ -106,7 +90,7 @@
         {
             AvlIndex<?, ServerEntry> index;
 
-            if ( obj instanceof AvlIndex )
+            if ( obj instanceof AvlIndex<?, ?> )
             {
                 index = ( AvlIndex<?, ServerEntry> ) obj;
             }
@@ -169,332 +153,15 @@
     }
 
 
-    public final void destroy() throws Exception
-    {
-        store.destroy();
-    }
-
-
-    public final boolean isInitialized()
-    {
-        return store.isInitialized();
-    }
-
-
-    public final void sync() throws Exception
-    {
-        store.sync();
-    }
-
-
-    // ------------------------------------------------------------------------
-    // I N D E X   M E T H O D S
-    // ------------------------------------------------------------------------
-
-    public final void addIndexOn( Index<Long, ServerEntry> index ) throws Exception
-    {
-        store.addIndex( index );
-    }
-
-
-    public Index<String, ServerEntry> getPresenceIndex()
-    {
-        return store.getPresenceIndex();
-    }
-
-
-    public Index<Long, ServerEntry> getSubLevelIndex()
-    {
-        return store.getSubLevelIndex();
-    }
-
-
-    public final Index<String, ServerEntry> getExistenceIndex()
-    {
-        return store.getPresenceIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setPresenceIndexOn( Index<String, ServerEntry> index ) throws
Exception
-    {
-        store.setPresenceIndex( index );
-    }
-
-
-    public final Index<Long, ServerEntry> getOneLevelIndex()
-    {
-        return store.getOneLevelIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setOneLevelIndexOn( Index<Long, ServerEntry> index ) throws Exception
-    {
-        store.setOneLevelIndex( index );
-    }
-
-
-    public final Index<String, ServerEntry> getAliasIndex()
-    {
-        return store.getAliasIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setAliasIndexOn( Index<String, ServerEntry> index ) throws Exception
-    {
-        store.setAliasIndex( index );
-    }
-
-
-    public final Index<Long, ServerEntry> getOneAliasIndex()
-    {
-        return store.getOneAliasIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setOneAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception
-    {
-        store.setOneAliasIndex( ( Index<Long, ServerEntry> ) index );
-    }
-
-
-    public final Index<Long, ServerEntry> getSubAliasIndex()
-    {
-        return store.getSubAliasIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setSubAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception
-    {
-        store.setSubAliasIndex( ( Index<Long, ServerEntry> ) index );
-    }
-
-
-    public final Index<String, ServerEntry> getUpdnIndex()
-    {
-        return store.getUpdnIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setUpdnIndexOn( Index<String, ServerEntry> index ) throws Exception
-    {
-        store.setUpdnIndex( ( Index<String, ServerEntry> ) index );
-    }
-
-
-    public final Index<String, ServerEntry> getNdnIndex()
-    {
-        return store.getNdnIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setNdnIndexOn( Index<String, ServerEntry> index ) throws Exception
-    {
-        store.setNdnIndex( ( Index<String, ServerEntry> ) index );
-    }
-
-
-    public final Iterator<String> getUserIndices()
-    {
-        return store.userIndices();
-    }
-
-
-    public final Iterator<String> getSystemIndices()
-    {
-        return store.systemIndices();
-    }
-
-
-    public final boolean hasUserIndexOn( String id ) throws Exception
-    {
-        return store.hasUserIndexOn( id );
-    }
-
-
-    public final boolean hasSystemIndexOn( String id ) throws Exception
-    {
-        return store.hasSystemIndexOn( id );
-    }
-
-
-    /**
-     * @see org.apache.directory.server.core.partition.impl.btree.BTreePartition#getUserIndex(String)
-     */
-    public final Index<?, ServerEntry> getUserIndex( String id ) throws IndexNotFoundException
-    {
-        return store.getUserIndex( id );
-    }
-
-
-    /**
-     * @see BTreePartition#getEntryId(String)
-     */
-    public final Index<?, ServerEntry> getSystemIndex( String id ) throws IndexNotFoundException
-    {
-        return store.getSystemIndex( id );
-    }
-
-
-    public final Long getEntryId( String dn ) throws Exception
-    {
-        return store.getEntryId( dn );
-    }
-
-
-    public final String getEntryDn( Long id ) throws Exception
-    {
-        return store.getEntryDn( id );
-    }
-
-
-    public final Long getParentId( String dn ) throws Exception
-    {
-        return store.getParentId( dn );
-    }
-
-
-    public final Long getParentId( Long childId ) throws Exception
-    {
-        return store.getParentId( childId );
-    }
-
-
-    public final String getEntryUpdn( Long id ) throws Exception
-    {
-        return store.getEntryUpdn( id );
-    }
-
-
-    public final String getEntryUpdn( String dn ) throws Exception
-    {
-        return store.getEntryUpdn( dn );
-    }
-
-
-    public final int count() throws Exception
-    {
-        return store.count();
-    }
-
-
-    public final void add( AddOperationContext addContext ) throws Exception
-    {
-        store.add( ( ServerEntry ) ( ( ClonedServerEntry ) addContext.getEntry() ).getClonedEntry()
);
-    }
-
-
-    public final void addContextEntry( ServerEntry contextEntry ) throws Exception
-    {
-        store.add( contextEntry );
-    }
-
-
-    public final ClonedServerEntry lookup( Long id ) throws Exception
-    {
-        return new ClonedServerEntry( store.lookup( id ) );
-    }
-
-
-    public final void delete( Long id ) throws Exception
-    {
-        store.delete( id );
-    }
-
-
-    public final IndexCursor<Long, ServerEntry> list( Long id ) throws Exception
-    {
-        return store.list( id );
-    }
-
-
-    public final int getChildCount( Long id ) throws Exception
-    {
-        return store.getChildCount( id );
-    }
-
-
-    public final void setProperty( String propertyName, String propertyValue ) throws Exception
-    {
-        store.setProperty( propertyName, propertyValue );
-    }
-
-
-    public final String getProperty( String propertyName ) throws Exception
-    {
-        return store.getProperty( propertyName );
-    }
-
-    
-    /**
-     * {@inheritDoc}
-     */
-    public final void modify( ModifyOperationContext modifyContext ) throws Exception
-    {
-        store.modify( modifyContext.getDn(), modifyContext.getModItems() );
-    }
-
-    
     /**
      * {@inheritDoc}
      */
     public final void modify( long entryId, List<Modification> modifications ) throws
Exception
     {
-        store.modify( entryId, modifications );
-    }
-
-
-    public final void rename( RenameOperationContext renameContext ) throws Exception
-    {
-        store.rename( renameContext.getDn(), renameContext.getNewRdn(), renameContext.getDelOldDn()
);
+        ((AvlStore<ServerEntry>)store).modify( entryId, modifications );
     }
-
-
-    public final void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext )
throws Exception
-    {
-        store.move( moveAndRenameContext.getDn(), moveAndRenameContext.getParent(), moveAndRenameContext.getNewRdn(),
-            moveAndRenameContext.getDelOldDn() );
-    }
-
-
-    public final void move( MoveOperationContext moveContext ) throws Exception
-    {
-        store.move( moveContext.getDn(), moveContext.getParent() );
-    }
-
-
-    public void bind( BindOperationContext opContext ) throws Exception
-    {
-        throw new UnsupportedOperationException( "bind is not supported at the partition
level" );
-    }
-
-
-    public void unbind( UnbindOperationContext opContext ) throws Exception
-    {
-        throw new UnsupportedOperationException( "unbind is not supported at the partition
level" );
-    }
-
-
+    
+    
     /*
      * TODO requires review 
      * 
@@ -505,7 +172,7 @@
      */
     public AvlStore<ServerEntry> getStore()
     {
-        return store;
+        return (AvlStore<ServerEntry>)store;
     }
     
 }

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=897434&r1=897433&r2=897434&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
(original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
Sat Jan  9 12:34:44 2010
@@ -21,36 +21,19 @@
 
 
 import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
 import java.util.Set;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.constants.ApacheSchemaConstants;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
 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.Partition;
-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.server.xdbm.IndexNotFoundException;
+import org.apache.directory.server.xdbm.AbstractXdbmPartition;
 import org.apache.directory.server.xdbm.search.impl.CursorBuilder;
 import org.apache.directory.server.xdbm.search.impl.DefaultOptimizer;
 import org.apache.directory.server.xdbm.search.impl.DefaultSearchEngine;
 import org.apache.directory.server.xdbm.search.impl.EvaluatorBuilder;
 import org.apache.directory.server.xdbm.search.impl.NoOpOptimizer;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.exception.LdapAuthenticationNotSupportedException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -62,10 +45,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class JdbmPartition extends BTreePartition
+public class JdbmPartition extends AbstractXdbmPartition
 {
-    private JdbmStore<ServerEntry> store;
-    private boolean optimizerEnabled = true;
+    
     
     
     /**
@@ -73,44 +55,10 @@
      */
     public JdbmPartition()
     {
-        store = new JdbmStore<ServerEntry>();
-    }
-
-
-    // ------------------------------------------------------------------------
-    // C O N F I G U R A T I O N   M E T H O D S
-    // ------------------------------------------------------------------------
-
-
-    public boolean isOptimizerEnabled()
-    {
-        return optimizerEnabled;
-    }
-
-
-    public void setOptimizerEnabled( boolean optimizerEnabled )
-    {
-        this.optimizerEnabled = optimizerEnabled;
-    }
-
-
-    public void setSyncOnWrite( boolean syncOnWrite )
-    {
-        store.setSyncOnWrite( syncOnWrite );
-    }
-
-
-    public boolean isSyncOnWrite()
-    {
-        return store.isSyncOnWrite();
+        super( new JdbmStore<ServerEntry>() );
     }
 
 
-    // ------------------------------------------------------------------------
-    // 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 initialize( ) throws Exception
     {
@@ -219,334 +167,6 @@
     }
 
 
-    public final void destroy() throws Exception
-    {
-        store.destroy();
-    }
-
-
-    public final boolean isInitialized()
-    {
-        return store.isInitialized();
-    }
-
-
-    public final void sync() throws Exception
-    {
-        store.sync();
-    }
-
-
-    // ------------------------------------------------------------------------
-    // I N D E X   M E T H O D S
-    // ------------------------------------------------------------------------
-
-
-    public final void addIndexOn( Index<Long, ServerEntry> index ) throws Exception
-    {
-        store.addIndex( index );
-    }
-
-
-    public final Index<String, ServerEntry> getExistenceIndex()
-    {
-        return store.getPresenceIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setPresenceIndexOn( Index<String, ServerEntry> index ) throws
Exception
-    {
-        store.setPresenceIndex( index );
-    }
-
-
-    public final Index<Long, ServerEntry> getOneLevelIndex()
-    {
-        return store.getOneLevelIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setOneLevelIndexOn( Index<Long, ServerEntry> index ) throws Exception
-    {
-        store.setOneLevelIndex( index );
-    }
-
-
-    public final Index<String, ServerEntry> getAliasIndex()
-    {
-        return store.getAliasIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setAliasIndexOn( Index<String, ServerEntry> index ) throws Exception
-    {
-        store.setAliasIndex( index );
-    }
-
-
-    public final Index<Long,ServerEntry> getOneAliasIndex()
-    {
-        return store.getOneAliasIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setOneAliasIndexOn( Index<Long,ServerEntry> index ) throws NamingException
-    {
-        store.setOneAliasIndex( ( Index<Long,ServerEntry> ) index );
-    }
-
-
-    public final Index<Long,ServerEntry> getSubAliasIndex()
-    {
-        return store.getSubAliasIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setSubAliasIndexOn( Index<Long,ServerEntry> index ) throws NamingException
-    {
-            store.setSubAliasIndex( ( Index<Long,ServerEntry> ) index );
-    }
-
-
-    public final Index<String,ServerEntry> getUpdnIndex()
-    {
-        return store.getUpdnIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setUpdnIndexOn( Index<String,ServerEntry> index ) throws NamingException
-    {
-        store.setUpdnIndex( ( Index<String,ServerEntry> ) index );
-    }
-
-
-    public final Index<String,ServerEntry> getNdnIndex()
-    {
-        return store.getNdnIndex();
-    }
-
-
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public final void setNdnIndexOn( Index<String,ServerEntry> index ) throws NamingException
-    {
-        store.setNdnIndex( ( Index<String,ServerEntry> ) index );
-    }
-
-
-    public final Iterator<String> getUserIndices()
-    {
-        return store.userIndices();
-    }
-
-
-    public final Iterator<String> getSystemIndices()
-    {
-        return store.systemIndices();
-    }
-
-
-    public final boolean hasUserIndexOn( String id ) throws NamingException
-    {
-        return store.hasUserIndexOn( id );
-    }
-
-
-    public final boolean hasSystemIndexOn( String id ) throws NamingException
-    {
-        return store.hasSystemIndexOn( id );
-    }
-
-
-    /**
-     * @see org.apache.directory.server.core.partition.impl.btree.BTreePartition#getUserIndex(String)
-     */
-    public final Index<?,ServerEntry> getUserIndex( String id ) throws IndexNotFoundException
-    {
-        return store.getUserIndex( id );
-    }
-
-
-    /**
-     * @see BTreePartition#getEntryId(String)
-     */
-    public final Index<?,ServerEntry> getSystemIndex( String id ) throws IndexNotFoundException
-    {
-        return store.getSystemIndex( id );
-    }
-
-
-    public final Long getEntryId( String dn ) throws Exception
-    {
-        return store.getEntryId( dn );
-    }
-
-
-    public final String getEntryDn( Long id ) throws Exception
-    {
-        return store.getEntryDn( id );
-    }
-
-
-    public final Long getParentId( String dn ) throws Exception
-    {
-        return store.getParentId( dn );
-    }
-
-
-    public final Long getParentId( Long childId ) throws Exception
-    {
-        return store.getParentId( childId );
-    }
-
-
-    public final String getEntryUpdn( Long id ) throws Exception
-    {
-        return store.getEntryUpdn( id );
-    }
-
-
-    public final String getEntryUpdn( String dn ) throws Exception
-    {
-        return store.getEntryUpdn( dn );
-    }
-
-
-    public final int count() throws Exception
-    {
-        return store.count();
-    }
-
-    
-    public final void add( AddOperationContext addContext ) throws Exception
-    {
-        store.add( (ServerEntry)((ClonedServerEntry)addContext.getEntry()).getClonedEntry()
);
-    }
-
-
-    public final ClonedServerEntry lookup( Long id ) throws Exception
-    {
-        return new ClonedServerEntry( store.lookup( id ) );
-    }
-
-
-    public final void delete( Long id ) throws Exception
-    {
-        store.delete( id );
-    }
-
-
-    public final IndexCursor<Long, ServerEntry> list( Long id ) throws Exception
-    {
-        return store.list( id );
-    }
-
-
-    public final int getChildCount( Long id ) throws Exception
-    {
-        return store.getChildCount( id );
-    }
-
-
-    public final void setProperty( String propertyName, String propertyValue ) throws Exception
-    {
-        store.setProperty( propertyName, propertyValue );
-    }
-
-
-    public final String getProperty( String propertyName ) throws Exception
-    {
-        return store.getProperty( propertyName );
-    }
-
-    
-    public final void modify( ModifyOperationContext modifyContext ) throws Exception
-    {
-        store.modify( modifyContext.getDn(), modifyContext.getModItems() );
-    }
-
-    public final void rename( RenameOperationContext renameContext ) throws Exception
-    {
-        store.rename( renameContext.getDn(), renameContext.getNewRdn(), renameContext.getDelOldDn()
);
-    }
-
-
-    public final void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext )
throws Exception
-    {
-        store.move( moveAndRenameContext.getDn(), 
-            moveAndRenameContext.getParent(), 
-            moveAndRenameContext.getNewRdn(), 
-            moveAndRenameContext.getDelOldDn() );
-    }
-
-
-    public final void move( MoveOperationContext moveContext ) throws Exception
-    {
-        store.move( moveContext.getDn(), moveContext.getParent() );
-    }
-
-
-    public final void bind( LdapDN bindDn, byte[] credentials, List<String> mechanisms,
String saslAuthId ) throws Exception
-    {
-        if ( bindDn == null || credentials == null || mechanisms == null ||  saslAuthId ==
null )
-        {
-            // do nothing just using variables to prevent yellow lights : bad :)
-        }
-        
-        // does nothing
-        throw new LdapAuthenticationNotSupportedException(
-                "Bind requests only tunnel down into partitions if there are no authenticators
to handle the mechanism.\n"
-                        + "Check to see if you have correctly configured authenticators for
the server.",
-                ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED );
-    }
-    
-
-    public final void bind( BindOperationContext bindContext ) throws Exception
-    {
-        // does nothing
-        throw new LdapAuthenticationNotSupportedException(
-            "Bind requests only tunnel down into partitions if there are no authenticators
to handle the mechanism.\n"
-                + "Check to see if you have correctly configured authenticators for the server.",
-            ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED );
-    }
-
-
-    public final void unbind( UnbindOperationContext unbindContext ) throws Exception
-    {
-    }
-
-
-    public Index<String, ServerEntry> getPresenceIndex()
-    {
-        return store.getPresenceIndex();
-    }
-
-
-    public Index<Long, ServerEntry> getSubLevelIndex()
-    {
-        return store.getSubLevelIndex();
-    }
-    
-    
     public Index<String, ServerEntry> getObjectClassIndex()
     {
         return store.getObjectClassIndex();
@@ -564,12 +184,4 @@
         return store.getEntryUuidIndex();
     }
 
-    
-    /**
-     * @see Object#toString()
-     */
-    public String toString()
-    {
-        return "Partition<" + id + ">"; 
-    }
 }

Modified: directory/apacheds/trunk/xdbm-base/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/pom.xml?rev=897434&r1=897433&r2=897434&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/pom.xml (original)
+++ directory/apacheds/trunk/xdbm-base/pom.xml Sat Jan  9 12:34:44 2010
@@ -43,7 +43,7 @@
 
     <dependency>
       <groupId>${pom.groupId}</groupId>
-      <artifactId>apacheds-core-entry</artifactId>
+      <artifactId>apacheds-core-api</artifactId>
       <version>${pom.version}</version>
     </dependency>
   </dependencies>

Copied: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
(from r897348, directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?p2=directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java&p1=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java&r1=897348&r2=897434&rev=897434&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
(original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
Sat Jan  9 12:34:44 2010
@@ -45,7 +45,6 @@
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.Partition;
-import org.apache.directory.server.core.partition.impl.btree.gui.PartitionViewer;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.xdbm.search.Optimizer;
@@ -358,13 +357,6 @@
     public abstract boolean isInitialized();
 
 
-    public void inspect() throws Exception
-    {
-        PartitionViewer viewer = new PartitionViewer( this, schemaManager );
-        viewer.execute();
-    }
-
-
     ////////////////////
     // public abstract methods
 

Added: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java?rev=897434&view=auto
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java
(added)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java
Sat Jan  9 12:34:44 2010
@@ -0,0 +1,434 @@
+/*
+ *   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.xdbm;
+
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.directory.server.core.entry.ClonedServerEntry;
+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.impl.btree.BTreePartition;
+import org.apache.directory.shared.ldap.exception.LdapAuthenticationNotSupportedException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.name.LdapDN;
+
+
+/**
+ * Base class for XDBM partitions that use an {@link Store}.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public abstract class AbstractXdbmPartition extends BTreePartition
+{
+
+    protected boolean optimizerEnabled = true;
+
+    /** The store. */
+    protected Store<ServerEntry> store;
+
+
+    protected AbstractXdbmPartition( Store<ServerEntry> store )
+    {
+        this.store = store;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void destroy() throws Exception
+    {
+        store.destroy();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public final boolean isInitialized()
+    {
+        return store.isInitialized();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public final void sync() throws Exception
+    {
+        store.sync();
+    }
+
+
+    // ------------------------------------------------------------------------
+    // C O N F I G U R A T I O N   M E T H O D S
+    // ------------------------------------------------------------------------
+
+    public boolean isOptimizerEnabled()
+    {
+        return optimizerEnabled;
+    }
+
+
+    public void setOptimizerEnabled( boolean optimizerEnabled )
+    {
+        this.optimizerEnabled = optimizerEnabled;
+    }
+
+
+    public void setSyncOnWrite( boolean syncOnWrite )
+    {
+        store.setSyncOnWrite( syncOnWrite );
+    }
+
+
+    public boolean isSyncOnWrite()
+    {
+        return store.isSyncOnWrite();
+    }
+
+
+    // ------------------------------------------------------------------------
+    // I N D E X   M E T H O D S
+    // ------------------------------------------------------------------------
+
+    public final void addIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    {
+        store.addIndex( index );
+    }
+
+
+    public final Index<String, ServerEntry> getExistenceIndex()
+    {
+        return store.getPresenceIndex();
+    }
+
+
+    /**
+     * @org.apache.xbean.Property hidden="true"
+     */
+    public final void setPresenceIndexOn( Index<String, ServerEntry> index ) throws
Exception
+    {
+        store.setPresenceIndex( index );
+    }
+
+
+    public final Index<Long, ServerEntry> getOneLevelIndex()
+    {
+        return store.getOneLevelIndex();
+    }
+
+
+    /**
+     * @org.apache.xbean.Property hidden="true"
+     */
+    public final void setOneLevelIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    {
+        store.setOneLevelIndex( index );
+    }
+
+
+    public final Index<String, ServerEntry> getAliasIndex()
+    {
+        return store.getAliasIndex();
+    }
+
+
+    /**
+     * @org.apache.xbean.Property hidden="true"
+     */
+    public final void setAliasIndexOn( Index<String, ServerEntry> index ) throws Exception
+    {
+        store.setAliasIndex( index );
+    }
+
+
+    public final Index<Long, ServerEntry> getOneAliasIndex()
+    {
+        return store.getOneAliasIndex();
+    }
+
+
+    /**
+     * @org.apache.xbean.Property hidden="true"
+     */
+    public final void setOneAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    {
+        store.setOneAliasIndex( ( Index<Long, ServerEntry> ) index );
+    }
+
+
+    public final Index<Long, ServerEntry> getSubAliasIndex()
+    {
+        return store.getSubAliasIndex();
+    }
+
+
+    /**
+     * @org.apache.xbean.Property hidden="true"
+     */
+    public final void setSubAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    {
+        store.setSubAliasIndex( ( Index<Long, ServerEntry> ) index );
+    }
+
+
+    public final Index<String, ServerEntry> getUpdnIndex()
+    {
+        return store.getUpdnIndex();
+    }
+
+
+    /**
+     * @org.apache.xbean.Property hidden="true"
+     */
+    public final void setUpdnIndexOn( Index<String, ServerEntry> index ) throws Exception
+    {
+        store.setUpdnIndex( ( Index<String, ServerEntry> ) index );
+    }
+
+
+    public final Index<String, ServerEntry> getNdnIndex()
+    {
+        return store.getNdnIndex();
+    }
+
+
+    /**
+     * @org.apache.xbean.Property hidden="true"
+     */
+    public final void setNdnIndexOn( Index<String, ServerEntry> index ) throws Exception
+    {
+        store.setNdnIndex( ( Index<String, ServerEntry> ) index );
+    }
+
+
+    public final Iterator<String> getUserIndices()
+    {
+        return store.userIndices();
+    }
+
+
+    public final Iterator<String> getSystemIndices()
+    {
+        return store.systemIndices();
+    }
+
+
+    public final boolean hasUserIndexOn( String id ) throws Exception
+    {
+        return store.hasUserIndexOn( id );
+    }
+
+
+    public final boolean hasSystemIndexOn( String id ) throws Exception
+    {
+        return store.hasSystemIndexOn( id );
+    }
+
+
+    /**
+     * @see org.apache.directory.server.core.partition.impl.btree.BTreePartition#getUserIndex(String)
+     */
+    public final Index<?, ServerEntry> getUserIndex( String id ) throws IndexNotFoundException
+    {
+        return store.getUserIndex( id );
+    }
+
+
+    /**
+     * @see BTreePartition#getEntryId(String)
+     */
+    public final Index<?, ServerEntry> getSystemIndex( String id ) throws IndexNotFoundException
+    {
+        return store.getSystemIndex( id );
+    }
+
+
+    public final Long getEntryId( String dn ) throws Exception
+    {
+        return store.getEntryId( dn );
+    }
+
+
+    public final String getEntryDn( Long id ) throws Exception
+    {
+        return store.getEntryDn( id );
+    }
+
+
+    public final Long getParentId( String dn ) throws Exception
+    {
+        return store.getParentId( dn );
+    }
+
+
+    public final Long getParentId( Long childId ) throws Exception
+    {
+        return store.getParentId( childId );
+    }
+
+
+    public final String getEntryUpdn( Long id ) throws Exception
+    {
+        return store.getEntryUpdn( id );
+    }
+
+
+    public final String getEntryUpdn( String dn ) throws Exception
+    {
+        return store.getEntryUpdn( dn );
+    }
+
+
+    public final int count() throws Exception
+    {
+        return store.count();
+    }
+
+
+    public final void add( AddOperationContext addContext ) throws Exception
+    {
+        store.add( ( ServerEntry ) ( ( ClonedServerEntry ) addContext.getEntry() ).getClonedEntry()
);
+    }
+
+
+    public final ClonedServerEntry lookup( Long id ) throws Exception
+    {
+        return new ClonedServerEntry( store.lookup( id ) );
+    }
+
+
+    public final void delete( Long id ) throws Exception
+    {
+        store.delete( id );
+    }
+
+
+    public final IndexCursor<Long, ServerEntry> list( Long id ) throws Exception
+    {
+        return store.list( id );
+    }
+
+
+    public final int getChildCount( Long id ) throws Exception
+    {
+        return store.getChildCount( id );
+    }
+
+
+    public final void setProperty( String propertyName, String propertyValue ) throws Exception
+    {
+        store.setProperty( propertyName, propertyValue );
+    }
+
+
+    public final String getProperty( String propertyName ) throws Exception
+    {
+        return store.getProperty( propertyName );
+    }
+
+
+    public final void modify( ModifyOperationContext modifyContext ) throws Exception
+    {
+        store.modify( modifyContext.getDn(), modifyContext.getModItems() );
+    }
+
+
+    public final void rename( RenameOperationContext renameContext ) throws Exception
+    {
+        store.rename( renameContext.getDn(), renameContext.getNewRdn(), renameContext.getDelOldDn()
);
+    }
+
+
+    public final void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext )
throws Exception
+    {
+        store.move( moveAndRenameContext.getDn(), moveAndRenameContext.getParent(), moveAndRenameContext.getNewRdn(),
+            moveAndRenameContext.getDelOldDn() );
+    }
+
+
+    public final void move( MoveOperationContext moveContext ) throws Exception
+    {
+        store.move( moveContext.getDn(), moveContext.getParent() );
+    }
+
+
+    public final void bind( LdapDN bindDn, byte[] credentials, List<String> mechanisms,
String saslAuthId )
+        throws Exception
+    {
+        if ( bindDn == null || credentials == null || mechanisms == null || saslAuthId ==
null )
+        {
+            // do nothing just using variables to prevent yellow lights : bad :)
+        }
+
+        // does nothing
+        throw new LdapAuthenticationNotSupportedException(
+            "Bind requests only tunnel down into partitions if there are no authenticators
to handle the mechanism.\n"
+                + "Check to see if you have correctly configured authenticators for the server.",
+            ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED );
+    }
+
+
+    public final void bind( BindOperationContext bindContext ) throws Exception
+    {
+        // does nothing
+        throw new LdapAuthenticationNotSupportedException(
+            "Bind requests only tunnel down into partitions if there are no authenticators
to handle the mechanism.\n"
+                + "Check to see if you have correctly configured authenticators for the server.",
+            ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED );
+    }
+
+
+    public final void unbind( UnbindOperationContext unbindContext ) throws Exception
+    {
+    }
+
+
+    public final Index<String, ServerEntry> getPresenceIndex()
+    {
+        return store.getPresenceIndex();
+    }
+
+
+    public final Index<Long, ServerEntry> getSubLevelIndex()
+    {
+        return store.getSubLevelIndex();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        return "Partition<" + id + ">";
+    }
+
+}



Mime
View raw message