directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1079040 [3/3] - in /directory/shared/branches/milestones: ./ all/ asn1/ asn1/src/ asn1/src/site/ dsml/ dsml/parser/ dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/ dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/...
Date Tue, 08 Mar 2011 00:07:35 GMT
Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/BinaryValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/BinaryValue.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/BinaryValue.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/BinaryValue.java Tue Mar  8 00:07:31 2011
@@ -30,6 +30,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.LdapComparator;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
+import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.model.schema.comparators.ByteArrayComparator;
 import org.apache.directory.shared.util.StringConstants;
@@ -54,9 +55,6 @@ public class BinaryValue extends Abstrac
     /** logger for reporting errors that might not be handled properly upstream */
     private static final Logger LOG = LoggerFactory.getLogger( BinaryValue.class );
 
-    /** The computed hashcode. We don't want to compute it each time the hashcode() method is called */
-    private volatile int h;
-
 
     /**
      * Creates a BinaryValue without an initial wrapped value.
@@ -637,160 +635,13 @@ public class BinaryValue extends Abstrac
         }
     }
 
-
+    
     /**
-     * We will write the value and the normalized value, only
-     * if the normalized value is different.
-     * 
-     * If the value is empty, a flag is written at the beginning with 
-     * the value true, otherwise, a false is written.
-     * 
-     * The data will be stored following this structure :
-     *  [length] the wrapped length. Can be -1, if wrapped is null
-     *  [value length]
-     *  [UP value] if not empty
-     *  [normalized] (will be false if the value can't be normalized)
-     *  [same] (a flag set to true if the normalized value equals the UP value)
-     *  [Norm value] (the normalized value if different from the UP value, and not empty)
-     *  
-     *  @param out the buffer in which we will stored the serialized form of the value
-     *  @throws IOException if we can't write into the buffer
-     */
-    public void serialize( ObjectOutput out ) throws IOException
-    {
-        if ( wrappedValue != null )
-        {
-            // write a the wrapped length
-            out.writeInt( wrappedValue.length );
-
-            // Write the data if not empty
-            if ( wrappedValue.length > 0 )
-            {
-                // The data
-                out.write( wrappedValue );
-
-                // Normalize the data
-                try
-                {
-                    normalize();
-
-                    if ( !normalized )
-                    {
-                        // We may not have a normalizer. Just get out
-                        // after having writen the flag
-                        out.writeBoolean( false );
-                    }
-                    else
-                    {
-                        // Write a flag indicating that the data has been normalized
-                        out.writeBoolean( true );
-
-                        if ( Arrays.equals( getReference(), normalizedValue ) )
-                        {
-                            // Write the 'same = true' flag
-                            out.writeBoolean( true );
-                        }
-                        else
-                        {
-                            // Write the 'same = false' flag
-                            out.writeBoolean( false );
-
-                            // Write the normalized value length
-                            out.writeInt( normalizedValue.length );
-
-                            if ( normalizedValue.length > 0 )
-                            {
-                                // Write the normalized value if not empty
-                                out.write( normalizedValue );
-                            }
-                        }
-                    }
-                }
-                catch ( LdapException ne )
-                {
-                    // The value can't be normalized, we don't write the 
-                    // normalized value.
-                    normalizedValue = null;
-                    out.writeBoolean( false );
-                }
-            }
-        }
-        else
-        {
-            // Write -1 indicating that the value is null
-            out.writeInt( -1 );
-        }
-    }
-
-
-    /**
-     * 
-     * Deserialize a BinaryValue. 
-     *
-     * @param in the buffer containing the bytes with the serialized value
-     * @throws IOException 
-     * @throws ClassNotFoundException
+     * {@inheritDoc}
      */
