directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r613465 [1/2] - in /directory/sandbox/akarasulu/bigbang/apacheds: btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ core-cursor/src/main/java/org/apache/directory/server/core/cursor/ core-cursor/src/test/java/o...
Date Sat, 19 Jan 2008 21:49:28 GMT
Author: akarasulu
Date: Sat Jan 19 13:49:26 2008
New Revision: 613465

URL: http://svn.apache.org/viewvc?rev=613465&view=rev
Log:
making interfaces throw Exception instead of IOException
also setup MasterTable to be parameterized so we can swap out what we store
inside it easier better etc.

Modified:
    directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultTupleComparator.java
    directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java
    directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java
    directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertionEnumeration.java
    directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/MasterTable.java
    directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java
    directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/Cursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/CursorClosedException.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/CursorState.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/EmptyCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/InconsistentCursorStateException.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/InvalidCursorPositionException.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/IteratorCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/ListCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/SingletonCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/test/java/org/apache/directory/server/core/cursor/ListCursorTest.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDupsCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmNoDupsCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/SameKeyTupleCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyCursorTest.java

Modified: directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultTupleComparator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultTupleComparator.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultTupleComparator.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultTupleComparator.java Sat Jan 19 13:49:26 2008
@@ -42,13 +42,13 @@
     }
 
 
-    public SerializableComparator getKeyComparator()
+    public SerializableComparator<K> getKeyComparator()
     {
         return keyComparator;
     }
 
 
-    public SerializableComparator getValueComparator()
+    public SerializableComparator<V> getValueComparator()
     {
         return valueComparator;
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java Sat Jan 19 13:49:26 2008
@@ -21,7 +21,6 @@
 
 
 import java.io.File;
-import java.io.IOException;
 
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.server.core.cursor.Cursor;
@@ -115,18 +114,18 @@
      *
      * @param attrVal the user provided value to normalize
      * @return the normalized value.
-     * @throws IOException if something goes wrong.
+     * @throws Exception if something goes wrong.
      */
-    K getNormalized( K attrVal ) throws IOException;
+    K getNormalized( K attrVal ) throws Exception;
 
 
     /**
      * Gets the total scan count for this index.
      *
      * @return the number of key/value pairs in this index
-     * @throws IOException on failure to access index db files
+     * @throws Exception on failure to access index db files
      */
-    int count() throws IOException;
+    int count() throws Exception;
 
 
     /**
@@ -135,46 +134,46 @@
      *
      * @param attrVal the value of the attribute to get a scan count for
      * @return the number of key/value pairs in this index with the value value
-     * @throws IOException on failure to access index db files
+     * @throws Exception on failure to access index db files
      */
-    int count( K attrVal ) throws IOException;
+    int count( K attrVal ) throws Exception;
 
 
-    int greaterThanCount( K attrVal ) throws IOException;
+    int greaterThanCount( K attrVal ) throws Exception;
 
 
-    int lessThanCount( K attrVal ) throws IOException;
+    int lessThanCount( K attrVal ) throws Exception;
 
 
-    Long forwardLookup( K attrVal ) throws IOException;
+    Long forwardLookup( K attrVal ) throws Exception;
 
 
-    K reverseLookup( Long id ) throws IOException;
+    K reverseLookup( Long id ) throws Exception;
 
 
-    void add( K attrVal, Long id ) throws IOException;
+    void add( K attrVal, Long id ) throws Exception;
 
 
-    void drop( Long id ) throws IOException;
+    void drop( Long id ) throws Exception;
 
 
-    void drop( K attrVal, Long id ) throws IOException;
+    void drop( K attrVal, Long id ) throws Exception;
 
 
-    Cursor<IndexRecord> reverseCursor() throws IOException;
+    Cursor<IndexRecord> reverseCursor() throws Exception;
 
 
-    Cursor<IndexRecord> cursor() throws IOException;
+    Cursor<IndexRecord> cursor() throws Exception;
 
 
-    boolean hasValue( K attrVal, Long id ) throws IOException;
+    boolean hasValue( K attrVal, Long id ) throws Exception;
 
 
-    boolean hasValue( K attrVal, Long id, boolean isGreaterThan ) throws IOException;
+    boolean hasValue( K attrVal, Long id, boolean isGreaterThan ) throws Exception;
 
 
-    void close() throws IOException;
+    void close() throws Exception;
 
 
-    void sync() throws IOException;
+    void sync() throws Exception;
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java Sat Jan 19 13:49:26 2008
@@ -45,5 +45,5 @@
      * @throws NamingException if their are failures while asserting the 
      * condition
      */
-    boolean assertCandidate( IndexRecord record ) throws NamingException;
+    boolean assertCandidate( IndexRecord record ) throws Exception;
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertionEnumeration.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertionEnumeration.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertionEnumeration.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertionEnumeration.java Sat Jan 19 13:49:26 2008
@@ -160,36 +160,45 @@
             rec = underlying.next();
 
             // If value is valid then we set it as the next candidate to return
-            if ( assertion.assertCandidate( rec ) )
+            try
             {
-                if ( checkDups )
+                if ( assertion.assertCandidate( rec ) )
                 {
-                    boolean dup = candidates.containsKey( rec.getEntryId() );
-
-                    if ( dup )
-                    {
-                        /*
-                         * Dup checking is on and candidate is a duplicate that
-                         * has already been seen so we need to skip it.
-                         */
-                        continue;
-                    }
-                    else
+                    if ( checkDups )
                     {
-                        /*
-                         * Dup checking is on and the candidate is not in the 
-                         * dup LUT so we need to set it as the next to return 
-                         * and add it to the LUT in case we encounter it another
-                         * time.
-                         */
-                        prefetched.copy( rec );
-                        candidates.put( rec.getEntryId(), rec.getEntryId() );
-                        return;
+                        boolean dup = candidates.containsKey( rec.getEntryId() );
+
+                        if ( dup )
+                        {
+                            /*
+                             * Dup checking is on and candidate is a duplicate that
+                             * has already been seen so we need to skip it.
+                             */
+                            continue;
+                        }
+                        else
+                        {
+                            /*
+                             * Dup checking is on and the candidate is not in the
+                             * dup LUT so we need to set it as the next to return
+                             * and add it to the LUT in case we encounter it another
+                             * time.
+                             */
+                            prefetched.copy( rec );
+                            candidates.put( rec.getEntryId(), rec.getEntryId() );
+                            return;
+                        }
                     }
-                }
 
-                prefetched.copy( rec );
-                return;
+                    prefetched.copy( rec );
+                    return;
+                }
+            }
+            catch ( Exception e )
+            {
+                NamingException ne = new NamingException();
+                ne.setRootCause( e );
+                throw ne;
             }
         }
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/MasterTable.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/MasterTable.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/MasterTable.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/MasterTable.java Sat Jan 19 13:49:26 2008
@@ -20,20 +20,15 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-import java.io.IOException;
-
-
 /**
- * The master table used to store the Attributes of entries.
+ * A master table used to store indexible entries.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface MasterTable extends Table
+public interface MasterTable<E> extends Table<Long, E>
 {
-    /** the name of the dbf file for this table */
+    /** the base name for the db file for this table */
     String DBF = "master";
 
     /** the sequence key - stores last sequence value in the admin table */
