directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r940279 - in /directory/apacheds/trunk: avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-store/src/test/java/org/apache/dir...
Date Sun, 02 May 2010 18:00:48 GMT
Author: seelmann
Date: Sun May  2 18:00:47 2010
New Revision: 940279

URL: http://svn.apache.org/viewvc?rev=940279&view=rev
Log:
o make it possible to derive the ID from the entry itself (e.g. by using the entryUUID)
o fixed some typos in javadoc

Modified:
    directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlMasterTable.java
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
    directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
    directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/MasterTable.java

Modified: directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlMasterTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlMasterTable.java?rev=940279&r1=940278&r2=940279&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlMasterTable.java
(original)
+++ directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlMasterTable.java
Sun May  2 18:00:47 2010
@@ -53,12 +53,12 @@ public class AvlMasterTable<E> extends A
     }
 
 
-    public Long getCurrentId() throws Exception
+    public Long getCurrentId( E entry ) throws Exception
     {
         return counter.longValue();
     }
 
-    public Long getNextId() throws Exception
+    public Long getNextId( E entry ) throws Exception
     {
         return counter.incrementAndGet();
     }

Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java?rev=940279&r1=940278&r2=940279&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
Sun May  2 18:00:47 2010
@@ -183,7 +183,7 @@ public class JdbmMasterTable<E> extends 
     }
 
 
-    public Long getCurrentId() throws Exception
+    public Long getCurrentId( E entry ) throws Exception
     {
         Long id;
 
@@ -206,7 +206,7 @@ public class JdbmMasterTable<E> extends 
      * @throws Exception if the admin table storing sequences cannot be
      *                         read and written to.
      */
-    public Long getNextId() throws Exception
+    public Long getNextId( E entry ) throws Exception
     {
         Long nextVal;
         Long lastVal;

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java?rev=940279&r1=940278&r2=940279&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
Sun May  2 18:00:47 2010
@@ -143,14 +143,14 @@ public class JdbmMasterTableTest
         assertNull( table.get( 0L ) );
         assertEquals( 0, table.count() );
 
-        assertEquals( 0, ( long ) table.getCurrentId() );
-        assertEquals( 1, ( long ) table.getNextId() );
-        assertEquals( 1, ( long ) table.getCurrentId() );
+        assertEquals( 0, ( long ) table.getCurrentId( null ) );
+        assertEquals( 1, ( long ) table.getNextId( null ) );
+        assertEquals( 1, ( long ) table.getCurrentId( null ) );
         assertEquals( 0, table.count() );
 
-        assertEquals( 1, ( long ) table.getCurrentId() );
-        assertEquals( 2, ( long ) table.getNextId() );
-        assertEquals( 2, ( long ) table.getCurrentId() );
+        assertEquals( 1, ( long ) table.getCurrentId( null ) );
+        assertEquals( 2, ( long ) table.getNextId( null ) );
+        assertEquals( 2, ( long ) table.getCurrentId( null ) );
 
         assertNull( table.getProperty( "foo" ) );
         table.setProperty( "foo", "bar" );

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=940279&r1=940278&r2=940279&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
(original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
Sun May  2 18:00:47 2010
@@ -369,9 +369,9 @@ public abstract class AbstractStore<E, I
 
 
     /**
-     * Gets the root ID of this store implementation.
+     * Gets the suffix ID of this store implementation.
      *
-     * @return the root ID
+     * @return the suffix ID
      */
     protected ID getSuffixId() throws Exception
     {
@@ -774,7 +774,7 @@ public abstract class AbstractStore<E, I
         }
 
         ID parentId;
-        ID id = master.getNextId();
+        ID id = master.getNextId( entry );
 
         //
         // Suffix entry cannot have a parent since it is the root so it is 

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/MasterTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/MasterTable.java?rev=940279&r1=940278&r2=940279&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/MasterTable.java
(original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/MasterTable.java
Sun May  2 18:00:47 2010
@@ -38,8 +38,8 @@ public interface MasterTable<ID, E> exte
     /**
      * Gets an entry from this MasterTable.
      *
-     * @param id the BigInteger id of the entry to retrieve.
-     * @return the entry with operational attributes and all.
+     * @param id the id of the entry to retrieve.
+     * @return the entry with all user and operational attributes.
      * @throws Exception if there is a read error on the underlying Db.
      */
     E get( ID id ) throws Exception;
@@ -70,24 +70,26 @@ public interface MasterTable<ID, E> exte
      * Gets the value of the id sequence from this MasterTable's sequence
      * without affecting the value.
      *
+     * @param entry the entry in case the id is derived from the entry.
+     * @return the current value of this MasterTable's sequence
      * @throws Exception if the admin table storing sequences cannot be read
      */
-    ID getCurrentId() throws Exception;
+    ID getCurrentId(  E entry  ) throws Exception;
 
 
     /**
      * Gets the next value from the sequence of this MasterTable.  This has
-     * the side-effect of incrementing the sequence values perminantly.
+     * the side-effect of incrementing the sequence values permanently.
      *
-     * @return the current value of this MasterTable's sequence incremented
-     * by one
+     * @param entry the entry in case the id is derived from the entry.
+     * @return the current value of this MasterTable's sequence incremented by one
      * @throws Exception on failure to update the id sequence
      */
-    ID getNextId() throws Exception;
+    ID getNextId( E entry ) throws Exception;
 
 
     /**
-     * Gets a persistant property associated with this MasterTable.
+     * Gets a persistent property associated with this MasterTable.
      *
      * @param property the key of the property to get the value of
      * @return the value of the property
@@ -97,7 +99,7 @@ public interface MasterTable<ID, E> exte
 
 
     /**
-     * Sets a persistant property associated with this MasterTable.
+     * Sets a persistent property associated with this MasterTable.
      *
      * @param property the key of the property to set the value of
      * @param value the value of the property



Mime
View raw message