-    public void deserialize( ObjectInput in ) throws IOException, ClassNotFoundException
+    public static BinaryValue deserialize( SchemaManager schemaManager, ObjectInput in ) throws IOException
     {
-        // The UP value length
-        int wrappedLength = in.readInt();
-
-        if ( wrappedLength == -1 )
-        {
-            // If the value is null, the length will be set to -1
-            same = true;
-            wrappedValue = null;
-        }
-        else if ( wrappedLength == 0 )
-        {
-            wrappedValue = StringConstants.EMPTY_BYTES;
-            same = true;
-            normalized = true;
-            normalizedValue = wrappedValue;
-        }
-        else
-        {
-            wrappedValue = new byte[wrappedLength];
-
-            // Read the data
-            in.readFully( wrappedValue );
-
-            // Check if we have a normalized value
-            normalized = in.readBoolean();
-
-            if ( normalized )
-            {
-                // Read the 'same' flag
-                same = in.readBoolean();
-
-                if ( !same )
-                {
-                    // Read the normalizedvalue length
-                    int normalizedLength = in.readInt();
-
-                    if ( normalizedLength > 0 )
-                    {
-                        normalizedValue = new byte[normalizedLength];
-
-                        // Read the normalized value
-                        if ( in.read( normalizedValue, 0, normalizedLength ) == -1 )
-                        {
-                            throw new IOException( I18n.err( I18n.ERR_04480_END_OF_STREAM ) );
-                        }
-                    }
-                    else
-                    {
-                        normalizedValue = StringConstants.EMPTY_BYTES;
-                    }
-                }
-                else
-                {
-                    normalizedValue = new byte[wrappedLength];
-                    System.arraycopy( wrappedValue, 0, normalizedValue, 0, wrappedLength );
-                }
-            }
-        }
+        return (BinaryValue)AbstractValue.deserialize( schemaManager, in );
     }
 
 

Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java Tue Mar  8 00:07:31 2011
@@ -315,7 +315,7 @@ public class DefaultEntry implements Ent
     public DefaultEntry( SchemaManager schemaManager, Dn dn, EntryAttribute... attributes )
     {
         this.schemaManager = schemaManager;
-
+        
         if ( dn == null )
         {
             this.dn = Dn.EMPTY_DN;
@@ -326,18 +326,40 @@ public class DefaultEntry implements Ent
             normalizeDN( this.dn );
         }
 
-        initObjectClassAT();
-
-        for ( EntryAttribute attribute : attributes )
+        if ( schemaManager == null )
         {
-            // Store a new ServerAttribute
-            try
+            if ( attributes != null )
             {
-                put( attribute );
+                for ( EntryAttribute attribute : attributes )
+                {
+                    if ( attribute == null )
+                    {
+                        continue;
+                    }
+    
+                    // Store a new ClientAttribute
+                    this.attributes.put( attribute.getId(), attribute );
+                }
             }
-            catch ( LdapException ne )
+        }
+        else
+        {
+            initObjectClassAT();
+    
+            if ( attributes != null )
             {
-                LOG.warn( "The ServerAttribute '{}' does not exist. It has been discarded", attribute );
+                for ( EntryAttribute attribute : attributes )
+                {
+                    // Store a new ServerAttribute
+                    try
+                    {
+                        put( attribute );
+                    }
+                    catch ( LdapException ne )
+                    {
+                        LOG.warn( "The ServerAttribute '{}' does not exist. It has been discarded", attribute );
+                    }
+                }
             }
         }
     }

Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java Tue Mar  8 00:07:31 2011
@@ -160,6 +160,27 @@ public class DefaultEntryAttribute imple
 
     /**
      * Create a new instance of a EntryAttribute, without ID nor value.
+     */
+    /* No qualifier */ DefaultEntryAttribute( AttributeType attributeType, String upId, String normId, boolean isHR, int hashCode, Value<?>... values)
+    {
+        this.attributeType = attributeType;
+        this.upId = upId;
+        this.id = normId;
+        this.isHR = isHR;
+        this.h = hashCode;
+        
+        if ( values != null )
+        {
+            for ( Value<?> value : values )
+            {
+                this.values.add( value );
+            }
+        }
+    }
+
+
+    /**
+     * Create a new instance of a EntryAttribute, without ID nor value.
      * 
      * @param attributeType the attributeType for the empty attribute added into the entry
      */
@@ -2421,11 +2442,11 @@ public class DefaultEntryAttribute imple
                 // Write the value, using the correct method
                 if ( value instanceof StringValue)
                 {
-                    ((StringValue)value).serialize( out );
+                    StringValue.serialize( value, out );
                 }
                 else
                 {
-                    ((BinaryValue)value).serialize( out );
+                    BinaryValue.serialize( value, out );
                 }
             }
         }
@@ -2462,13 +2483,11 @@ public class DefaultEntryAttribute imple
                 
                 if ( isHR )
                 {
-                    value  = new StringValue( attributeType );
-                    ((StringValue)value).deserialize( in );
+                    value = StringValue.deserialize( null, in );
                 }
                 else
                 {
-                    value  = new BinaryValue( attributeType );
-                    ((BinaryValue)value).deserialize( in );
+                    value  = BinaryValue.deserialize( null, in );
                 }
                 
                 try

Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/StringValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/StringValue.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/StringValue.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/StringValue.java Tue Mar  8 00:07:31 2011
@@ -25,12 +25,13 @@ import java.io.ObjectOutput;
 
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
-import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.LdapComparator;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
+import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.util.Strings;
 import org.apache.directory.shared.util.Unicode;
+import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -546,110 +547,15 @@ public class StringValue extends Abstrac
 
     
     /**
-     * We will write the value and the normalized value, only
-     * if the normalized value is different.
-     * 
-     * If the value is empty, a flag is written at the beginning with 
-     * the value true, otherwise, a false is written.
-     * 
-     * The data will be stored following this structure :
-     *  [empty value flag]
-     *  [UP value]
-     *  [normalized] (will be false if the value can't be normalized)
-     *  [same] (a flag set to true if the normalized value equals the UP value)
-     *  [Norm value] (the normalized value if different from the UP value)
-     *  
-     *  @param out the buffer in which we will stored the serialized form of the value
-     *  @throws IOException if we can't write into the buffer
+     * {@inheritDoc}
      */