@@ -41,76 +36,74 @@
 
 
     /**
-     * Gets the Attributes of an entry from this MasterTable.
+     * Gets an entry from this MasterTable.
      *
      * @param id the BigInteger id of the entry to retrieve.
-     * @return the Attributes of the entry with operational attributes and all.
-     * @throws NamingException if there is a read error on the underlying Db.
+     * @return the entry with operational attributes and all.
+     * @throws Exception if there is a read error on the underlying Db.
      */
-    Attributes get( Object id ) throws IOException;
+    E get( Long id ) throws Exception;
 
 
     /**
-     * Puts the Attributes of an entry into this master table at an index 
-     * specified by id.  Used both to create new entries and update existing 
-     * ones.
+     * Puts an entry into this MasterTable with a specified unique id.  Used
+     * both to create new entries and update existing ones.
      *
-     * @param entry the Attributes of entry w/ operational attributes
-     * @param id the BigInteger id of the entry to put
-     * @return the newly created entry's Attributes
-     * @throws NamingException if there is a write error on the underlying Db.
+     * @param entry the entry to add
+     * @param id unique identifier of the entry to put
+     * @return the newly created entry
+     * @throws Exception if there is a write error on the underlying Db.
      */
-    Attributes put( Attributes entry, Object id ) throws IOException;
+    E put( Long id, E entry ) throws Exception;
 
 
     /**
-     * Deletes a entry from the master table at an index specified by id.
+     * Deletes a entry from this MasterTable at an index specified by id.
      *
-     * @param id the BigInteger id of the entry to delete
-     * @return the Attributes of the deleted entry
-     * @throws NamingException if there is a write error on the underlying Db
+     * @param id unique identifier of the entry to delete
+     * @return the deleted entry
+     * @throws Exception if there is a write error on the underlying Db
      */
-    Attributes delete( Object id ) throws IOException;
+    E delete( Long id ) throws Exception;
 
 
     /**
-     * Get's the current id value from this master database's sequence without
-     * affecting the seq.
+     * Gets the value of the id sequence from this MasterTable's sequence
+     * without affecting the value.
      *
-     * @return the current value.
-     * @throws NamingException if the admin table storing sequences cannot be
-     * read.
+     * @return the current value
+     * @throws Exception if the admin table storing sequences cannot be read
      */
-    Object getCurrentId() throws IOException;
+    Long getCurrentId() throws Exception;
 
 
     /**
-     * Get's the next value from this SequenceBDb.  This has the side-effect of
-     * changing the current sequence values perminantly in memory and on disk.
+     * Gets the next value from the sequence of this MasterTable.  This has
+     * the side-effect of incrementing the sequence values perminantly.
      *
-     * @return the current value incremented by one.
-     * @throws NamingException if the admin table storing sequences cannot be
-     * read and writen to.
+     * @return the current value of this MasterTable's sequence incremented
+     * by one
+     * @throws Exception on failure to update the id sequence
      */
-    Object getNextId() throws IOException;
+    Long getNextId() throws Exception;
 
 
     /**
-     * Gets a persistant property stored in the admin table of this MasterTable.
+     * Gets a persistant property associated with this MasterTable.
      *
      * @param property the key of the property to get the value of
      * @return the value of the property
-     * @throws NamingException when the underlying admin table cannot be read
+     * @throws Exception on failure to read the property
      */
-    String getProperty( String property ) throws IOException;
+    String getProperty( String property ) throws Exception;
 
 
     /**
-     * Sets a persistant property stored in the admin table of this MasterTable.
+     * Sets a persistant property associated with this MasterTable.
      *
      * @param property the key of the property to set the value of
      * @param value the value of the property
-     * @throws NamingException when the underlying admin table cannot be writen
+     * @throws Exception on failure to write the property
      */
-    void setProperty( String property, String value ) throws IOException;
+    void setProperty( String property, String value ) throws Exception;
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java Sat Jan 19 13:49:26 2008
@@ -22,8 +22,6 @@
 
 import org.apache.directory.server.core.cursor.Cursor;
 
-import java.io.IOException;
-
 
 /**
  * A wrapper interface around BTree implementations used to abstract away
@@ -105,9 +103,9 @@
      *
      * @param key the Object of the key to check for
      * @return true if the key exists, false otherwise
-     * @throws IOException if there is a failure to read the underlying Db
+     * @throws Exception if there is a failure to read the underlying Db
      */
-    boolean has( K key ) throws IOException;
+    boolean has( K key ) throws Exception;
 
 
     /**
@@ -116,9 +114,9 @@
      * @param key the key to check for
      * @param value the value to check for
      * @return true if a record with the key and value exists, false otherwise
-     * @throws IOException if there is a failure to read the underlying Db
+     * @throws Exception if there is a failure to read the underlying Db
      */
-    boolean has( K key, V value ) throws IOException;
+    boolean has( K key, V value ) throws Exception;
 
 
     /**
@@ -131,9 +129,9 @@
      * @param isGreaterThan boolean for greater than or less then comparison
      * @return true if a record with a key greater/less than the key argument
      * exists, false otherwise
-     * @throws IOException if there is a failure to read the underlying Db
+     * @throws Exception if there is a failure to read the underlying Db
      */
-    boolean has( K key, boolean isGreaterThan ) throws IOException;
+    boolean has( K key, boolean isGreaterThan ) throws Exception;
 
 
     /**
@@ -153,11 +151,11 @@
      * @param isGreaterThan boolean for greater than or less then comparison
      * @return true if a record with a key greater/less than the key argument
      * exists, false otherwise
-     * @throws IOException if there is a failure to read the underlying Db
+     * @throws Exception if there is a failure to read the underlying Db
      * or if the underlying Db is not of the Btree type that allows sorted
      * duplicate values.
      */
