You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2013/03/25 13:17:54 UTC

svn commit: r1460632 - /directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/EntrySerializer.java

Author: elecharny
Date: Mon Mar 25 12:17:53 2013
New Revision: 1460632

URL: http://svn.apache.org/r1460632
Log:
We don't have to serialize the RDN into the entry. Remove dthis useless serialization.

Modified:
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/EntrySerializer.java

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/EntrySerializer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/EntrySerializer.java?rev=1460632&r1=1460631&r2=1460632&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/EntrySerializer.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/EntrySerializer.java Mon Mar 25 12:17:53 2013
@@ -34,9 +34,6 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.exception.LdapException;
-import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
-import org.apache.directory.api.ldap.model.name.Dn;
-import org.apache.directory.api.ldap.model.name.Rdn;
 import org.apache.directory.api.ldap.model.schema.AttributeType;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
 import org.apache.directory.server.i18n.I18n;
@@ -109,22 +106,7 @@ public class EntrySerializer implements 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutput out = new ObjectOutputStream( baos );
 
-        // First, the Dn
-        Dn dn = entry.getDn();
-
-        // Write the Rdn of the Dn
-        if ( dn.isEmpty() )
-        {
-            out.writeByte( 0 );
-        }
-        else
-        {
-            out.writeByte( 1 );
-            Rdn rdn = dn.getRdn();
-            rdn.writeExternal( out );
-        }
-
-        // Then the attributes.
+        // Serialize the attributes.
         out.writeInt( entry.getAttributes().size() );
 
         // Iterate through the keys. We store the Attribute
@@ -175,30 +157,6 @@ public class EntrySerializer implements 
         {
             Entry entry = new DefaultEntry( schemaManager );
 
-            // Read the Dn, if any
-            byte hasDn = in.readByte();
-
-            if ( hasDn == 1 )
-            {
-                Rdn rdn = new Rdn( schemaManager );
-                rdn.readExternal( in );
-
-                try
-                {
-                    entry.setDn( new Dn( schemaManager, rdn ) );
-                }
-                catch ( LdapInvalidDnException lide )
-                {
-                    IOException ioe = new IOException( lide.getMessage() );
-                    ioe.initCause( lide );
-                    throw ioe;
-                }
-            }
-            else
-            {
-                entry.setDn( Dn.EMPTY_DN );
-            }
-
             // Read the number of attributes
             int nbAttributes = in.readInt();