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 2011/03/05 16:29:39 UTC

svn commit: r1078302 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/changelog/ChangeLogEvent.java core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java

Author: elecharny
Date: Sat Mar  5 15:29:39 2011
New Revision: 1078302

URL: http://svn.apache.org/viewvc?rev=1078302&view=rev
Log:
o Removed the readExternal and writeExternal methods as the class is not externalizable

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/changelog/ChangeLogEvent.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/changelog/ChangeLogEvent.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/changelog/ChangeLogEvent.java?rev=1078302&r1=1078301&r2=1078302&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/changelog/ChangeLogEvent.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/changelog/ChangeLogEvent.java Sat Mar  5 15:29:39 2011
@@ -20,17 +20,12 @@
 package org.apache.directory.server.core.changelog;
 
 
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.ldif.LdifEntry;
-import org.apache.directory.shared.util.Unicode;
 
 
 /**
@@ -149,112 +144,6 @@ public class ChangeLogEvent
     }
 
 
-    /**
-     * @see Externalizable#readExternal(ObjectInput)
-     * 
-     * @param in The stream from which the ChangeOlgEvent is read
-     * @throws IOException If the stream can't be read
-     * @throws ClassNotFoundException If the ChangeLogEvent can't be created 
-     */
-    public void readExternal( ObjectInput in ) throws IOException , ClassNotFoundException
-    {
-        // Read the committer
-        committer = (LdapPrincipal)in.readObject();
-        
-        // Read the revision
-        revision = in.readLong();
-        
-        // Read the time
-        boolean hasZuluTime = in.readBoolean();
-        
-        if ( hasZuluTime )
-        {
-            zuluTime = Unicode.readUTF(in);
-        }
-        
-        // Read the forward LDIF
-        boolean hasForwardLdif = in.readBoolean();
-        
-        if ( hasForwardLdif )
-        {
-            forwardLdif = (LdifEntry)in.readObject();
-        }
-        
-        // Read the reverse LDIF number
-        int nbReverseLdif = in.readInt();
-        
-        if ( nbReverseLdif > 0 )
-        {
-            // Read each reverse ldif
-            reverseLdifs = new ArrayList<LdifEntry>(nbReverseLdif);
-            
-            for ( int i = 0; i < nbReverseLdif; i++ )
-            {
-                reverseLdifs.add( (LdifEntry)in.readObject() ); 
-            }
-        }
-    }
-
-
-    /**
-     * @see Externalizable#readExternal(ObjectInput)
-     *
-     * @param out The stream in which the ChangeLogEvent will be serialized. 
-     *
-     * @throws IOException If the serialization fail
-     */
-    public void writeExternal( ObjectOutput out ) throws IOException
-    {
-        // Write the committer
-        out.writeObject( committer );
-        
-        // write the revision
-        out.writeLong( revision );
-        
-        // write the time
-        
-        if ( zuluTime != null )
-        {
-            out.writeBoolean( true );
-            Unicode.writeUTF(out, zuluTime);
-        }
-        else
-        {
-            out.writeBoolean( false );
-        }
-        
-        // write the forward LDIF
-        if ( forwardLdif != null )
-        {
-            out.writeBoolean( true );
-            out.writeObject( forwardLdif );
-        }
-        else
-        {
-            out.writeBoolean( false );
-        }
-        
-        // write the reverse LDIF
-        if ( reverseLdifs != null )
-        {
-            out.writeInt( reverseLdifs.size() );
-            
-            // write each reverse
-            for ( LdifEntry reverseLdif:reverseLdifs )
-            {
-                out.writeObject( reverseLdif );
-            }
-        }
-        else
-        {
-            out.writeBoolean( false );
-        }
-        
-        // and flush the result
-        out.flush();
-    }
-
-
     @Override
     public String toString()
     {

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java?rev=1078302&r1=1078301&r2=1078302&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java Sat Mar  5 15:29:39 2011
@@ -101,6 +101,7 @@ class JavaLdapSupport
         {
             byte[] data = ( byte[] ) serverEntry.get( JSERIALDATA_ATTR ).getBytes();
             in = new ObjectInputStream( new ByteArrayInputStream( data ) );
+            
             return in.readObject();
         }
         catch ( Exception e )