-    boolean has( K key, V val, boolean isGreaterThan ) throws IOException;
+    boolean has( K key, V val, boolean isGreaterThan ) throws Exception;
 
 
     // ------------------------------------------------------------------------
@@ -174,9 +172,9 @@
      * @param key the key of the record
      * @return the value of the record with the specified key if key exists or
      * null if no such key exists.
-     * @throws IOException if there is a failure to read the underlying Db
+     * @throws Exception if there is a failure to read the underlying Db
      */
-    V get( K key ) throws IOException;
+    V get( K key ) throws Exception;
 
 
     /**
@@ -187,11 +185,11 @@
      * @param value the value of the record.
      * @return the last value present for the key or null if the key did not
      * exist before.
-     * @throws IOException if there is a failure to read or write to
-     * the underlying Db
+     * @throws Exception if there is a failure to read or write to the
+     * underlying Db
      * @throws IllegalArgumentException if a null key or value is used
      */
-    V put( K key, V value ) throws IOException;
+    V put( K key, V value ) throws Exception;
 
 
     /**
@@ -199,10 +197,10 @@
      *
      * @param key the key of the records to remove
      * @return the removed object or null if one did not exist for the key
-     * @throws IOException if there is a failure to read or write to
+     * @throws Exception if there is a failure to read or write to
      * the underlying Db
      */
-    V remove( K key ) throws IOException;
+    V remove( K key ) throws Exception;
 
 
     /**
@@ -212,19 +210,19 @@
      * @param key the key of the record to remove
      * @param value the value of the record to remove
      * @return the removed value object or null if one did not exist
-     * @throws IOException if there is a failure to read or write to
+     * @throws Exception if there is a failure to read or write to
      * the underlying Db
      */
-    V remove( K key, V value ) throws IOException;
+    V remove( K key, V value ) throws Exception;
 
 
     /**
      * Creates a Cursor that traverses records in a Table.
      *
      * @return a Cursor over Tuples containing the key value pairs
-     * @throws IOException if there are failures accessing underlying stores
+     * @throws Exception if there are failures accessing underlying stores
      */
-    Cursor<Tuple<K,V>> cursor() throws IOException;
+    Cursor<Tuple<K,V>> cursor() throws Exception;
 
 
     // ------------------------------------------------------------------------
@@ -236,9 +234,9 @@
      * Gets the count of the number of records in this Table.
      *
      * @return the number of records
-     * @throws IOException if there is a failure to read the underlying Db
+     * @throws Exception if there is a failure to read the underlying Db
      */
-    int count() throws IOException;
+    int count() throws Exception;
 
 
     /**
@@ -247,9 +245,9 @@
      *
      * @param key the Object key to count.
      * @return the number of duplicate records for a key.
-     * @throws IOException if there is a failure to read the underlying Db
+     * @throws Exception if there is a failure to read the underlying Db
      */
-    int count( K key ) throws IOException;
+    int count( K key ) throws Exception;
 
 
     /**
@@ -259,9 +257,9 @@
      *
      * @param key the key to use in comparisons
      * @return the number of keys greater than or equal to the key
-     * @throws IOException if there is a failure to read the underlying db
+     * @throws Exception if there is a failure to read the underlying db
      */
-    int greaterThanCount( K key ) throws IOException;
+    int greaterThanCount( K key ) throws Exception;
 
 
     /**
@@ -271,15 +269,15 @@
      *
      * @param key the key to use in comparisons
      * @return the number of keys less than or equal to the key
-     * @throws IOException if there is a failure to read the underlying db
+     * @throws Exception if there is a failure to read the underlying db
      */
-    int lessThanCount( K key ) throws IOException;
+    int lessThanCount( K key ) throws Exception;
 
 
     /**
      * Closes the underlying Db of this Table.
      *
-     * @throws IOException on any failures
+     * @throws Exception on any failures
      */
-    void close() throws IOException;
+    void close() throws Exception;
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java Sat Jan 19 13:49:26 2008
@@ -24,7 +24,6 @@
 import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.NotImplementedException;
 
-import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
 