-    public void serialize( ObjectOutput out ) throws IOException
+    public static StringValue deserialize( SchemaManager schemaManager, ObjectInput in ) throws IOException
     {
-        if ( wrappedValue != null )
-        {
-            // write a flag indicating that the value is not null
-            out.writeBoolean( true );
-            
-            // Write the data
-            Unicode.writeUTF(out, wrappedValue);
-            
-            // Normalize the data
-            try
-            {
-                normalize();
-                out.writeBoolean( true );
-                
-                if ( wrappedValue.equals( normalizedValue ) )
-                {
-                    out.writeBoolean( true );
-                }
-                else
-                {
-                    out.writeBoolean( false );
-                    Unicode.writeUTF(out, normalizedValue);
-                }
-            }
-            catch ( LdapException ne )
-            {
-                // The value can't be normalized, we don't write the 
-                // normalized value.
-                normalizedValue = null;
-                out.writeBoolean( false );
-            }
-        }
-        else
-        {
-            // Write a flag indicating that the value is null
-            out.writeBoolean( false );
-        }
-        
-        out.flush();
+        return (StringValue)AbstractValue.deserialize( schemaManager, in );
     }
 
     
     /**
-     * Deserialize a StringValue. 
-     *
-     * @param in the buffer containing the bytes with the serialized value
-     * @throws IOException 
-     * @throws ClassNotFoundException
-     */
-    public void deserialize( ObjectInput in ) throws IOException, ClassNotFoundException
-    {
-        // If the value is null, the flag will be set to false
-        if ( !in.readBoolean() )
-        {
-            wrappedValue = null;
-            normalizedValue = null;
-            return;
-        }
-        
-        // Read the value
-        String wrapped = Unicode.readUTF(in);
-        
-        wrappedValue = wrapped;
-        
-        // Read the normalized flag
-        normalized = in.readBoolean();
-        
-        if ( normalized )
-        {
-            normalized = true;
-
-            // Read the 'same' flag
-            if ( in.readBoolean() )
-            {
-                normalizedValue = wrapped;
-            }
-            else
-            {
-                // The normalized value is different. Read it
-                normalizedValue = Unicode.readUTF(in);
-            }
-        }
-    }
-
-
-    /**
      * @see Object#toString()
      */
     public String toString()

Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Value.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Value.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Value.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Value.java Tue Mar  8 00:07:31 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import java.io.Externalizable;
 
 import org.apache.directory.shared.ldap.model.exception.LdapException;
