directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r617838 - in /directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name: AtavSerializer.java DnSerializer.java RdnSerializer.java
Date Sat, 02 Feb 2008 17:16:12 GMT
Author: elecharny
Date: Sat Feb  2 09:16:11 2008
New Revision: 617838

URL: http://svn.apache.org/viewvc?rev=617838&view=rev
Log:
Cleaned up the javadoc. Removed some useless test.

Modified:
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/AtavSerializer.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/AtavSerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/AtavSerializer.java?rev=617838&r1=617837&r2=617838&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/AtavSerializer.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/AtavSerializer.java
Sat Feb  2 09:16:11 2008
@@ -19,19 +19,16 @@
  */
 package org.apache.directory.shared.ldap.name;
 
-import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 
-import javax.naming.InvalidNameException;
-
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * A helper class which serialize and deserialize a AttributeTypeAndValue
+ * A helper class which serialize and deserialize an AttributeTypeAndValue
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -137,7 +134,7 @@
     
     
     /**
-     * @see Externalizable#readExternal(ObjectInput)
+     * Deserialize an AttributeTypeAndValue object
      * 
      * We read back the data to create a new ATAV. The structure 
      * read is exposed in the {@link AttributeTypeAndValue#writeExternal(ObjectOutput)} 

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java?rev=617838&r1=617837&r2=617838&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnSerializer.java
Sat Feb  2 09:16:11 2008
@@ -39,6 +39,8 @@
     protected static final Logger LOG = LoggerFactory.getLogger( DnSerializer.class );
 
     /**
+     * Serialize a DN
+     * 
      * We have to store a DN data efficiently. Here is the structure :
      * 
      * <li>upName</li> The User provided DN<p>
@@ -82,24 +84,14 @@
         
         // Should we store the byte[] ???
         
-        // Write the RDNs. Is it's null, the number will be -1. 
-        if ( dn.getRdns() == null )
-        {
-            out.writeInt( -1 );
-        }
-        else if ( dn.size() == 0 )
-        {
-            out.writeInt( 0 );
-        }
-        else
+        // Write the RDNs.
+        // First the number of RDNs
+        out.writeInt( dn.size() );
+        
+        // Loop on the RDNs
+        for ( Rdn rdn:dn.getRdns() )
         {
-            out.writeInt( dn.size() );
-            
-            // Loop on the RDNs
-            for ( Rdn rdn:dn.getRdns() )
-            {
-                RdnSerializer.serialize( rdn, out );
-            }
+            RdnSerializer.serialize( rdn, out );
         }
         
         out.flush();
@@ -107,6 +99,8 @@
 
 
     /**
+     * Deserialize a DN
+     * 
      * We read back the data to create a new LdapDN. The structure 
      * read is exposed in the {@link DnSerializer#serialize(LdapDN, ObjectOutput)} 
      * method<p>

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java?rev=617838&r1=617837&r2=617838&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java
Sat Feb  2 09:16:11 2008
@@ -19,7 +19,6 @@
  */
 package org.apache.directory.shared.ldap.name;
 
-import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
@@ -40,7 +39,7 @@
     protected static final Logger LOG = LoggerFactory.getLogger( RdnSerializer.class );
 
     /**
-     * @see Externalizable#readExternal(ObjectInput)<p>
+     * Serialize a RDN instance
      * 
      * A RDN is composed of on to many ATAVs (AttributeType And Value).
      * We should write all those ATAVs sequencially, following the 
@@ -88,7 +87,7 @@
     }
     
     /**
-     * @see Externalizable#readExternal(ObjectInput)
+     * Deserialize a RDN instance
      * 
      * We read back the data to create a new RDB. The structure 
      * read is exposed in the {@link Rdn#writeExternal(ObjectOutput)} 
@@ -110,12 +109,14 @@
             normName = upName;
         }
         
+        // Read the RDN's position and length
         int start = in.readInt();
         int length = in.readInt();
         
+        // Now creates the RDN
         Rdn rdn = new Rdn( length, start, upName, normName );
 
-        
+        // Read through the Atavs
         switch ( nbAtavs )
         {
             case 0 :



Mime
View raw message