@@ -35,19 +34,19 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ValueArrayCursor implements Cursor<Tuple>
+public class ValueArrayCursor<K,V> implements Cursor<Tuple>
 {
     private static final int BEFORE_FIRST = -1;
 
-    private final Object key;
-    private final List<Object> values;
-    private final Tuple tuple = new Tuple();
+    private final K key;
+    private final List<V> values;
+    private final Tuple<K,V> tuple = new Tuple<K,V>();
 
     private boolean closed;
     private int pos = BEFORE_FIRST;
 
 
-    public ValueArrayCursor( final Object key, final Object[] values )
+    public ValueArrayCursor( final K key, final V[] values )
     {
         this.key = key;
         this.tuple.setKey( key );
@@ -55,7 +54,7 @@
     }
 
 
-    public ValueArrayCursor( final Object key, final List<Object> values )
+    public ValueArrayCursor( final K key, final List<V> values )
     {
         this.key = key;
         this.tuple.setKey( key );
@@ -63,7 +62,7 @@
     }
 
 
-    protected void checkClosed( String operation ) throws IOException
+    protected void checkClosed( String operation ) throws Exception
     {
         if ( closed )
         {
@@ -79,33 +78,33 @@
     }
 
 
-    public void before( Tuple element ) throws IOException
+    public void before( Tuple element ) throws Exception
     {
         throw new NotImplementedException();
     }
 
 
-    public void after( Tuple element ) throws IOException
+    public void after( Tuple element ) throws Exception
     {
         throw new NotImplementedException();
     }
 
 
-    public void beforeFirst() throws IOException
+    public void beforeFirst() throws Exception
     {
         checkClosed( "beforeFirst()" );
         pos = BEFORE_FIRST;
     }
 
 
-    public void afterLast() throws IOException
+    public void afterLast() throws Exception
     {
         checkClosed( "afterLast()" );
         pos = values.size();
     }
 
 
-    public boolean absolute( int absolutePosition ) throws IOException
+    public boolean absolute( int absolutePosition ) throws Exception
     {
         checkClosed( "absolute()" );
         if ( absolutePosition >= values.size() )
@@ -125,7 +124,7 @@
     }
 
 
-    public boolean relative( int relativePosition ) throws IOException
+    public boolean relative( int relativePosition ) throws Exception
     {
         checkClosed( "relative()" );
         if ( ( relativePosition + pos ) >= values.size() )
@@ -145,7 +144,7 @@
     }
 
 
-    public boolean first() throws IOException
+    public boolean first() throws Exception
     {
         checkClosed( "first()" );
         pos = 0;
@@ -153,7 +152,7 @@
     }
 
 
-    public boolean last() throws IOException
+    public boolean last() throws Exception
     {
         checkClosed( "last()" );
         pos = values.size() - 1;
@@ -161,41 +160,41 @@
     }
 
 
-    public boolean isFirst() throws IOException
+    public boolean isFirst() throws Exception
     {
         checkClosed( "isFirst()" );
         return pos == 0;
     }
 
 
-    public boolean isLast() throws IOException
+    public boolean isLast() throws Exception
     {
         checkClosed( "isLast()" );
         return pos == values.size() - 1;
     }
 
 
-    public boolean isAfterLast() throws IOException
+    public boolean isAfterLast() throws Exception
     {
         checkClosed( "isAfterLast()" );
         return pos == values.size();
     }
 
 
-    public boolean isBeforeFirst() throws IOException
+    public boolean isBeforeFirst() throws Exception
     {
         checkClosed( "isBeforeFirst()" );
         return pos == BEFORE_FIRST;
     }
 
 
-    public boolean isClosed() throws IOException
+    public boolean isClosed() throws Exception
     {
         return closed;
     }
 
 
-    public boolean previous() throws IOException
+    public boolean previous() throws Exception
     {
         checkClosed( "previous()" );
         if ( pos <= BEFORE_FIRST )
@@ -214,7 +213,7 @@
     }
 
 
-    public boolean next() throws IOException
+    public boolean next() throws Exception
     {
         checkClosed( "next()" );
         if ( pos >= values.size() )
@@ -227,7 +226,7 @@
     }
 
 
-    public Tuple get() throws IOException
+    public Tuple get() throws Exception
     {
         checkClosed( "get()" );
         if ( inRangeOnValue() )
@@ -246,7 +245,7 @@
     }
 
 
-    public void close() throws IOException
+    public void close() throws Exception
     {
         closed = true;
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/Cursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/Cursor.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/Cursor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/Cursor.java Sat Jan 19 13:49:26 2008
@@ -19,9 +19,6 @@
 package org.apache.directory.server.core.cursor;
 
 
-import java.io.IOException;
-
-
 /**
  * A Cursor for bidirectional traversal over elements in a dataset. Cursors
  * unlike Iterators or Enumerations may advance to an element by calling
@@ -62,10 +59,10 @@
      * in the dataset are greater than the argument.
      *
      * @param element the element to be positioned before
-     * @throws IOException with problems accessing the underlying btree
+     * @throws Exception with problems accessing the underlying btree
      * @throws UnsupportedOperationException if this method is not supported
      */
-    void before( E element ) throws IOException;
+    void before( E element ) throws Exception;
 
 
     /**
@@ -80,31 +77,31 @@
      * and all elements in the dataset are greater than the argument.
      *
      * @param element the element to be positioned after
-     * @throws IOException if there are problems positioning this cursor or if
+     * @throws Exception if there are problems positioning this cursor or if
      * this Cursor is closed
      * @throws UnsupportedOperationException if this method is not supported
      */
-    void after( E element ) throws IOException;
+    void after( E element ) throws Exception;
 
 
     /**
      * Positions this Curser before the first element.
      *
-     * @throws IOException if there are problems positioning this cursor or if
+     * @throws Exception if there are problems positioning this cursor or if
      * this Cursor is closed
      * @throws UnsupportedOperationException if this method is not supported
      */
-    void beforeFirst() throws IOException;
+    void beforeFirst() throws Exception;
 
 
     /**
      * Positions this Curser after the last element.
      *
-     * @throws IOException if there are problems positioning this Cursor or if
+     * @throws Exception if there are problems positioning this Cursor or if
      * this Cursor is closed
      * @throws UnsupportedOperationException if this method is not supported
      */
-    void afterLast() throws IOException;
+    void afterLast() throws Exception;
 
 
     /**
@@ -112,11 +109,11 @@
      *
      * @return true if the position has been successfully changed to the first
      * element, false otherwise
-     * @throws IOException if there are problems positioning this Cursor or if
+     * @throws Exception if there are problems positioning this Cursor or if
      * this Cursor is closed
      * @throws UnsupportedOperationException if this method is not supported
      */
-    boolean first() throws IOException;
+    boolean first() throws Exception;
 
 
     /**
@@ -124,11 +121,11 @@
      *
      * @return true if the position has been successfully changed to the last
      * element, false otherwise
-     * @throws IOException if there are problems positioning this Cursor or if
+     * @throws Exception if there are problems positioning this Cursor or if
      * this Cursor is closed
      * @throws UnsupportedOperationException if this method is not supported
      */
-    boolean last() throws IOException;
+    boolean last() throws Exception;
 
 
     /**
@@ -136,10 +133,10 @@
      * fail with exceptions if and only if the cursor is in the closed state.
      *
      * @return true if this Cursor is closed, false otherwise
-     * @throws IOException if there are problems determining the cursor's closed state
+     * @throws Exception if there are problems determining the cursor's closed state
      * @throws UnsupportedOperationException if this method is not supported
      */
-    boolean isClosed() throws IOException;
+    boolean isClosed() throws Exception;
 
 
     /**
@@ -149,10 +146,10 @@
      * last element.
      *
      * @return true if the advance succeeded, false otherwise
-     * @throws IOException if there are problems advancing to the next position
+     * @throws Exception if there are problems advancing to the next position
      * @throws UnsupportedOperationException if this method is not supported
      */
-    boolean previous() throws IOException;
+    boolean previous() throws Exception;
 
 
     /**
@@ -162,11 +159,11 @@
      * the first element.
      *
      * @return true if the advance succeeded, false otherwise
-     * @throws IOException if there are problems advancing to this Cursor to
+     * @throws Exception if there are problems advancing to this Cursor to
      * the next position, or if this Cursor is closed
      * @throws UnsupportedOperationException if this method is not supported
      */
-    boolean next() throws IOException;
+    boolean next() throws Exception;
 
 
     /**
@@ -175,10 +172,10 @@
      * instead of creating new objects on each advance.
      *
      * @return the object at the current position
-     * @throws IOException if the object at this Cursor's current position
+     * @throws Exception if the object at this Cursor's current position
      * cannot be retrieved, or if this Cursor is closed
      */
-    E get() throws IOException;
+    E get() throws Exception;
 
 
     /**
@@ -201,7 +198,7 @@
      * Repeated calls to this method after this Cursor has already been
      * called should not fail with exceptions.
      *
-     * @throws IOException if for some reason this Cursor could not be closed
+     * @throws Exception if for some reason this Cursor could not be closed
      */
-    void close() throws IOException;
+    void close() throws Exception;
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/CursorClosedException.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/CursorClosedException.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/CursorClosedException.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/CursorClosedException.java Sat Jan 19 13:49:26 2008
@@ -19,9 +19,6 @@
 package org.apache.directory.server.core.cursor;
 
 
-import java.io.IOException;
-
-
 /**
  * A specific form of IOException to note that an operation is being
  * attempted on a closed Cursor.
@@ -29,7 +26,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class CursorClosedException extends IOException
+public class CursorClosedException extends Exception
 {
     public CursorClosedException()
     {

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/CursorState.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/CursorState.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/CursorState.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/CursorState.java Sat Jan 19 13:49:26 2008
@@ -19,9 +19,6 @@
 package org.apache.directory.server.core.cursor;
 
 
-import java.io.IOException;
-
-
 /**
  * A Cursor's state: cursor states leverage the State Pattern to isolate state
  * specific transition logic with certain operations.  Not every Cursor is
@@ -33,19 +30,19 @@
  */
 public interface CursorState<E>
 {
-    void before( E element ) throws IOException;
+    void before( E element ) throws Exception;
 
-    void after( E element ) throws IOException;
+    void after( E element ) throws Exception;
 
-    void beforeFirst() throws IOException;
+    void beforeFirst() throws Exception;
 
-    void afterLast() throws IOException;
+    void afterLast() throws Exception;
 
-    boolean first() throws IOException;
+    boolean first() throws Exception;
 
-    boolean last() throws IOException;
+    boolean last() throws Exception;
 
-    boolean previous() throws IOException;
+    boolean previous() throws Exception;
 
-    boolean next() throws IOException;
+    boolean next() throws Exception;
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/EmptyCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/EmptyCursor.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/EmptyCursor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/EmptyCursor.java Sat Jan 19 13:49:26 2008
@@ -19,9 +19,6 @@
 package org.apache.directory.server.core.cursor;
 
 
-import java.io.IOException;
-
-
 /**
  * An empty Cursor implementation.
  *
@@ -35,13 +32,13 @@
         return false;
     }
 
-    public void before( E element ) throws IOException
+    public void before( E element ) throws CursorClosedException
     {
         checkClosed( "before()" );
     }
 
 
-    public void after( E element ) throws IOException
+    public void after( E element ) throws CursorClosedException
     {
         checkClosed( "after()" );
     }
@@ -87,7 +84,7 @@
     }
 
 
-    public E get() throws IOException
+    public E get() throws Exception
     {
         checkClosed( "get()" );
         throw new InvalidCursorPositionException( "This cursor is empty and cannot return elements!" );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/InconsistentCursorStateException.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/InconsistentCursorStateException.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/InconsistentCursorStateException.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/InconsistentCursorStateException.java Sat Jan 19 13:49:26 2008
@@ -19,9 +19,6 @@
 package org.apache.directory.server.core.cursor;
 
 
-import java.io.IOException;
-
-
 /**
  * Thrown to indicate a condition in the Cursor where the state seems
  * inconsistent based on internal accounting.  This may indicate the
@@ -30,7 +27,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class InconsistentCursorStateException extends IOException
+public class InconsistentCursorStateException extends Exception
 {
     public InconsistentCursorStateException()
     {

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/InvalidCursorPositionException.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/InvalidCursorPositionException.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/InvalidCursorPositionException.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/InvalidCursorPositionException.java Sat Jan 19 13:49:26 2008
@@ -18,8 +18,6 @@
  */
 package org.apache.directory.server.core.cursor;
 
-import java.io.IOException;
-
 
 /**
  * Thrown to indicate an illegal position state for a Cursor when a call to
@@ -28,7 +26,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class InvalidCursorPositionException extends IOException
+public class InvalidCursorPositionException extends Exception
 {
     public InvalidCursorPositionException ()
     {

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/IteratorCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/IteratorCursor.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/IteratorCursor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/IteratorCursor.java Sat Jan 19 13:49:26 2008
@@ -18,7 +18,7 @@
  */
 package org.apache.directory.server.core.cursor;
 
-import java.io.IOException;
+
 import java.util.Iterator;
 
 
@@ -46,49 +46,49 @@
     }
     
 
-    public void before( E element ) throws IOException
+    public void before( E element )
     {
         throw new UnsupportedOperationException( "Cannot advance before an element on the underlying Iterator." );
     }
 
 
-    public void after( E element ) throws IOException
+    public void after( E element )
     {
         throw new UnsupportedOperationException( "Cannot advance after an element on the underlying Iterator." );
     }
 
 
-    public void beforeFirst() throws IOException
+    public void beforeFirst()
     {
         throw new UnsupportedOperationException( "Cannot advance before first on the underlying Iterator." );
     }
 
 
-    public void afterLast() throws IOException
+    public void afterLast()
     {
         throw new UnsupportedOperationException( "Cannot adanvce after last on the underlying Iterator." );
     }
 
 
-    public boolean first() throws IOException
+    public boolean first()
     {
         throw new UnsupportedOperationException( "Cannot advance to first position on the underlying Iterator." );
     }
 
 
-    public boolean last() throws IOException
+    public boolean last()
     {
         throw new UnsupportedOperationException( "Cannot advance to last position on the underlying Iterator." );
     }
 
 
-    public boolean previous() throws IOException
+    public boolean previous()
     {
         throw new UnsupportedOperationException( "Cannot back up on the underlying Iterator." );
     }
 
 
-    public boolean next() throws IOException
+    public boolean next() throws CursorClosedException
     {
         checkClosed( "next()" );
         if ( values.hasNext() )
@@ -101,7 +101,7 @@
     }
 
 
-    public E get() throws IOException
+    public E get() throws CursorClosedException
     {
         checkClosed( "get()" );
         return current;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/ListCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/ListCursor.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/ListCursor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/ListCursor.java Sat Jan 19 13:49:26 2008
@@ -19,8 +19,6 @@
 package org.apache.directory.server.core.cursor;
 
 
-import org.apache.directory.shared.ldap.NotImplementedException;
-
 import java.io.IOException;
 import java.util.Collections;
 import java.util.List;
@@ -197,7 +195,7 @@
      * @throws IllegalStateException if the underlying list is not sorted
      * and/or a comparator is not provided.
      */
-    public void before( E element ) throws IOException
+    public void before( E element ) throws Exception
     {
         checkClosed( "before()" );
 
@@ -223,11 +221,12 @@
             }
         }
 
-        throw new NotImplementedException( "don't know if list is sorted and checking that is not worth it" );
+        // TODO might want to add some code here to utilize the comparator
+        throw new UnsupportedOperationException( "don't know if list is sorted and checking that is not worth it" );
     }
 
 
-    public void after( E element ) throws IOException
+    public void after( E element ) throws Exception
     {
         checkClosed( "after()" );
 
@@ -253,25 +252,26 @@
             }
         }
 
-        throw new NotImplementedException( "don't know if list is sorted and checking that is not worth it" );
+        // TODO might want to add some code here to utilize the comparator
+        throw new UnsupportedOperationException( "don't know if list is sorted and checking that is not worth it" );
     }
 
 