-
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.SyntaxChecker;

Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifEntry.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifEntry.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifEntry.java Tue Mar  8 00:07:31 2011
@@ -30,8 +30,15 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.directory.shared.ldap.model.entry.*;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.model.entry.DefaultModification;
+import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.model.entry.Modification;
+import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.model.entry.StringValue;
+import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -54,11 +61,8 @@ import org.apache.directory.shared.util.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdifEntry implements Cloneable, Externalizable
+public class LdifEntry implements Cloneable
 {
-    /** The serial version UID */
-    private static final long serialVersionUID = 2L;
-
     /** Used in toArray() */
     public static final Modification[] EMPTY_MODS = new Modification[0];
 
@@ -88,7 +92,7 @@ public class LdifEntry implements Clonea
 
 
     /**
-     * Creates a new Entry object.
+     * Creates a new LdifEntry object.
      */
     public LdifEntry()
     {
@@ -101,6 +105,19 @@ public class LdifEntry implements Clonea
 
 
     /**
+     * Creates a new LdifEntry object, storing an Entry
+     */
+    public LdifEntry( Entry entry )
+    {
+        changeType = ChangeType.None; // Default LDIF content
+        modificationList = new LinkedList<Modification>();
+        modificationItems = new HashMap<String, Modification>();
+        this.entry = entry;
+        controls = null;
+    }
+
+
+    /**
      * Set the Distinguished Name
      * 
      * @param dn The Distinguished Name

Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java Tue Mar  8 00:07:31 2011
@@ -36,7 +36,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.util.Strings;
-import org.apache.directory.shared.util.Unicode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -782,9 +781,35 @@ public final class Ava implements Extern
             throw new IOException( message );
         }
         
-        Unicode.writeUTF(out, upName);
-        Unicode.writeUTF(out, upType);
-        Unicode.writeUTF(out, normType);
+        if ( upName != null )
+        {
+            out.writeBoolean( true );
+            out.writeUTF( upName );
+        }
+        else
+        {
+            out.writeBoolean( false);
+        }
+        
+        if ( upType != null )
+        {
+            out.writeBoolean( true );
+            out.writeUTF( upType );
+        }
+        else
+        {
+            out.writeBoolean( false);
+        }
+        
+        if ( normType != null )
+        {
+            out.writeBoolean( true );
+            out.writeUTF( normType );
+        }
+        else
+        {
+            out.writeBoolean( false);
+        }
         
         boolean isHR = !normValue.isBinary();
         
@@ -792,15 +817,13 @@ public final class Ava implements Extern
         
         if ( isHR )
         {
-            Unicode.writeUTF(out, upValue.getString());
-            Unicode.writeUTF(out, normValue.getString());
+            StringValue.serialize( upValue, out );
+            StringValue.serialize( normValue, out );
         }
         else
         {
-            out.writeInt( upValue.length() );
-            out.write( upValue.getBytes() );
-            out.writeInt( normValue.length() );
-            out.write( normValue.getBytes() );
+            BinaryValue.serialize( upValue, out );
+            BinaryValue.serialize( normValue, out );
         }
     }
     
@@ -814,28 +837,43 @@ public final class Ava implements Extern
      */
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
-        upName = Unicode.readUTF(in);
-        upType = Unicode.readUTF(in);
-        normType = Unicode.readUTF(in);
+        boolean hasUpName = in.readBoolean();
+        
+        if ( hasUpName )
+        {
+            upName = in.readUTF();
+        }
+        
+        boolean hasUpType = in.readBoolean();
+
+        if ( hasUpType )
+        {
+            upType = in.readUTF();
+        }
+        
+        boolean hasNormType = in.readBoolean();
+
+        if ( hasNormType )
+        {
+            normType = in.readUTF();
+        }
         
         boolean isHR = in.readBoolean();
         
         if ( isHR )
         {
-            upValue = new StringValue( Unicode.readUTF(in) );
-            normValue = new StringValue( Unicode.readUTF(in) );
+            upValue = StringValue.deserialize( schemaManager, in );
+            normValue = StringValue.deserialize( schemaManager, in );
         }
         else
         {
-            int upValueLength = in.readInt();
-            byte[] upValueBytes = new byte[upValueLength];
-            in.readFully( upValueBytes );
-            upValue = new BinaryValue( upValueBytes );
-
-            int valueLength = in.readInt();
-            byte[] normValueBytes = new byte[valueLength];
-            in.readFully( normValueBytes );
-            normValue = new BinaryValue( normValueBytes );
+            upValue = BinaryValue.deserialize( schemaManager, in );
+            normValue = BinaryValue.deserialize( schemaManager, in );
+        }
+        
+        if ( schemaManager != null )
+        {
+            attributeType = schemaManager.getAttributeType( upType );
         }
     }
     

Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/AvaSerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/AvaSerializer.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/AvaSerializer.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/AvaSerializer.java Tue Mar  8 00:07:31 2011
@@ -23,13 +23,8 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 
-import org.apache.directory.shared.ldap.model.entry.BinaryValue;
-import org.apache.directory.shared.ldap.model.entry.StringValue;
-import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
-import org.apache.directory.shared.util.Strings;
-import org.apache.directory.shared.util.Unicode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -75,65 +70,14 @@ public final class AvaSerializer
      * <li>valueLength</li>
      * <li>value</li> The normalized value.
      *
-     * @param atav the AttributeTypeAndValue to serialize
+     * @param ava the AttributeTypeAndValue to serialize
      * @param out the OutputStream in which the atav will be serialized
      * @throws IOException If we can't serialize the atav
      */
-    public static void serialize( Ava atav, ObjectOutput out ) throws IOException
+    public static void serialize( Ava ava, ObjectOutput out ) throws IOException
     {
-        if ( Strings.isEmpty(atav.getUpName())
-            || Strings.isEmpty(atav.getUpType())
-            || Strings.isEmpty(atav.getNormType())
-            || ( atav.getUpValue().isNull() )
-            || ( atav.getNormValue().isNull() ) )
-        {
-            String message = "Cannot serialize an wrong ATAV, ";
-            
-            if ( Strings.isEmpty(atav.getUpName()) )
-            {
-                message += "the upName should not be null or empty";
-            }
-            else if ( Strings.isEmpty(atav.getUpType()) )
-            {
-                message += "the upType should not be null or empty";
-            }
-            else if ( Strings.isEmpty(atav.getNormType()) )
-            {
-                message += "the normType should not be null or empty";
-            }
-            else if ( atav.getUpValue().isNull() )
-            {
-                message += "the upValue should not be null";
-            }
-            else if ( atav.getNormValue().isNull() )
-            {
-                message += "the value should not be null";
-            }
-                
-            LOG.error( message );
-            throw new IOException( message );
-        }
-        
-        Unicode.writeUTF(out, atav.getUpName());
-        Unicode.writeUTF(out, atav.getUpType());
-        Unicode.writeUTF(out, atav.getNormType());
-        
-        boolean isHR = !atav.getNormValue().isBinary();
-        
-        out.writeBoolean( isHR );
-        
-        if ( isHR )
-        {
-            Unicode.writeUTF(out, atav.getUpValue().getString());
-            Unicode.writeUTF(out, atav.getNormValue().getString());
-        }
-        else
-        {
-            out.writeInt( atav.getUpValue().length() );
-            out.write( atav.getUpValue().getBytes() );
-            out.writeInt( atav.getNormValue().length() );
-            out.write( atav.getNormValue().getBytes() );
-        }
+        ava.writeExternal( out );
+        out.flush();
     }
     
     
@@ -151,45 +95,17 @@ public final class AvaSerializer
     public static Ava deserialize( SchemaManager schemaManager, ObjectInput in ) 
         throws IOException, LdapInvalidDnException
     {
-        String upName = Unicode.readUTF(in);
-        String upType = Unicode.readUTF(in);
-        String normType = Unicode.readUTF(in);
+        Ava ava = new Ava( schemaManager );
         
-        boolean isHR = in.readBoolean();
-
         try
         {
-            if ( isHR )
-            {
-                Value<String> upValue = new StringValue( Unicode.readUTF(in) );
-                Value<String> normValue = new StringValue( Unicode.readUTF(in) );
-                
-                Ava atav =
-                    new Ava( schemaManager, upType, normType, upValue, normValue );
-                
-                return atav;
-            }
-            else
-            {
-                int upValueLength = in.readInt();
-                byte[] upValue = new byte[upValueLength];
-                in.readFully( upValue );
-    
-                int valueLength = in.readInt();
-                byte[] normValue = new byte[valueLength];
-                in.readFully( normValue );
-    
-                Ava atav =
-                    new Ava( upType, normType,
-                        new BinaryValue( upValue) ,
-                        new BinaryValue( normValue ), upName );
-                
-                return atav;
-            }
+            ava.readExternal( in );
         }
-        catch ( LdapInvalidDnException ine )
+        catch ( ClassNotFoundException cnfe )
         {
-            throw new IOException( ine.getMessage() );
+            throw new IOException( cnfe.getMessage() );
         }
+        
+        return ava;
     }
 }

Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java Tue Mar  8 00:07:31 2011
@@ -21,6 +21,10 @@
 package org.apache.directory.shared.ldap.model.name;
 
 
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
@@ -59,7 +63,7 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public final class Dn implements Iterable<Rdn>
+public final class Dn implements Iterable<Rdn>, Externalizable
 {
     /** The LoggerFactory used by this class */
     protected static final Logger LOG = LoggerFactory.getLogger( Dn.class );
@@ -301,7 +305,9 @@ public final class Dn implements Iterabl
     Dn( SchemaManager schemaManager, String upName, String normName, Rdn... rdns )
     {
         this.schemaManager = schemaManager;
-        normalized = schemaManager != null;
+        
+        normalized = ( schemaManager != null ) || ( normName != null );
+        
         this.upName = upName;
         this.normName = normName;
         bytes = Strings.getBytesUtf8( upName );
@@ -1681,4 +1687,72 @@ public final class Dn implements Iterabl
 
         return true;
     }
+    
+    
+    public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
+    {
+        // Read the UPName
+        upName = in.readUTF();
+
+        // Read the NormName
+        normName = in.readUTF();
+
+        if ( normName.length() == 0 )
+        {
+            // As the normName is equal to the upName,
+            // we didn't saved the nbnormName on disk.
+            // restore it by copying the upName.
+            normName = upName;
+        }
+
+        // Read the RDNs. Is it's null, the number will be -1.
+        int nbRdns = in.readInt();
+        
+        rdns = new ArrayList<Rdn>( nbRdns );
+        
+        for ( int i = 0; i < nbRdns; i++ )
+        {
+            Rdn rdn = new Rdn( schemaManager );
+            rdn.readExternal( in );
+            rdns.add( rdn );
+        }
+    }
+    
+    
+    public void writeExternal( ObjectOutput out ) throws IOException
+    {
+        if ( upName == null )
+        {
+            String message = "Cannot serialize a NULL Dn";
+            LOG.error( message );
+            throw new IOException( message );
+        }
+
+        // Write the UPName
+        out.writeUTF( upName );
+
+        // Write the NormName if different
+        if ( upName.equals( normName ) )
+        {
+            out.writeUTF( "" );
+        }
+        else
+        {
+            out.writeUTF( normName );
+        }
+
+        // Should we store the byte[] ???
+
+        // Write the RDNs.
+        // First the number of RDNs
+        out.writeInt( size() );
+
+        // Loop on the RDNs
+        for ( Rdn rdn : rdns )
+        {
+            rdn.writeExternal( out );
+        }
+        
+        out.flush();
+    }
 }

Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/DnSerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/DnSerializer.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/DnSerializer.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/DnSerializer.java Tue Mar  8 00:07:31 2011
@@ -29,7 +29,6 @@ import java.io.ObjectOutputStream;
 
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
-import org.apache.directory.shared.util.Unicode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -76,8 +75,6 @@ public final class DnSerializer
         
         serialize( dn, out );
         
