directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1138838 - in /directory/apacheds/trunk: jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ ldif-partition/src/ma...
Date Thu, 23 Jun 2011 11:37:23 GMT
Author: elecharny
Date: Thu Jun 23 11:37:22 2011
New Revision: 1138838

URL: http://svn.apache.org/viewvc?rev=1138838&view=rev
Log:
Removed the getCurrentId(E), getProperty(String) and setProperty(String) from the MasterTable
interface and implementation classes, those methods are never used. (YAGNI principle)

Modified:
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
    directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
    directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
    directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/MasterTable.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlMasterTable.java
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java?rev=1138838&r1=1138837&r2=1138838&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
(original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
Thu Jun 23 11:37:22 2011
@@ -182,19 +182,6 @@ public class JdbmMasterTable<E> extends 
     }
 
 
-    public Long getCurrentId( E entry ) throws Exception
-    {
-        Long id;
-
-        synchronized ( adminTbl )
-        {
-            id = new Long( adminTbl.get( SEQPROP_KEY ) );
-        }
-
-        return id;
-    }
-
-
     /**
      * Get's the next value from this SequenceBDb.  This has the side-effect of
      * changing the current sequence values permanently in memory and on disk.
@@ -222,38 +209,6 @@ public class JdbmMasterTable<E> extends 
 
 
     /**
-     * Gets a persistent 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 Exception when the underlying admin table cannot be read
-     */
-    public String getProperty( String property ) throws Exception
-    {
-        synchronized ( adminTbl )
-        {
-            return adminTbl.get( property );
-        }
-    }
-
-
-    /**
-     * Sets a persistent 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 Exception when the underlying admin table cannot be writen
-     */
-    public void setProperty( String property, String value ) throws Exception
-    {
-        synchronized ( adminTbl )
-        {
-            adminTbl.put( property, value );
-        }
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     public void resetCounter() throws Exception

Modified: directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java?rev=1138838&r1=1138837&r2=1138838&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
(original)
+++ directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
Thu Jun 23 11:37:22 2011
@@ -142,17 +142,9 @@ public class JdbmMasterTableTest
         assertNull( table.get( 0L ) );
         assertEquals( 0, table.count() );
 
-        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( null ) );
         assertEquals( 2, ( long ) table.getNextId( null ) );
-        assertEquals( 2, ( long ) table.getCurrentId( null ) );
-
-        assertNull( table.getProperty( "foo" ) );
-        table.setProperty( "foo", "bar" );
-        assertEquals( "bar", table.getProperty( "foo" ) );
     }
 }

Modified: directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=1138838&r1=1138837&r2=1138838&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
(original)
+++ directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
Thu Jun 23 11:37:22 2011
@@ -478,15 +478,6 @@ public class JdbmStoreTest
 
 
     @Test