-    public void beforeFirst() throws IOException
+    public void beforeFirst() throws Exception
     {
         checkClosed( "beforeFirst()" );
         this.index = -1;
     }
 
 
-    public void afterLast() throws IOException
+    public void afterLast() throws Exception
     {
         checkClosed( "afterLast()" );
         this.index = end;
     }
 
 
-    public boolean first() throws IOException
+    public boolean first() throws Exception
     {
         checkClosed( "first()" );
 
@@ -285,7 +285,7 @@
     }
 
 
-    public boolean last() throws IOException
+    public boolean last() throws Exception
     {
         checkClosed( "last()" );
 
@@ -299,36 +299,35 @@
     }
 
 
-    public boolean isFirst() throws IOException
+    public boolean isFirst() throws Exception
     {
         checkClosed( "isFirst()" );
         return list.size() > 0 && index == start;
     }
 
 
-    public boolean isLast() throws IOException
+    public boolean isLast() throws Exception
     {
         checkClosed( "isLast()" );
         return list.size() > 0 && index == end - 1;
-
     }
 
 
-    public boolean isAfterLast() throws IOException
+    public boolean isAfterLast() throws Exception
     {
         checkClosed( "isAfterLast()" );
         return index == end;
     }
 
 
-    public boolean isBeforeFirst() throws IOException
+    public boolean isBeforeFirst() throws Exception
     {
         checkClosed( "isBeforeFirst()" );
         return index == -1;
     }
 
 