-        out.flush();
-        
         return baos.toByteArray();
     }
 
@@ -101,37 +98,8 @@ public final class DnSerializer
      */
     public static void serialize( Dn dn, ObjectOutput out ) throws IOException
     {
-        if ( dn.getName() == null )
-        {
-            String message = "Cannot serialize a NULL Dn";
-            LOG.error( message );
-            throw new IOException( message );
-        }
-
-        // Write the UPName
-        Unicode.writeUTF(out, dn.getName());
-
-        // Write the NormName if different
-        if ( dn.getName().equals( dn.getNormName() ) )
-        {
-            Unicode.writeUTF(out, "");
-        }
-        else
-        {
-            Unicode.writeUTF(out, dn.getNormName());
-        }
-
-        // Should we store the byte[] ???
-
-        // Write the RDNs.
-        // First the number of RDNs
-        out.writeInt( dn.size() );
-
-        // Loop on the RDNs
-        for ( Rdn rdn:dn.getRdns() )
-        {
-            RdnSerializer.serialize( rdn, out );
-        }
+        dn.writeExternal( out );
+        out.flush();
     }
 
 
@@ -171,32 +139,16 @@ public final class DnSerializer
     public static Dn deserialize( SchemaManager schemaManager, ObjectInput in ) 
         throws IOException, LdapInvalidDnException
     {
-        // Read the UPName
-        String upName = Unicode.readUTF(in);
-
-        // Read the NormName
-        String normName = Unicode.readUTF(in);
-
-        if ( normName.length() == 0 )
+        Dn dn = new Dn( schemaManager );
+        
+        try
         {
-            // As the normName is equal to the upName,
-            // we didn't saved the nbnormName on disk.
-            // restore it by copying the upName.
-            normName = upName;
+            dn.readExternal( in );
         }
-
-        // Read the RDNs. Is it's null, the number will be -1.
-        int nbRdns = in.readInt();
-        
-        Rdn[] rdns = new Rdn[nbRdns];
-        
-        for ( int i = 0; i < nbRdns; i++ )
+        catch ( ClassNotFoundException cnfe )
         {
-            Rdn rdn = RdnSerializer.deserialize( schemaManager, in );
-            rdns[i] = rdn;
+            throw new IOException( cnfe.getMessage() );
         }
-
-        Dn dn = new Dn( schemaManager, upName, normName, rdns );
         
         return dn;
     }

Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java Tue Mar  8 00:07:31 2011
@@ -1485,15 +1485,15 @@ public final class Rdn implements Clonea
     public void writeExternal( ObjectOutput out ) throws IOException
     {
         out.writeInt( nbAtavs );
-        Unicode.writeUTF(out, upName);
+        out.writeUTF( upName );
 
         if ( upName.equals( normName ) )
         {
-            Unicode.writeUTF(out, "");
+            out.writeUTF( "" );
         }
         else
         {
-            Unicode.writeUTF(out, normName);
+            out.writeUTF( normName );
         }
 
         switch ( nbAtavs )
@@ -1502,13 +1502,13 @@ public final class Rdn implements Clonea
                 break;
 
             case 1:
-                out.writeObject( atav );
+                atav.writeExternal( out );
                 break;
 
             default:
-                for ( Ava value : atavs )
+                for ( Ava ava : atavs )
                 {
-                    out.writeObject( value );
+                    ava.writeExternal( out );
                 }
 
                 break;
@@ -1532,10 +1532,10 @@ public final class Rdn implements Clonea
         nbAtavs = in.readInt();
 
         // Read the UPName
-        upName = Unicode.readUTF(in);
+        upName = in.readUTF();
 
         // Read the normName
-        normName = Unicode.readUTF(in);
+        normName = in.readUTF();
 
         if ( Strings.isEmpty(normName) )
         {
@@ -1549,7 +1549,8 @@ public final class Rdn implements Clonea
                 break;
 
             case 1:
-                atav = (Ava) in.readObject();
+                atav = new Ava( schemaManager );
+                atav.readExternal( in );
                 atavType = atav.getNormType();
 
                 break;
@@ -1561,9 +1562,10 @@ public final class Rdn implements Clonea
 
                 for ( int i = 0; i < nbAtavs; i++ )
                 {
-                    Ava value = (Ava) in.readObject();
-                    atavs.add( value );
-                    atavTypes.put( value.getNormType(), value );
+                    Ava ava = new Ava( schemaManager );
+                    ava.readExternal( in );
+                    atavs.add( ava );
+                    atavTypes.put( ava.getNormType(), ava );
                 }
 
                 atav = null;

Modified: directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/RdnSerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/RdnSerializer.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/RdnSerializer.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/RdnSerializer.java Tue Mar  8 00:07:31 2011
@@ -25,8 +25,6 @@ import java.io.ObjectOutput;
 
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
-import org.apache.directory.shared.util.Strings;
-import org.apache.directory.shared.util.Unicode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -71,23 +69,8 @@ public final class RdnSerializer
      */
     public static void serialize( Rdn rdn, ObjectOutput out ) throws IOException
     {
-        out.writeInt( rdn.getNbAtavs() );
-        Unicode.writeUTF(out, rdn.getName());
-        Unicode.writeUTF(out, rdn.getNormName());
-        
-        switch ( rdn.getNbAtavs() )
-        {
-            case 0 :
-                break;
-
-            default :
-                for ( Ava atav:rdn )
-                {
-                    AvaSerializer.serialize(atav, out);
-                }
-            
-                break;
-        }
+        rdn.writeExternal( out );
+        out.flush();
     }
     
     
@@ -106,45 +89,15 @@ public final class RdnSerializer
     public static Rdn deserialize( SchemaManager schemaManager, ObjectInput in )
         throws IOException, LdapInvalidDnException
     {
-        // Read the ATAV number
-        int nbAtavs = in.readInt();
-        
-        // Read the UPName
-        String upName = Unicode.readUTF(in);
-        
-        // Read the normName
-        String normName = Unicode.readUTF(in);
-        
-        if ( Strings.isEmpty(normName) )
+        Rdn rdn = new Rdn( schemaManager );
+    
+        try
         {
-            normName = upName;
+            rdn.readExternal( in );
         }
-        
-        Rdn rdn = null;
-
-        // Read through the Atavs
-        switch ( nbAtavs )
+        catch ( ClassNotFoundException cnfe )
         {
-            case 0 :
-                rdn = new Rdn( schemaManager, upName, normName, (Ava[])null );
-                break;
-                
-            case 1 :
-                Ava ava = AvaSerializer.deserialize( schemaManager, in );
-                
-                rdn = new Rdn( schemaManager, upName, normName, ava );
-                break;
-                
-            default :
-                Ava[] avas = new Ava[nbAtavs];
-                
-                for ( int i = 0; i < nbAtavs; i++  )
-                {
-                    ava = AvaSerializer.deserialize( schemaManager, in );
-                    avas[i] = ava;
-                }
-
-                rdn = new Rdn( schemaManager, upName, normName, avas );
+            throw new IOException( cnfe.getMessage() );
         }
 
         return rdn;

Modified: directory/shared/branches/milestones/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/BinaryValueAttributeTypeTest.java Tue Mar  8 00:07:31 2011
@@ -136,7 +136,7 @@ public class BinaryValueAttributeTypeTes
         try
         {
             oOut = new ObjectOutputStream( out );
-            value.serialize( oOut );
+            BinaryValue.serialize( value, oOut );
         }
         catch ( IOException ioe )
         {
@@ -174,8 +174,7 @@ public class BinaryValueAttributeTypeTes
         {
             oIn = new ObjectInputStream( in );
 
-            BinaryValue value = new BinaryValue( at );
-            value.deserialize( oIn );
+            BinaryValue value = BinaryValue.deserialize( null, oIn );
 
             return value;
         }

Modified: directory/shared/branches/milestones/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/StringValueAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/StringValueAttributeTypeTest.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/StringValueAttributeTypeTest.java (original)
+++ directory/shared/branches/milestones/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/StringValueAttributeTypeTest.java Tue Mar  8 00:07:31 2011
@@ -106,7 +106,7 @@ public class StringValueAttributeTypeTes
         try
         {
             oOut = new ObjectOutputStream( out );
-            value.serialize( oOut );
+            StringValue.serialize( value, oOut );
         }
         catch ( IOException ioe )
         {
@@ -135,7 +135,7 @@ public class StringValueAttributeTypeTes
     /**
      * Deserialize a StringValue
      */
-    private StringValue deserializeValue( ByteArrayOutputStream out, AttributeType at ) throws IOException, ClassNotFoundException
+    private StringValue deserializeValue( ByteArrayOutputStream out ) throws IOException, ClassNotFoundException
     {
         ObjectInputStream oIn = null;
         ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray() );
@@ -144,8 +144,7 @@ public class StringValueAttributeTypeTes
         {
             oIn = new ObjectInputStream( in );
 
-            StringValue value = new StringValue( at );
-            value.deserialize( oIn );
+            StringValue value = StringValue.deserialize( null, oIn );
 
             return value;
         }
@@ -695,7 +694,7 @@ public class StringValueAttributeTypeTes
         assertEquals( "test test", normalized );
         assertEquals( "  Test   Test  ", ssv.getString() );
         
-        StringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
+        StringValue ssvSer = deserializeValue( serializeValue( ssv ) );
         
         assertEquals( ssv, ssvSer );
    }
@@ -715,7 +714,7 @@ public class StringValueAttributeTypeTes
         assertEquals( "test", normalized );
         assertEquals( "test", ssv.getString() );
         
-        StringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
+        StringValue ssvSer = deserializeValue( serializeValue( ssv ) );
         
         assertEquals( ssv, ssvSer );
    }
@@ -735,7 +734,7 @@ public class StringValueAttributeTypeTes
         assertNull( normalized );
         assertNull( ssv.get() );
         
-        StringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
+        StringValue ssvSer = deserializeValue( serializeValue( ssv ) );
         
         assertEquals( ssv, ssvSer );
    }
@@ -755,7 +754,7 @@ public class StringValueAttributeTypeTes
         assertEquals( "", normalized );
         assertEquals( "", ssv.getString() );
         
-        StringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
+        StringValue ssvSer = deserializeValue( serializeValue( ssv ) );
         
         assertEquals( ssv, ssvSer );
     }
@@ -767,11 +766,11 @@ public class StringValueAttributeTypeTes
     @Test public void testStringValueEmptyNormalizedSerialization() throws LdapException, IOException, ClassNotFoundException
     {
         // First check with a value which will be normalized
-        StringValue ssv = new StringValue( at, "  " );
+        StringValue ssv = new StringValue( "  " );
         
         assertEquals( "  ", ssv.getString() );
         
-        StringValue ssvSer = deserializeValue( serializeValue( ssv ), at );
+        StringValue ssvSer = deserializeValue( serializeValue( ssv ) );
         
         assertEquals( ssv, ssvSer );
     }

Propchange: directory/shared/branches/milestones/ldap/net/mina/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar  8 00:07:31 2011
@@ -5,5 +5,6 @@
 /directory/shared/branches/shared-dnfactory-experiment/ldap:980352-980933
 /directory/shared/branches-dnfactory-experiment/ldap:980350-980351
 /directory/shared/trunk/ldap:1066124-1067784
+/directory/shared/trunk/ldap/net/mina:1075835-1079037
 /directory/shared/trunk/ldap-codec:1067785-1067995,1068025-1072732,1072797-1074636
 /directory/shared/trunk/ldap-protocol-codec:1074637-1075328

Modified: directory/shared/branches/milestones/ldap/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/ldap/pom.xml?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/ldap/pom.xml (original)
+++ directory/shared/branches/milestones/ldap/pom.xml Tue Mar  8 00:07:31 2011
@@ -40,22 +40,4 @@
     <module>extras</module>
   </modules>
 
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <configuration>
-          <skip>true</skip>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-  <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/directory/shared/trunk/ldap</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/directory/shared/trunk/ldap</developerConnection>
-    <url>http://svn.apache.org/viewvc/directory/shared/trunk/ldap</url>
-  </scm>
-
 </project>

Propchange: directory/shared/branches/milestones/ldap/schema/data/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar  8 00:07:31 2011
@@ -9,4 +9,5 @@
 /directory/shared/branches/shared-subtree/ldap-schema:965208-965686
 /directory/shared/branches/xdbm-refactoring/ldap-schema:945830-946347
 /directory/shared/branches-dnfactory-experiment/ldap-schema:980350-980351
+/directory/shared/trunk/ldap/schema/data:1075835-1079037
 /directory/shared/trunk/ldap-schema:1066124-1067995,1068025-1072732,1072797-1075328

Propchange: directory/shared/branches/milestones/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar  8 00:07:31 2011
@@ -8,5 +8,6 @@
 /directory/shared/branches/shared-subtree/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl:965208-965686
 /directory/shared/branches/xdbm-refactoring/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl:945830-946347
 /directory/shared/branches-dnfactory-experiment/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl:980350-980351
+/directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl:1075835-1079037
 /directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl:1066124-1067995,1068025-1072732,1072797-1075328
 /directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl:806622-894844*

Propchange: directory/shared/branches/milestones/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar  8 00:07:31 2011
@@ -8,5 +8,6 @@
 /directory/shared/branches/shared-subtree/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java:965208-965686
 /directory/shared/branches/xdbm-refactoring/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java:945830-946347
 /directory/shared/branches-dnfactory-experiment/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java:980350-980351
+/directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java:1075835-1079037
 /directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java:1066124-1067995,1068025-1072732,1072797-1075328
 /directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java:806622-894844

Modified: directory/shared/branches/milestones/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/pom.xml?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/pom.xml (original)
+++ directory/shared/branches/milestones/pom.xml Tue Mar  8 00:07:31 2011
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.directory.project</groupId>
     <artifactId>project</artifactId>
-    <version>20</version>
+    <version>21</version>
     <relativePath/>
   </parent>
 
@@ -53,12 +53,14 @@
     <mina.core.version>2.0.2</mina.core.version>
     <org.osgi.version>3.0.0</org.osgi.version>
     <org.osgi.core.version>4.2.0</org.osgi.core.version>
-    <org.apache.felix.version>3.0.2</org.apache.felix.version>
+    <org.apache.felix.version>3.0.9</org.apache.felix.version>
     <slf4j.api.version>1.6.1</slf4j.api.version>
     <slf4j.log4j12.version>1.6.1</slf4j.log4j12.version>
     <xml.apis.version>2.0.2</xml.apis.version>
     <xpp3.version>1.1.4c</xpp3.version>
-    <pax-exam.version>1.2.3</pax-exam.version>
+    <pax-exam.version>2.0.0-M1</pax-exam.version>
+    <pax-exam-container-default.version>1.2.4</pax-exam-container-default.version>
+    <pax-exam-junit.version>1.2.4</pax-exam-junit.version>
     <findbugs.annotations.version>1.0.0</findbugs.annotations.version>
   </properties>
   
@@ -113,13 +115,14 @@
               <!-- Missing license header in dependency reduced pom, see http://jira.codehaus.org/browse/MSHADE-48 -->
               <exclude>**/dependency-reduced-pom.xml</exclude>
               <!-- Generated ldif files -->
-              <exclude>ldap-schema/src/main/resources/schema/**</exclude>
-              <exclude>ldap-schema/src/main/resources/schema-all.ldif</exclude>
+              <exclude>ldap/schema/data/src/main/resources/schema/**</exclude>
+              <exclude>ldap/schema/data/src/main/resources/schema-all.ldif</exclude>
+              <exclude>schema/data/src/main/resources/schema/**</exclude>
+              <exclude>schema/data/src/main/resources/schema-all.ldif</exclude>
+              <exclude>data/src/main/resources/schema/**</exclude>
+              <exclude>data/src/main/resources/schema-all.ldif</exclude>
               <exclude>src/main/resources/schema/**</exclude>
               <exclude>src/main/resources/schema-all.ldif</exclude>
-              <!-- Files having a Bouncy Castle license -->
-              <exclude>ldap/src/main/java/org/apache/directory/shared/asn1/der/*.java</exclude>
-              <exclude>src/main/java/org/apache/directory/shared/asn1/der/*.java</exclude>
             </excludes>
           </configuration>
          </plugin>
@@ -150,20 +153,20 @@
           <reportPlugins>
             <plugin>
               <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-surefire-report-plugin</artifactId>
+              <artifactId>maven-jxr-plugin</artifactId>
               <configuration>
-                <aggregate>true</aggregate>
+                  <aggregate>true</aggregate>
               </configuration>
             </plugin>
-      
+       
             <plugin>
               <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-jxr-plugin</artifactId>
+              <artifactId>maven-surefire-report-plugin</artifactId>
               <configuration>
-                  <aggregate>true</aggregate>
+                <aggregate>true</aggregate>
               </configuration>
             </plugin>
-       
+      
             <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-pmd-plugin</artifactId>
@@ -537,14 +540,14 @@
       <dependency>
         <groupId>org.ops4j.pax.exam</groupId>
         <artifactId>pax-exam-junit</artifactId>
-        <version>${pax-exam.version}</version>
+        <version>${pax-exam-junit.version}</version>
         <scope>test</scope>
       </dependency>
 
       <dependency>
         <groupId>org.ops4j.pax.exam</groupId>
         <artifactId>pax-exam-container-default</artifactId>
-        <version>${pax-exam.version}</version>
+        <version>${pax-exam-container-default.version}</version>
         <scope>test</scope>
       </dependency>
 

Modified: directory/shared/branches/milestones/util/src/main/java/org/apache/directory/shared/util/OsgiUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/milestones/util/src/main/java/org/apache/directory/shared/util/OsgiUtils.java?rev=1079040&r1=1079039&r2=1079040&view=diff
==============================================================================
--- directory/shared/branches/milestones/util/src/main/java/org/apache/directory/shared/util/OsgiUtils.java (original)
+++ directory/shared/branches/milestones/util/src/main/java/org/apache/directory/shared/util/OsgiUtils.java Tue Mar  8 00:07:31 2011
@@ -140,7 +140,8 @@ public class OsgiUtils
     public static Set<File> getClasspathCandidates( FileFilter filter )
     {
         Set<File> candidates = new HashSet<File>();
-        String[] cpElements = System.getProperty( "java.class.path" ).split( ":" );
+        String separator = System.getProperty( "path.separator" );
+        String[] cpElements = System.getProperty( "java.class.path" ).split( separator );
         
         for ( String element : cpElements )
         {



Mime
View raw message