-    public void testPersistentProperties() throws Exception
-    {
-        assertNull( store.getProperty( "foo" ) );
-        store.setProperty( "foo", "bar" );
-        assertEquals( "bar", store.getProperty( "foo" ) );
-    }
-
-
-    @Test
     public void testFreshStore() throws Exception
     {
         Dn dn = new Dn( schemaManager, "o=Good Times Co." );

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java?rev=1138838&r1=1138837&r2=1138838&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java
(original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java
Thu Jun 23 11:37:22 2011
@@ -196,16 +196,6 @@ public abstract class AbstractLdifPartit
      * {@inheritDoc}
      */
     @Override
-    public String getProperty( String propertyName ) throws Exception
-    {
-        return wrappedPartition.getProperty( propertyName );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
     public Index<Long, Entry, Long> getSubAliasIndex()
     {
         return wrappedPartition.getSubAliasIndex();
@@ -316,16 +306,6 @@ public abstract class AbstractLdifPartit
      * {@inheritDoc}
      */
     @Override
-    public void setProperty( String propertyName, String propertyValue ) throws Exception
-    {
-        wrappedPartition.setProperty( propertyName, propertyValue );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
     public void setSchemaManager( SchemaManager schemaManager )
     {
         super.setSchemaManager( schemaManager );

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=1138838&r1=1138837&r2=1138838&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
Thu Jun 23 11:37:22 2011
@@ -499,12 +499,6 @@ public abstract class BTreePartition<ID>
     public abstract int getChildCount( ID id ) throws LdapException;
 
 
-    public abstract void setProperty( String key, String value ) throws Exception;
-
-
-    public abstract String getProperty( String key ) throws Exception;
-
-
     public abstract Iterator<String> getUserIndices();
 
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java?rev=1138838&r1=1138837&r2=1138838&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java
Thu Jun 23 11:37:22 2011
@@ -342,24 +342,6 @@ public abstract class AbstractXdbmPartit
     /**
      * {@inheritDoc}
      */
-    public final void setProperty( String propertyName, String propertyValue ) throws Exception
-    {
-        store.setProperty( propertyName, propertyValue );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public final String getProperty( String propertyName ) throws Exception
-    {
-        return store.getProperty( propertyName );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public final void modify( ModifyOperationContext modifyContext ) throws LdapException
     {
         try

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=1138838&r1=1138837&r2=1138838&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
Thu Jun 23 11:37:22 2011
@@ -243,24 +243,6 @@ public abstract class AbstractStore<E, I
     }
 
 
-    /**
-     * {@inheritDoc}
-     */
-    public void setProperty( String propertyName, String propertyValue ) throws Exception
-    {
-        master.setProperty( propertyName, propertyValue );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public String getProperty( String propertyName ) throws Exception
-    {
-        return master.getProperty( propertyName );
-    }
-
-
     //------------------------------------------------------------------------
     // Index handling
     //------------------------------------------------------------------------

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/MasterTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/MasterTable.java?rev=1138838&r1=1138837&r2=1138838&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/MasterTable.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/MasterTable.java
Thu Jun 23 11:37:22 2011
@@ -65,17 +65,6 @@ 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(  E entry  ) throws Exception;
-
-
-    /**
      * Gets the next value from the sequence of this MasterTable.  This has
      * the side-effect of incrementing the sequence values permanently.
      *
@@ -84,26 +73,6 @@ public interface MasterTable<ID, E> exte
      * @throws Exception on failure to update the id sequence
      */
     ID getNextId( E entry ) throws Exception;
-
-
-    /**
-     * 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
-     * @throws Exception on failure to read the property
-     */
-    String getProperty( String property ) throws Exception;
-
-
-    /**
-     * 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
-     * @throws Exception on failure to write the property
-     */
-    void setProperty( String property, String value ) throws Exception;
     
     
     /**

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=1138838&r1=1138837&r2=1138838&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
Thu Jun 23 11:37:22 2011
@@ -529,12 +529,6 @@ public interface Store<E, ID extends Com
     int getChildCount( ID id ) throws Exception;
 
 
-    void setProperty( String propertyName, String propertyValue ) throws Exception;
-
-
-    String getProperty( String propertyName ) throws Exception;
-
-
     void modify( Dn dn, ModificationOperation modOp, Entry mods ) throws Exception;
 
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlMasterTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlMasterTable.java?rev=1138838&r1=1138837&r2=1138838&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlMasterTable.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlMasterTable.java
Thu Jun 23 11:37:22 2011
@@ -52,27 +52,10 @@ public class AvlMasterTable<E> extends A
     }
 
 
-    public Long getCurrentId( E entry ) throws Exception
-    {
-        return counter.longValue();
-    }
-
     public Long getNextId( E entry ) throws Exception
     {
         return counter.incrementAndGet();
     }
-
-    
-    public String getProperty( String property ) throws Exception
-    {
-        return props.getProperty( property );
-    }
-
-    
-    public void setProperty( String property, String value ) throws Exception
-    {
-        props.setProperty( property, value );
-    }
     
     
     /**

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java?rev=1138838&r1=1138837&r2=1138838&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java
Thu Jun 23 11:37:22 2011
@@ -391,15 +391,6 @@ public class AvlStoreTest
 
 
     @Test
-    public void testPersistentProperties() throws Exception
-    {
-        assertNull( store.getProperty( "foo" ) );
-        store.setProperty( "foo", "bar" );
-        assertEquals( "bar", store.getProperty( "foo" ) );
-    }
-
-
-    @Test
     public void testFreshStore() throws Exception
     {
         Dn dn = new Dn( schemaManager, "o=Good Times Co." );



Mime
View raw message