-    public boolean previous() throws IOException
+    public boolean previous() throws Exception
     {
         checkClosed( "previous()" );
 
@@ -361,7 +360,7 @@
     }
 
 
-    public boolean next() throws IOException
+    public boolean next() throws Exception
     {
         checkClosed( "next()" );
 
@@ -395,7 +394,7 @@
     }
 
 
-    public E get() throws IOException
+    public E get() throws Exception
     {
         checkClosed( "get()" );
         if ( index < start || index >= end )

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/SingletonCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/SingletonCursor.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/SingletonCursor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/main/java/org/apache/directory/server/core/cursor/SingletonCursor.java Sat Jan 19 13:49:26 2008
@@ -19,7 +19,6 @@
 package org.apache.directory.server.core.cursor;
 
 
-import java.io.IOException;
 import java.util.Comparator;
 
 
@@ -57,7 +56,7 @@
     }
     
 
-    public void before( E element ) throws IOException
+    public void before( E element ) throws Exception
     {
         checkClosed( "before()" );
 
@@ -80,7 +79,7 @@
     }
 
 
-    public void after( E element ) throws IOException
+    public void after( E element ) throws Exception
     {
         checkClosed( "after()" );
 
@@ -103,7 +102,7 @@
     }
 
 
-    public void beforeFirst() throws IOException
+    public void beforeFirst() throws Exception
     {
         checkClosed( "()" );
         beforeFirst = true;
@@ -112,7 +111,7 @@
     }
 
 
-    public void afterLast() throws IOException
+    public void afterLast() throws Exception
     {
         checkClosed( "()" );
         beforeFirst = false;
@@ -121,7 +120,7 @@
     }
 
 
-    public boolean first() throws IOException
+    public boolean first() throws Exception
     {
         checkClosed( "()" );
         beforeFirst = false;
@@ -131,7 +130,7 @@
     }
 
 
-    public boolean last() throws IOException
+    public boolean last() throws Exception
     {
         checkClosed( "()" );
         beforeFirst = false;
@@ -141,35 +140,35 @@
     }
 
 
-    public boolean isFirst() throws IOException
+    public boolean isFirst() throws Exception
     {
         checkClosed( "()" );
         return onSingleton;
     }
 
 
-    public boolean isLast() throws IOException
+    public boolean isLast() throws Exception
     {
         checkClosed( "()" );
         return onSingleton;
     }
 
 
-    public boolean isAfterLast() throws IOException
+    public boolean isAfterLast() throws Exception
     {
         checkClosed( "()" );
         return afterLast;
     }
 
 
-    public boolean isBeforeFirst() throws IOException
+    public boolean isBeforeFirst() throws Exception
     {
         checkClosed( "()" );
         return beforeFirst;
     }
 
 
-    public boolean previous() throws IOException
+    public boolean previous() throws Exception
     {
         checkClosed( "()" );
         if ( beforeFirst )
@@ -193,7 +192,7 @@
     }
 
 
-    public boolean next() throws IOException
+    public boolean next() throws Exception
     {
         checkClosed( "()" );
         if ( beforeFirst )
@@ -217,7 +216,7 @@
     }
 
 
-    public E get() throws IOException
+    public E get() throws Exception
     {
         checkClosed( "()" );
         if ( onSingleton )

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/test/java/org/apache/directory/server/core/cursor/ListCursorTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/test/java/org/apache/directory/server/core/cursor/ListCursorTest.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/test/java/org/apache/directory/server/core/cursor/ListCursorTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-cursor/src/test/java/org/apache/directory/server/core/cursor/ListCursorTest.java Sat Jan 19 13:49:26 2008
@@ -236,7 +236,7 @@
         {
             assertEquals( msg, expected, cursor.isClosed() );
         }
-        catch ( IOException e )
+        catch ( Exception e )
         {
             fail( "cursor.isClosed() test should not fail after closing the cursor" );
         }
@@ -245,7 +245,7 @@
         {
             cursor.close();
         }
-        catch ( IOException e )
+        catch ( Exception e )
         {
             fail( "cursor.close() after closing the cursor should not fail with exceptions" );
         }
@@ -256,7 +256,7 @@
             cursor.afterLast();
             fail( "cursor.afterLast() after closing the cursor should fail with an IOException" );
         }
-        catch ( IOException e )
+        catch ( Exception e )
         {
             assertNotNull( e );
         }
@@ -266,7 +266,7 @@
             cursor.beforeFirst();
             fail( "cursor.beforeFirst() after closing the cursor should fail with an IOException" );
         }
-        catch ( IOException e )
+        catch ( Exception e )
         {
             assertNotNull( e );
         }
@@ -276,7 +276,7 @@
             cursor.first();
             fail( "cursor.first() after closing the cursor should fail with an IOException" );
         }
-        catch ( IOException e )
+        catch ( Exception e )
         {
             assertNotNull( e );
         }
@@ -286,7 +286,7 @@
             cursor.get();
             fail( "cursor.get() after closing the cursor should fail with an IOException" );
         }
-        catch ( IOException e )
+        catch ( Exception e )
         {
             assertNotNull( e );
         }
@@ -296,7 +296,7 @@
             cursor.last();
             fail( "cursor.last() after closing the cursor should fail with an IOException" );
         }
-        catch ( IOException e )
+        catch ( Exception e )
         {
             assertNotNull( e );
         }
@@ -306,7 +306,7 @@
             cursor.next();
             fail( "cursor.next() after closing the cursor should fail with an IOException" );
         }
-        catch ( IOException e )
+        catch ( Exception e )
         {
             assertNotNull( e );
         }
@@ -316,7 +316,7 @@
             cursor.previous();
             fail( "cursor.previous() after closing the cursor should fail with an IOException" );
         }
-        catch ( IOException e )
+        catch ( Exception e )
         {
             assertNotNull( e );
         }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDupsCursor.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDupsCursor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDupsCursor.java Sat Jan 19 13:49:26 2008
@@ -9,7 +9,6 @@
 import org.apache.directory.server.core.partition.impl.btree.Tuple;
 import org.apache.directory.shared.ldap.NotImplementedException;
 
-import java.io.IOException;
 import java.util.*;
 
 
@@ -68,7 +67,7 @@
     private boolean valueAvailable;
 
 
-    public JdbmDupsCursor( JdbmTable<K,V> table ) throws IOException
+    public JdbmDupsCursor( JdbmTable<K,V> table ) throws Exception
     {
         this.table = table;
         this.noDupsCursor = new JdbmNoDupsCursor<K,V>( table );
@@ -81,31 +80,31 @@
     }
 
 
-    public void before( Tuple element ) throws IOException
+    public void before( Tuple element ) throws Exception
     {
         throw new NotImplementedException();
     }
 
 
-    public void after(Tuple element) throws IOException
+    public void after(Tuple element) throws Exception
     {
         throw new NotImplementedException();
     }
 
 
-    public void beforeFirst() throws IOException
+    public void beforeFirst() throws Exception
     {
         throw new NotImplementedException();
     }
 
 
-    public void afterLast() throws IOException
+    public void afterLast() throws Exception
     {
         throw new NotImplementedException();
     }
 
 
-    public boolean first() throws IOException
+    public boolean first() throws Exception
     {
         throw new NotImplementedException();
     }
@@ -119,7 +118,7 @@
     }
 
 
-    public boolean last() throws IOException
+    public boolean last() throws Exception
     {
         if ( noDupsCursor.last() )
         {
@@ -168,7 +167,7 @@
     }
 
 
-    public boolean previous() throws IOException
+    public boolean previous() throws Exception
     {
         /*
          * If the iterator over the values of the current key is null or is
@@ -222,7 +221,7 @@
     }
 
 
-    public boolean next() throws IOException
+    public boolean next() throws Exception
     {
         /*
          * If the iterator over the values of the current key is null or is
@@ -275,7 +274,7 @@
     }
 
 
-    public Tuple<K,V> get() throws IOException
+    public Tuple<K,V> get() throws Exception
     {
         checkClosed( "get()" );
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java Sat Jan 19 13:49:26 2008
@@ -119,7 +119,7 @@
 
     // ------------------------------------------------------------------------
     // C O N S T R U C T O R S
-    // ------------------------------------------------------------------------
+    // ----------------------------------------------------------------------
 
 
     public JdbmIndex()
@@ -362,7 +362,7 @@
     
     
     /**
-     * @see org.apache.directory.server.core.partition.impl.btree.Index#count(java.lang.Object, boolean)
+     * @see org.apache.directory.server.core.partition.impl.btree.Index#lessThanCount(java.lang.Object)
      */
     public int lessThanCount( K attrVal ) throws IOException
     {
@@ -378,7 +378,7 @@
     /**
      * @see Index#forwardLookup(java.lang.Object)
      */
-    public Long forwardLookup( K attrVal ) throws IOException
+    public Long forwardLookup( K attrVal ) throws Exception
     {
         return forward.get( getNormalized( attrVal ) );
     }
@@ -387,7 +387,7 @@
     /**
      * @see Index#reverseLookup(Long)
      */
-    public K reverseLookup( Long id ) throws IOException
+    public K reverseLookup( Long id ) throws Exception
     {
         return reverse.get( id );
     }
@@ -421,7 +421,7 @@
     /**
      * @see Index#drop(Long)
      */
-    public void drop( Long id ) throws IOException
+    public void drop( Long id ) throws Exception
     {
         Cursor<Tuple<Long,K>> values = reverse.cursor();
         Tuple<Long,K> tuple = new Tuple<Long,K>( id, null );
@@ -441,7 +441,7 @@
     // ------------------------------------------------------------------------
 
 
-    public Cursor<IndexRecord> reverseCursor() throws IOException
+    public Cursor<IndexRecord> reverseCursor() throws Exception
     {
         throw new NotImplementedException();
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java Sat Jan 19 13:49:26 2008
@@ -20,9 +20,6 @@
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
 
-import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-
 import jdbm.RecordManager;
 import jdbm.helper.LongSerializer;
 import jdbm.helper.StringComparator;
@@ -38,16 +35,18 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class JdbmMasterTable extends JdbmTable implements MasterTable
+public class JdbmMasterTable<E> extends JdbmTable<Long,E> implements MasterTable<E>
 {
     private static final StringComparator STRCOMP = new StringComparator();
 
-    private static final SerializableComparator LONG_COMPARATOR = new SerializableComparator( "1.3.6.1.4.1.18060.0.4.1.1.2" )
+
+    private static final SerializableComparator<Long> LONG_COMPARATOR =
+            new SerializableComparator<Long>( "1.3.6.1.4.1.18060.0.4.1.1.2" )
     {
         private static final long serialVersionUID = 4048791282048841016L;
 
 
-        public int compare( Object o1, Object o2 )
+        public int compare( Long o1, Long o2 )
         {
             if ( o1 == null )
             {
@@ -56,47 +55,39 @@
             {
                 throw new IllegalArgumentException( "Argument 'obj2' is null" );
             }
-            //NB qdox has a fit if you try to compare 2 longs with < or >, but accepts the following circuitous locution:
-            long thisVal = ( Long ) o1;
-            long anotherVal = ( Long ) o2;
-            if ( thisVal == anotherVal )
-            {
-                return 0;
-            }
-            if (  thisVal < anotherVal )
-            {
-                return 1;
-            }
-            return -1;
+
+            return o1.compareTo( o2 );
         }
     };
 
-    private static final SerializableComparator STRING_COMPARATOR = new SerializableComparator( "1.3.6.1.4.1.18060.0.4.1.1.3" )
+
+    private static final SerializableComparator<String> STRING_COMPARATOR =
+            new SerializableComparator<String>( "1.3.6.1.4.1.18060.0.4.1.1.3" )
     {
         private static final long serialVersionUID = 3258689922792961845L;
 
 
-        public int compare( Object o1, Object o2 )
+        public int compare( String o1, String o2 )
         {
             return STRCOMP.compare( o1, o2 );
         }
     };
 
 
-    private final JdbmTable adminTbl;
+    private final JdbmTable<String,String> adminTbl;
 
 
     /**
-     * Creates the master entry table using a Berkeley Db for the backing store.
+     * Creates the master table using JDBM B+Trees for the backing store.
      *
-     * @param recMan the jdbm record manager
-     * @throws NamingException if there is an error opening the Db file.
+     * @param recMan the JDBM record manager
+     * @throws Exception if there is an error opening the Db file.
      */
-    public JdbmMasterTable( RecordManager recMan ) throws IOException
+    public JdbmMasterTable( RecordManager recMan ) throws Exception
     {
         super( DBF, recMan, LONG_COMPARATOR, LongSerializer.INSTANCE, new AttributesSerializer() );
-        adminTbl = new JdbmTable( "admin", recMan, STRING_COMPARATOR, null, null );
-        String seqValue = ( String ) adminTbl.get( SEQPROP_KEY );
+        adminTbl = new JdbmTable<String,String>( "admin", recMan, STRING_COMPARATOR, null, null );
+        String seqValue = adminTbl.get( SEQPROP_KEY );
 
         if ( null == seqValue )
         {
@@ -105,63 +96,31 @@
     }
 
 
-    /**
-     * Gets the Attributes of an entry from this MasterTable.
-     *
-     * @param id the BigInteger id of the entry to retrieve.
-     * @return the Attributes of the entry with operational attributes and all.
-     * @throws NamingException if there is a read error on the underlying Db.
-     */
-    public Attributes get( Object id ) throws IOException
+    public E get( Long id ) throws IOException
     {
-        return ( Attributes ) super.get( id );
+        return super.get( id );
     }
 
 
-    /**
-     * Puts the Attributes of an entry into this master table at an index
-     * specified by id.  Used both to create new entries and update existing
-     * ones.
-     *
-     * @param entry the Attributes of entry w/ operational attributes
-     * @param id    the BigInteger id of the entry to put
-     * @return the Attributes of the entry put
-     * @throws NamingException if there is a write error on the underlying Db.
-     */
-    public Attributes put( Attributes entry, Object id ) throws IOException
+    public E put( E entry, Long id ) throws IOException
     {
-        return ( Attributes ) super.put( id, entry );
+        return super.put( id, entry );
     }
 
 
-    /**
-     * Deletes a entry from the master table at an index specified by id.
-     *
-     * @param id the BigInteger id of the entry to delete
-     * @return the Attributes of the deleted entry
-     * @throws NamingException if there is a write error on the underlying Db
-     */
-    public Attributes delete( Object id ) throws IOException
+    public E delete( Long id ) throws IOException
     {
-        return ( Attributes ) super.remove( id );
+        return super.remove( id );
     }
 
 
-    /**
-     * Get's the current id value from this master database's sequence without
-     * affecting the seq.
-     *
-     * @return the current value.
-     * @throws NamingException if the admin table storing sequences cannot be
-     *                         read.
-     */
     public Long getCurrentId() throws IOException
     {
-        Long id = null;
+        Long id;
 
         synchronized ( adminTbl )
         {
-            id = new Long( ( String ) adminTbl.get( SEQPROP_KEY ) );
+            id = new Long( adminTbl.get( SEQPROP_KEY ) );
 
             //noinspection ConstantConditions
             if ( null == id )
@@ -175,24 +134,14 @@
     }
 
 
-    /**
-     * Get's the next value from this SequenceBDb.  This has the side-effect of
-     * changing the current sequence values perminantly in memory and on disk.
-     * Master table sequence begins at BigInteger.ONE.  The BigInteger.ZERO is
-     * used for the fictitious parent of the suffix root entry.
-     *
-     * @return the current value incremented by one.
-     * @throws NamingException if the admin table storing sequences cannot be
-     *                         read and writen to.
-     */
     public Long getNextId() throws IOException
     {
         Long nextVal;
-        Long lastVal = null;
+        Long lastVal;
 
         synchronized ( adminTbl )
         {
-            lastVal = new Long( ( String ) adminTbl.get( SEQPROP_KEY ) );
+            lastVal = new Long( adminTbl.get( SEQPROP_KEY ) );
 
             //noinspection ConstantConditions
             if ( null == lastVal )
@@ -211,29 +160,15 @@
     }
 
 
-    /**
-     * Gets a persistant property stored in the admin table of this MasterTable.
-     *
-     * @param property the key of the property to get the value of
-     * @return the value of the property
-     * @throws NamingException when the underlying admin table cannot be read
-     */
     public String getProperty( String property ) throws IOException
     {
         synchronized ( adminTbl )
         {
-            return ( String ) adminTbl.get( property );
+            return adminTbl.get( property );
         }
     }
 
 
-    /**
-     * Sets a persistant property stored in the admin table of this MasterTable.
-     *
-     * @param property the key of the property to set the value of
-     * @param value    the value of the property
-     * @throws NamingException when the underlying admin table cannot be writen
-     */
     public void setProperty( String property, String value ) throws IOException
     {
         synchronized ( adminTbl )
@@ -241,5 +176,4 @@
             adminTbl.put( property, value );
         }
     }
-
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmNoDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmNoDupsCursor.java?rev=613465&r1=613464&r2=613465&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmNoDupsCursor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmNoDupsCursor.java Sat Jan 19 13:49:26 2008
@@ -199,7 +199,7 @@
     }
 
 
-    public Tuple<K,V> get() throws IOException
+    public Tuple<K,V> get() throws Exception
     {
         if ( valueAvailable )
         {



Mime
View raw message