directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r493916 [5/7] - in /directory/branches: apacheds/1.0/core-unit/ apacheds/1.0/core-unit/src/main/java/org/apache/directory/server/core/unit/ apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/ apacheds/1.0/core-unit/src/te...
Date Mon, 08 Jan 2007 02:44:40 GMT
Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java Sun Jan  7 18:44:33 2007
@@ -26,14 +26,14 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -74,8 +74,8 @@
 
    protected Attributes getPersonAttributes(String sn, String cn) {
 
-       Attributes attrs = new BasicAttributes();
-       Attribute ocls = new BasicAttribute("objectClass");
+       Attributes attrs = new AttributesImpl();
+       Attribute ocls = new AttributeImpl("objectClass");
        ocls.add("top");
        ocls.add("person");
        attrs.put(ocls);
@@ -87,8 +87,8 @@
 
    protected Attributes getOrgUnitAttributes(String ou) {
 
-       Attributes attrs = new BasicAttributes();
-       Attribute ocls = new BasicAttribute("objectClass");
+       Attributes attrs = new AttributesImpl();
+       Attribute ocls = new AttributeImpl("objectClass");
        ocls.add("top");
        ocls.add("organizationalUnit");
        attrs.put(ocls);

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/BinarySearchTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/BinarySearchTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/BinarySearchTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/BinarySearchTest.java Sun Jan  7 18:44:33 2007
@@ -25,14 +25,14 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -52,8 +52,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/DefaultAuthorizationTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/DefaultAuthorizationTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/DefaultAuthorizationTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/DefaultAuthorizationTest.java Sun Jan  7 18:44:33 2007
@@ -26,14 +26,14 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 /**
  * Simple test for DefaultAuthorizationService. Adds two users emtries below
@@ -60,8 +60,8 @@
      */
     protected Attributes getPersonAttributes(String sn, String cn)
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java Sun Jan  7 18:44:33 2007
@@ -26,14 +26,14 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -60,8 +60,8 @@
 
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -74,8 +74,8 @@
 
     protected Attributes getGroupOfNamesAttributes( String cn, String member )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "groupOfNames" );
         attributes.put( attribute );

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/MiscTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/MiscTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/MiscTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/MiscTest.java Sun Jan  7 18:44:33 2007
@@ -27,6 +27,8 @@
 import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
 import org.apache.directory.server.unit.AbstractServerTest;
 import org.apache.directory.shared.asn1.util.Asn1StringUtils;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.Control;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
 import org.apache.directory.shared.ldap.util.EmptyEnumeration;
@@ -40,7 +42,12 @@
 import javax.naming.NoPermissionException;
 import javax.naming.NamingEnumeration;
 import javax.naming.OperationNotSupportedException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
 
 
@@ -82,8 +89,8 @@
             partitions.addAll( configuration.getContextPartitionConfigurations() );
             MutablePartitionConfiguration partition = new MutablePartitionConfiguration();
             partition.setSuffix( "dc=aPache,dc=org" );
-            Attributes entry = new BasicAttributes( "dc", "aPache", true );
-            Attribute oc = new BasicAttribute( "objectClass" );
+            Attributes entry = new AttributesImpl( "dc", "aPache", true );
+            Attribute oc = new AttributeImpl( "objectClass" );
             entry.put( oc );
             oc.add( "top" );
             oc.add( "domain" );
@@ -103,8 +110,8 @@
             partitions.addAll( configuration.getContextPartitionConfigurations() );
             MutablePartitionConfiguration partition = new MutablePartitionConfiguration();
             partition.setSuffix( "dc=apache,dc=org" );
-            Attributes entry = new BasicAttributes( "dc", "apache", true );
-            Attribute oc = new BasicAttribute( "objectClass" );
+            Attributes entry = new AttributesImpl( "dc", "apache", true );
+            Attribute oc = new AttributeImpl( "objectClass" );
             entry.put( oc );
             oc.add( "top" );
             oc.add( "domain" );
@@ -174,8 +181,8 @@
         {
         }
 
-        Attributes attrs = new BasicAttributes( true );
-        Attribute oc = new BasicAttribute( "objectClass" );
+        Attributes attrs = new AttributesImpl( true );
+        Attribute oc = new AttributeImpl( "objectClass" );
         attrs.put( oc );
         oc.add( "top" );
         oc.add( "organizationalUnit" );
@@ -272,8 +279,8 @@
         env.put( "java.naming.ldap.version", "3" );
         env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
 
-        Attributes attributes = new BasicAttributes();
-        Attribute objectClass = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute objectClass = new AttributeImpl( "objectClass" );
         objectClass.add( "top" );
         objectClass.add( "organizationalUnit" );
         attributes.put( objectClass );
@@ -311,8 +318,8 @@
         Attributes attrs = ctx.getAttributes( "" );
         assertTrue( attrs.get( "dc" ).get().equals( "aPache" ) );
 
-        Attributes user = new BasicAttributes( "cn", "Kate Bush", true );
-        Attribute oc = new BasicAttribute( "objectClass" );
+        Attributes user = new AttributesImpl( "cn", "Kate Bush", true );
+        Attribute oc = new AttributeImpl( "objectClass" );
         oc.add( "top" );
         oc.add( "person" );
         oc.add( "organizationalPerson" );
@@ -424,8 +431,8 @@
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         InitialLdapContext ctx = new InitialLdapContext( env, null );
 
-        Attributes user = new BasicAttributes( "cn", "Kate Bush", true );
-        Attribute oc = new BasicAttribute( "objectClass" );
+        Attributes user = new AttributesImpl( "cn", "Kate Bush", true );
+        Attribute oc = new AttributeImpl( "objectClass" );
         oc.add( "top" );
         oc.add( "person" );
         oc.add( "organizationalPerson" );

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyAddTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyAddTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyAddTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyAddTest.java Sun Jan  7 18:44:33 2007
@@ -27,18 +27,18 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.AttributeInUseException;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InvalidAttributeIdentifierException;
 import javax.naming.directory.InvalidAttributeValueException;
-import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
 /**
@@ -61,8 +61,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -119,7 +119,7 @@
     {
         // Add telephoneNumber attribute
         String newValue = "1234567890";
-        Attributes attrs = new BasicAttributes( "telephoneNumber", newValue );
+        Attributes attrs = new AttributesImpl( "telephoneNumber", newValue );
         ctx.modifyAttributes( RDN, DirContext.ADD_ATTRIBUTE, attrs );
 
         // Verify, that attribute value is added
@@ -141,10 +141,10 @@
         // Add telephoneNumber attribute
         String[] newValues =
             { "1234567890", "999999999" };
-        Attribute attr = new BasicAttribute( "telephoneNumber" );
+        Attribute attr = new AttributeImpl( "telephoneNumber" );
         attr.add( newValues[0] );
         attr.add( newValues[1] );
-        Attributes attrs = new BasicAttributes();
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
         ctx.modifyAttributes( RDN, DirContext.ADD_ATTRIBUTE, attrs );
 
@@ -168,7 +168,7 @@
         // A new description attribute value
         String newValue = "A new description for this person";
         assertFalse( newValue.equals( PERSON_DESCRIPTION ) );
-        Attributes attrs = new BasicAttributes( "description", newValue );
+        Attributes attrs = new AttributesImpl( "description", newValue );
 
         ctx.modifyAttributes( RDN, DirContext.ADD_ATTRIBUTE, attrs );
 
@@ -195,7 +195,7 @@
     public void testAddExistingAttributeValue() throws NamingException
     {
         // Change description attribute
-        Attributes attrs = new BasicAttributes( "description", PERSON_DESCRIPTION );
+        Attributes attrs = new AttributesImpl( "description", PERSON_DESCRIPTION );
         
         try
         {
@@ -230,23 +230,23 @@
     public void testAddExistingNthAttributesDirServer664() throws NamingException
     {
         // Change description attribute
-        Attributes attrs = new BasicAttributes( true );
-        attrs.put( new BasicAttribute( "attr1", "attr 1" ) );
-        attrs.put( new BasicAttribute( "attr2", "attr 2" ) );
-        attrs.put( new BasicAttribute( "attr3", "attr 3" ) );
-        attrs.put( new BasicAttribute( "attr4", "attr 4" ) );
-        attrs.put( new BasicAttribute( "attr5", "attr 5" ) );
-        attrs.put( new BasicAttribute( "attr6", "attr 6" ) );
-        attrs.put( new BasicAttribute( "attr7", "attr 7" ) );
-        attrs.put( new BasicAttribute( "attr8", "attr 8" ) );
-        attrs.put( new BasicAttribute( "attr9", "attr 9" ) );
-        attrs.put( new BasicAttribute( "attr10", "attr 10" ) );
-        attrs.put( new BasicAttribute( "attr11", "attr 11" ) );
-        attrs.put( new BasicAttribute( "attr12", "attr 12" ) );
-        attrs.put( new BasicAttribute( "attr13", "attr 13" ) );
-        attrs.put( new BasicAttribute( "attr14", "attr 14" ) );
+        Attributes attrs = new AttributesImpl( true );
+        attrs.put( new AttributeImpl( "attr1", "attr 1" ) );
+        attrs.put( new AttributeImpl( "attr2", "attr 2" ) );
+        attrs.put( new AttributeImpl( "attr3", "attr 3" ) );
+        attrs.put( new AttributeImpl( "attr4", "attr 4" ) );
+        attrs.put( new AttributeImpl( "attr5", "attr 5" ) );
+        attrs.put( new AttributeImpl( "attr6", "attr 6" ) );
+        attrs.put( new AttributeImpl( "attr7", "attr 7" ) );
+        attrs.put( new AttributeImpl( "attr8", "attr 8" ) );
+        attrs.put( new AttributeImpl( "attr9", "attr 9" ) );
+        attrs.put( new AttributeImpl( "attr10", "attr 10" ) );
+        attrs.put( new AttributeImpl( "attr11", "attr 11" ) );
+        attrs.put( new AttributeImpl( "attr12", "attr 12" ) );
+        attrs.put( new AttributeImpl( "attr13", "attr 13" ) );
+        attrs.put( new AttributeImpl( "attr14", "attr 14" ) );
         
-        Attribute attr = new BasicAttribute( "description", PERSON_DESCRIPTION );
+        Attribute attr = new AttributeImpl( "description", PERSON_DESCRIPTION );
 
         attrs.put( attr );
         
@@ -276,8 +276,8 @@
     public void testTwoDescriptionDirServer643() throws NamingException
     {
         // Change description attribute
-        Attributes attrs = new BasicAttributes( true );
-        Attribute attr = new BasicAttribute( "description", "a British singer-songwriter with an expressive four-octave voice" );
+        Attributes attrs = new AttributesImpl( true );
+        Attribute attr = new AttributeImpl( "description", "a British singer-songwriter with an expressive four-octave voice" );
         attr.add( "one of the most influential female artists of the twentieth century" );
         attrs.put( attr );
         
@@ -304,10 +304,10 @@
     public void testAddDuplicateValueToExistingAttribute() throws NamingException
     {
         // modify object classes, add a new value twice
-        Attribute ocls = new BasicAttribute( "objectClass", "organizationalPerson" );
-        ModificationItem[] modItems = new ModificationItem[2];
-        modItems[0] = new ModificationItem( DirContext.ADD_ATTRIBUTE, ocls );
-        modItems[1] = new ModificationItem( DirContext.ADD_ATTRIBUTE, ocls );
+        Attribute ocls = new AttributeImpl( "objectClass", "organizationalPerson" );
+        ModificationItemImpl[] modItems = new ModificationItemImpl[2];
+        modItems[0] = new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, ocls );
+        modItems[1] = new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, ocls );
         try
         {
             ctx.modifyAttributes( RDN, modItems );
@@ -336,10 +336,10 @@
     public void testAddDuplicateValueToNewAttribute() throws NamingException
     {
         // add the same description value twice
-        Attribute desc = new BasicAttribute( "description", "another description value besides songwriter" );
-        ModificationItem[] modItems = new ModificationItem[2];
-        modItems[0] = new ModificationItem( DirContext.ADD_ATTRIBUTE, desc );
-        modItems[1] = new ModificationItem( DirContext.ADD_ATTRIBUTE, desc );
+        Attribute desc = new AttributeImpl( "description", "another description value besides songwriter" );
+        ModificationItemImpl[] modItems = new ModificationItemImpl[2];
+        modItems[0] = new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, desc );
+        modItems[1] = new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, desc );
         try
         {
             ctx.modifyAttributes( RDN, modItems );
@@ -399,7 +399,7 @@
     {
         // Add a not existing attribute
         String newValue = "unbelievable";
-        Attributes attrs = new BasicAttributes( "voice", newValue );
+        Attributes attrs = new AttributesImpl( "voice", newValue );
 
         try
         {
@@ -431,19 +431,19 @@
         String[] descriptions = {
                 "Kate Bush is a British singer-songwriter.",
                 "She has become one of the most influential female artists of the twentieth century." };
-        Attribute desc1 = new BasicAttribute("description");
+        Attribute desc1 = new AttributeImpl("description");
         desc1.add(descriptions[0]);
         desc1.add(descriptions[1]);
 
-        ModificationItem addModOp = new ModificationItem(
+        ModificationItemImpl addModOp = new ModificationItemImpl(
                 DirContext.ADD_ATTRIBUTE, desc1);
 
-        Attribute desc2 = new BasicAttribute("description");
+        Attribute desc2 = new AttributeImpl("description");
         desc2.add(descriptions[1]);
-        ModificationItem delModOp = new ModificationItem(
+        ModificationItemImpl delModOp = new ModificationItemImpl(
                 DirContext.REMOVE_ATTRIBUTE, desc2);
 
-        ctx.modifyAttributes(rdn, new ModificationItem[] { addModOp,
+        ctx.modifyAttributes(rdn, new ModificationItemImpl[] { addModOp,
                         delModOp });
 
         SearchControls sctls = new SearchControls();
@@ -518,8 +518,8 @@
      */
     public void testModifyAddWithInvalidNumberOfAttributeValues() throws NamingException
     {
-        Attributes attrs = new BasicAttributes();
-        Attribute ocls = new BasicAttribute( "objectClass" );
+        Attributes attrs = new AttributesImpl();
+        Attribute ocls = new AttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "inetOrgPerson" );
         attrs.put( ocls );
@@ -528,8 +528,8 @@
         ctx.createSubcontext( "cn=Fiona Apple", attrs );
         
         // add two displayNames to an inetOrgPerson
-        attrs = new BasicAttributes();
-        Attribute displayName = new BasicAttribute( "displayName" );
+        attrs = new AttributesImpl();
+        Attribute displayName = new AttributeImpl( "displayName" );
         displayName.add( "Fiona" );
         displayName.add( "Fiona A." );
         attrs.put( displayName );

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java Sun Jan  7 18:44:33 2007
@@ -26,13 +26,13 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -53,8 +53,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java Sun Jan  7 18:44:33 2007
@@ -26,12 +26,9 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InvalidAttributeIdentifierException;
 import javax.naming.directory.InvalidAttributeValueException;
-import javax.naming.directory.ModificationItem;
 import javax.naming.directory.NoSuchAttributeException;
 import javax.naming.directory.SchemaViolationException;
 import javax.naming.directory.SearchControls;
@@ -40,6 +37,9 @@
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
 /**
@@ -62,8 +62,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -79,8 +79,8 @@
      */
     protected Attributes getInetOrgPersonAttributes( String sn, String cn )
     {
-        Attributes attrs = new BasicAttributes();
-        Attribute ocls = new BasicAttribute( "objectClass" );
+        Attributes attrs = new AttributesImpl();
+        Attribute ocls = new AttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "person" );
         ocls.add( "organizationalPerson" );
@@ -153,8 +153,8 @@
     public void testRemoveNotRequiredAttribute() throws NamingException
     {
         // Remove description Attribute
-        Attribute attr = new BasicAttribute( "description" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "description" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
         ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, attrs );
 
@@ -176,13 +176,13 @@
     public void testRemoveTwoNotRequiredAttributes() throws NamingException
     {
         // add telephoneNumber to entry
-        Attributes tn = new BasicAttributes( "telephoneNumber", "12345678" );
+        Attributes tn = new AttributesImpl( "telephoneNumber", "12345678" );
         ctx.modifyAttributes( RDN, DirContext.ADD_ATTRIBUTE, tn );
 
         // Remove description and telephoneNumber to Attribute
-        Attributes attrs = new BasicAttributes();
-        attrs.put( new BasicAttribute( "description" ) );
-        attrs.put( new BasicAttribute( "telephoneNumber" ) );
+        Attributes attrs = new AttributesImpl();
+        attrs.put( new AttributeImpl( "description" ) );
+        attrs.put( new AttributeImpl( "telephoneNumber" ) );
         ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, attrs );
 
         // Verify, that attributes are deleted
@@ -205,8 +205,8 @@
     public void testRemoveRequiredAttribute() throws NamingException
     {
         // Remove sn attribute
-        Attribute attr = new BasicAttribute( "sn" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "sn" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
 
         try
@@ -231,8 +231,8 @@
     public void testRemovePartOfRdn() throws NamingException
     {
         // Remove sn attribute
-        Attribute attr = new BasicAttribute( "cn" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "cn" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
 
         try
@@ -262,8 +262,8 @@
         ctx.rename( RDN, newRdn );
 
         // Remove description, which is now RDN attribute
-        Attribute attr = new BasicAttribute( "description" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "description" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
 
         try
@@ -293,8 +293,8 @@
     public void testRemoveAttributeNotPresent() throws NamingException
     {
         // Remove telephoneNumber Attribute
-        Attribute attr = new BasicAttribute( "telephoneNumber" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "telephoneNumber" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
 
         try
@@ -319,8 +319,8 @@
     public void testRemoveAttributeNotValid() throws NamingException
     {
         // Remove phantasy attribute
-        Attribute attr = new BasicAttribute( "XXX" );
-        Attributes attrs = new BasicAttributes();
+        Attribute attr = new AttributeImpl( "XXX" );
+        Attributes attrs = new AttributesImpl();
         attrs.put( attr );
 
         try
@@ -351,9 +351,9 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute givenName with empty value (=> deletion)
-        Attribute attr = new BasicAttribute( "givenname" );
-        ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
-        ctx.modifyAttributes( rdn, new ModificationItem[] { item } );
+        Attribute attr = new AttributeImpl( "givenname" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
+        ctx.modifyAttributes( rdn, new ModificationItemImpl[] { item } );
 
         SearchControls sctls = new SearchControls();
         sctls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
@@ -394,12 +394,12 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute cn with empty value (=> deletion)
-        Attribute attr = new BasicAttribute( "cn" );
-        ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
+        Attribute attr = new AttributeImpl( "cn" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
 
         try
         {
-            ctx.modifyAttributes( rdn, new ModificationItem[]
+            ctx.modifyAttributes( rdn, new ModificationItemImpl[]
                 { item } );
             fail( "modify should fail" );
         }
@@ -424,12 +424,12 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute cn with empty value (=> deletion)
-        Attribute attr = new BasicAttribute( "cn" );
-        ModificationItem item = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, attr );
+        Attribute attr = new AttributeImpl( "cn" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REMOVE_ATTRIBUTE, attr );
 
         try
         {
-            ctx.modifyAttributes( rdn, new ModificationItem[]
+            ctx.modifyAttributes( rdn, new ModificationItemImpl[]
                 { item } );
             fail( "modify should fail" );
         }
@@ -454,12 +454,12 @@
         ctx.createSubcontext( rdn, attrs );
 
         // replace attribute cn with empty value (=> deletion)
-        Attribute attr = new BasicAttribute( "cn", "Kate Bush" );
-        ModificationItem item = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, attr );
+        Attribute attr = new AttributeImpl( "cn", "Kate Bush" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REMOVE_ATTRIBUTE, attr );
 
         try
         {
-            ctx.modifyAttributes( rdn, new ModificationItem[]
+            ctx.modifyAttributes( rdn, new ModificationItemImpl[]
                 { item } );
             fail( "modify should fail" );
         }
@@ -481,10 +481,10 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext(rdn, attrs);
 
-        ModificationItem delModOp = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, new BasicAttribute("objectclass", ""));
+        ModificationItemImpl delModOp = new ModificationItemImpl(DirContext.REMOVE_ATTRIBUTE, new AttributeImpl("objectclass", ""));
 
         try {
-            ctx.modifyAttributes(rdn, new ModificationItem[] { delModOp });
+            ctx.modifyAttributes(rdn, new ModificationItemImpl[] { delModOp });
             fail("deletion of objectclass should fail");
         } catch (SchemaViolationException e) {
             // expected
@@ -508,10 +508,10 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext(rdn, attrs);
 
-        ModificationItem delModOp = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, new BasicAttribute("objectclass"));
+        ModificationItemImpl delModOp = new ModificationItemImpl(DirContext.REMOVE_ATTRIBUTE, new AttributeImpl("objectclass"));
 
         try {
-            ctx.modifyAttributes(rdn, new ModificationItem[] { delModOp });
+            ctx.modifyAttributes(rdn, new ModificationItemImpl[] { delModOp });
             fail("deletion of objectclass should fail");
         } catch (SchemaViolationException e) {
             // expected

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java Sun Jan  7 18:44:33 2007
@@ -27,15 +27,15 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
-import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
 /**
@@ -51,8 +51,8 @@
 
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attrs = new BasicAttributes();
-        Attribute ocls = new BasicAttribute( "objectClass" );
+        Attributes attrs = new AttributesImpl();
+        Attribute ocls = new AttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "person" );
         attrs.put( ocls );
@@ -94,10 +94,10 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext( rdn, attrs );
 
-        Attribute attr = new BasicAttribute( "description" );
-        ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
+        Attribute attr = new AttributeImpl( "description" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
 
-        ctx.modifyAttributes( rdn, new ModificationItem[]
+        ctx.modifyAttributes( rdn, new ModificationItemImpl[]
             { item } );
 
         SearchControls sctls = new SearchControls();
@@ -128,10 +128,10 @@
         String rdn = "cn=Kate Bush";
         ctx.createSubcontext( rdn, attrs );
 
-        Attribute attr = new BasicAttribute( "numberOfOctaves" );
-        ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
+        Attribute attr = new AttributeImpl( "numberOfOctaves" );
+        ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
 
-        ctx.modifyAttributes( rdn, new ModificationItem[]
+        ctx.modifyAttributes( rdn, new ModificationItemImpl[]
             { item } );
 
         SearchControls sctls = new SearchControls();

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java Sun Jan  7 18:44:33 2007
@@ -26,8 +26,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
 import javax.naming.directory.SearchResult;
@@ -46,6 +44,8 @@
 import org.apache.directory.shared.ldap.codec.search.controls.ChangeType;
 import org.apache.directory.shared.ldap.codec.search.controls.EntryChangeControl;
 import org.apache.directory.shared.ldap.codec.search.controls.EntryChangeControlDecoder;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.PersistentSearchControl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -70,8 +70,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -139,7 +139,7 @@
         }
         Thread.sleep( 250 );
 
-        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "description", PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new AttributesImpl( "description", PERSON_DESCRIPTION,
             true ) );
         long start = System.currentTimeMillis();
         while ( t.isAlive() )
@@ -270,7 +270,7 @@
         }
         Thread.sleep( 250 );
 
-        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "description", PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new AttributesImpl( "description", PERSON_DESCRIPTION,
             true ) );
         long start = System.currentTimeMillis();
         while ( t.isAlive() )
@@ -451,7 +451,7 @@
         assertNull( listener.result );
 
         // thread is still waiting for notifications try a modify
-        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "description", PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new AttributesImpl( "description", PERSON_DESCRIPTION,
             true ) );
         start = System.currentTimeMillis();
         while ( t.isAlive() )
@@ -593,7 +593,7 @@
         // assertNull( listener.result );
 
         // thread is still waiting for notifications try a modify
-        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "description", PERSON_DESCRIPTION,
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new AttributesImpl( "description", PERSON_DESCRIPTION,
             true ) );
         start = System.currentTimeMillis();
         while ( t.isAlive() )

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ReferralTest.java Sun Jan  7 18:44:33 2007
@@ -35,16 +35,16 @@
 import javax.naming.ReferralException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
-import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
 /**
@@ -63,8 +63,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attributes.put( attribute );
@@ -131,7 +131,7 @@
         // -------------------------------------------------------------------
 
         // Add a referral entry ( should be fine with or without the control )
-        Attributes referral = new BasicAttributes( "objectClass", "top", true );
+        Attributes referral = new AttributesImpl( "objectClass", "top", true );
         referral.get( "objectClass" ).add( "referral" );
         referral.get( "objectClass" ).add( "extensibleObject" );
         referral.put( "ref", ref0 );
@@ -205,7 +205,7 @@
         // -------------------------------------------------------------------
 
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
-        Attributes userEntry = new BasicAttributes( "objectClass", "top", true );
+        Attributes userEntry = new AttributesImpl( "objectClass", "top", true );
         userEntry.get( "objectClass" ).add( "person" );
         userEntry.put( "sn", "karasulu" );
         userEntry.put( "cn", "alex karasulu" );
@@ -236,7 +236,7 @@
         // -------------------------------------------------------------------
 
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
-        Attributes userEntry = new BasicAttributes( "objectClass", "top", true );
+        Attributes userEntry = new AttributesImpl( "objectClass", "top", true );
         userEntry.get( "objectClass" ).add( "person" );
         userEntry.put( "sn", "karasulu" );
         userEntry.put( "cn", "alex karasulu" );
@@ -324,7 +324,7 @@
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
         try
         {
-            td.refCtx.modifyAttributes( "cn=alex karasulu", DirContext.ADD_ATTRIBUTE, new BasicAttributes(
+            td.refCtx.modifyAttributes( "cn=alex karasulu", DirContext.ADD_ATTRIBUTE, new AttributesImpl(
                 "description", "just some text", true ) );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -352,7 +352,7 @@
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
         try
         {
-            td.refCtx.modifyAttributes( "cn=alex karasulu,ou=apache", DirContext.ADD_ATTRIBUTE, new BasicAttributes(
+            td.refCtx.modifyAttributes( "cn=alex karasulu,ou=apache", DirContext.ADD_ATTRIBUTE, new AttributesImpl(
                 "description", "just some text", true ) );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -380,8 +380,8 @@
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
         try
         {
-            ModificationItem[] mods = new ModificationItem[]
-                { new ModificationItem( DirContext.ADD_ATTRIBUTE, new BasicAttribute( "description", "just some text" ) ) };
+            ModificationItemImpl[] mods = new ModificationItemImpl[]
+                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new AttributeImpl( "description", "just some text" ) ) };
             td.refCtx.modifyAttributes( "cn=alex karasulu", mods );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -409,8 +409,8 @@
         td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
         try
         {
-            ModificationItem[] mods = new ModificationItem[]
-                { new ModificationItem( DirContext.ADD_ATTRIBUTE, new BasicAttribute( "description", "just some text" ) ) };
+            ModificationItemImpl[] mods = new ModificationItemImpl[]
+                { new ModificationItemImpl( DirContext.ADD_ATTRIBUTE, new AttributeImpl( "description", "just some text" ) ) };
             td.refCtx.modifyAttributes( "cn=alex karasulu,ou=apache", mods );
             fail( "Should fail here throwing a ReferralException" );
         }
@@ -728,7 +728,7 @@
     public void createLocalUser() throws Exception
     {
         LdapContext userCtx = null;
-        Attributes referral = new BasicAttributes( "objectClass", "top", true );
+        Attributes referral = new AttributesImpl( "objectClass", "top", true );
         referral.get( "objectClass" ).add( "person" );
         referral.put( "cn", "akarasulu" );
         referral.put( "sn", "karasulu" );
@@ -757,7 +757,7 @@
     public void createDeepLocalUser() throws Exception
     {
         LdapContext userCtx = null;
-        Attributes referral = new BasicAttributes( "objectClass", "top", true );
+        Attributes referral = new AttributesImpl( "objectClass", "top", true );
         referral.get( "objectClass" ).add( "person" );
         referral.put( "cn", "akarasulu" );
         referral.put( "sn", "karasulu" );
@@ -778,7 +778,7 @@
         }
         try
         {
-            Attributes ouAttrs = new BasicAttributes( "objectClass", "top", true );
+            Attributes ouAttrs = new AttributesImpl( "objectClass", "top", true );
             ouAttrs.get( "objectClass" ).add( "organizationalUnit" );
             ouAttrs.put( "ou", "deep" );
             td.rootCtx.createSubcontext( "ou=deep", ouAttrs );

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/SearchTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/SearchTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/SearchTest.java Sun Jan  7 18:44:33 2007
@@ -27,11 +27,9 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
-import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.Control;
@@ -40,6 +38,8 @@
 
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.SubentriesControl;
 
 
@@ -109,8 +109,8 @@
      */
     protected Attributes getPersonAttributes( String sn, String cn )
     {
-        Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute( "objectClass" );
+        Attributes attributes = new AttributesImpl();
+        Attribute attribute = new AttributeImpl( "objectClass" );
         attribute.add( "top" );
         attribute.add( "person" );
         attribute.add( "organizationalPerson" );
@@ -476,13 +476,13 @@
         Attribute administrativeRole = ap.get( "administrativeRole" );
         if ( administrativeRole == null || !administrativeRole.contains( SubentryService.AC_AREA ) )
         {
-            Attributes changes = new BasicAttributes( "administrativeRole", SubentryService.AC_AREA, true );
+            Attributes changes = new AttributesImpl( "administrativeRole", SubentryService.AC_AREA, true );
             adminCtx.modifyAttributes( "", DirContext.ADD_ATTRIBUTE, changes );
         }
 
         // now add the A/C subentry below ou=system
-        Attributes subentry = new BasicAttributes( "cn", cn, true );
-        Attribute objectClass = new BasicAttribute( "objectClass" );
+        Attributes subentry = new AttributesImpl( "cn", cn, true );
+        Attribute objectClass = new AttributeImpl( "objectClass" );
         subentry.put( objectClass );
         objectClass.add( "top" );
         objectClass.add( "subentry" );
@@ -501,8 +501,8 @@
     {
 
         // Create entry
-        Attributes heather = new BasicAttributes();
-        Attribute ocls = new BasicAttribute( "objectClass" );
+        Attributes heather = new AttributesImpl();
+        Attribute ocls = new AttributeImpl( "objectClass" );
         ocls.add( "top" );
         ocls.add( "person" );
         heather.put( ocls );
@@ -544,7 +544,7 @@
     {
 
         // Create entry
-        Attributes kate = new BasicAttributes();
+        Attributes kate = new AttributesImpl();
         kate.put( "objectClass", "organizationalperson" );
         kate.put( "cn", "Kate Bush" );
         kate.put( "sn", "Bush" );

Modified: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java (original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java Sun Jan  7 18:44:33 2007
@@ -29,13 +29,13 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 
 import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
 import org.apache.directory.server.core.unit.AbstractAdminTestCase;
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -53,7 +53,7 @@
 
     public void setUp() throws Exception
     {
-        BasicAttributes attrs;
+        Attributes attrs;
         Set indexedAttrs;
         Set pcfgs = new HashSet();
 
@@ -69,13 +69,13 @@
         indexedAttrs.add( "objectClass" );
         pcfg.setIndexedAttributes( indexedAttrs );
 
-        attrs = new BasicAttributes( true );
-        BasicAttribute attr = new BasicAttribute( "objectClass" );
+        attrs = new AttributesImpl( true );
+        Attribute attr = new AttributeImpl( "objectClass" );
         attr.add( "top" );
         attr.add( "organizationalUnit" );
         attr.add( "extensibleObject" );
         attrs.put( attr );
-        attr = new BasicAttribute( "ou" );
+        attr = new AttributeImpl( "ou" );
         attr.add( "testing" );
         attrs.put( attr );
         pcfg.setContextEntry( attrs );
@@ -93,13 +93,13 @@
         indexedAttrs.add( "objectClass" );
         pcfg.setIndexedAttributes( indexedAttrs );
 
-        attrs = new BasicAttributes( true );
-        attr = new BasicAttribute( "objectClass" );
+        attrs = new AttributesImpl( true );
+        attr = new AttributeImpl( "objectClass" );
         attr.add( "top" );
         attr.add( "domain" );
         attr.add( "extensibleObject" );
         attrs.put( attr );
-        attr = new BasicAttribute( "dc" );
+        attr = new AttributeImpl( "dc" );
         attr.add( "example" );
         attrs.put( attr );
         pcfg.setContextEntry( attrs );
@@ -116,13 +116,13 @@
         indexedAttrs.add( "objectClass" );
         pcfg.setIndexedAttributes( indexedAttrs );
 
-        attrs = new BasicAttributes( true );
-        attr = new BasicAttribute( "objectClass" );
+        attrs = new AttributesImpl( true );
+        attr = new AttributeImpl( "objectClass" );
         attr.add( "top" );
         attr.add( "domain" );
         attr.add( "extensibleObject" );
         attrs.put( attr );
-        attr = new BasicAttribute( "dc" );
+        attr = new AttributeImpl( "dc" );
         attr.add( "MixedCase" );
         attrs.put( attr );
         pcfg.setContextEntry( attrs );

Modified: directory/branches/shared/0.9.5/ldap/src/main/antlr/ACIItem.g
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/antlr/ACIItem.g?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/antlr/ACIItem.g (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/antlr/ACIItem.g Sun Jan  7 18:44:33 2007
@@ -25,16 +25,11 @@
 
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.Enumeration;
 
-import javax.naming.directory.Attribute;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.NamingException;
-
 import org.apache.directory.shared.ldap.filter.AbstractExprNode;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -51,6 +46,7 @@
 import org.apache.directory.shared.ldap.util.NoDuplicateKeysMap;
 import org.apache.directory.shared.ldap.util.OptionalComponentsMonitor;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -500,7 +496,7 @@
             attributeTypeAndValue = ( String ) attributeTypeAndValueSet.nextElement();
             attributeType = NamespaceTools.getRdnAttribute( attributeTypeAndValue );
             attributeValue = NamespaceTools.getRdnValue( attributeTypeAndValue );
-            attributeSet.add( new BasicAttribute( attributeType, attributeValue ) );
+            attributeSet.add( new AttributeImpl( attributeType, attributeValue ) );
             log.debug( "An attributeTypeAndValue from the set: " + attributeType + "=" +  attributeValue);
         }
         m_protectedItemsMap.put( "attributeValue", new ProtectedItem.AttributeValue( attributeSet ) );

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java Sun Jan  7 18:44:33 2007
@@ -346,7 +346,7 @@
          * @param attributes
          *            the collection of {@link Attribute}s.
          */
-        public AttributeValue(Collection attributes)
+        public AttributeValue( Collection attributes )
         {
             for ( Iterator i = attributes.iterator(); i.hasNext(); )
             {
@@ -355,6 +355,7 @@
                     throw new IllegalArgumentException( "attributeTypes contains an element which is not an attribute." );
                 }
             }
+            
             this.attributes = Collections.unmodifiableCollection( new ArrayList( attributes ) );
         }
 

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java Sun Jan  7 18:44:33 2007
@@ -26,8 +26,6 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attribute;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.ModificationItem;
 import javax.naming.ldap.Control;
 
 import org.apache.directory.shared.asn1.Asn1Object;
@@ -92,6 +90,7 @@
 import org.apache.directory.shared.ldap.message.LdapResultImpl;
 import org.apache.directory.shared.ldap.message.Message;
 import org.apache.directory.shared.ldap.message.MessageTypeEnum;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ModifyDnRequestImpl;
 import org.apache.directory.shared.ldap.message.ModifyDnResponseImpl;
 import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
@@ -371,7 +370,7 @@
             // Loop through the modifications
             while ( modifications.hasNext() )
             {
-                snickersMessage.addModification( ( ModificationItem ) modifications.next() );
+                snickersMessage.addModification( ( ModificationItemImpl ) modifications.next() );
             }
         }
 
@@ -656,7 +655,7 @@
             {
                 while ( attributes.hasMoreElements() )
                 {
-                    Attribute attribute = ( BasicAttribute ) attributes.nextElement();
+                    Attribute attribute = ( Attribute ) attributes.nextElement();
 
                     if ( attribute != null )
                     {

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java Sun Jan  7 18:44:33 2007
@@ -26,6 +26,8 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -42,8 +44,6 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 
 
 /**
@@ -127,7 +127,7 @@
      */
     public void initAttributes()
     {
-        attributes = new BasicAttributes( true );
+        attributes = new AttributesImpl( true );
     }
 
 
@@ -156,7 +156,7 @@
         }
         
         // fix this to use LockableAttributeImpl(type.getString().toLowerCase())
-        currentAttribute = new BasicAttribute( type.toLowerCase() );
+        currentAttribute = new AttributeImpl( type.toLowerCase() );
         attributes.put( currentAttribute );
     }
 

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequest.java Sun Jan  7 18:44:33 2007
@@ -26,6 +26,8 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -41,9 +43,7 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
-import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.DirContext;
-import javax.naming.directory.ModificationItem;
 
 
 /**
@@ -180,7 +180,7 @@
      */
     public void addAttributeTypeAndValues( String type )
     {
-        currentAttribute = new BasicAttribute( StringTools.lowerCase( type ) );
+        currentAttribute = new AttributeImpl( StringTools.lowerCase( type ) );
 
         int operation = 0;
 
@@ -200,7 +200,7 @@
                 break;
         }
 
-        ModificationItem modification = new ModificationItem( operation, currentAttribute );
+        ModificationItemImpl modification = new ModificationItemImpl( operation, currentAttribute );
         modifications.add( modification );
     }
 
@@ -330,7 +330,7 @@
                 int localModificationSequenceLength = 1 + 1 + 1;
                 int localValuesLength = 0;
 
-                ModificationItem modification = ( ModificationItem ) modificationsIterator.next();
+                ModificationItemImpl modification = ( ModificationItemImpl ) modificationsIterator.next();
 
                 // Modification length initialized with the type
                 int typeLength = modification.getAttribute().getID().length();
@@ -448,7 +448,7 @@
                 // Compute the modifications length
                 while ( modificationIterator.hasNext() )
                 {
-                    ModificationItem modification = ( ModificationItem ) modificationIterator.next();
+                    ModificationItemImpl modification = ( ModificationItemImpl ) modificationIterator.next();
 
                     // The modification sequence
                     buffer.put( UniversalTag.SEQUENCE_TAG );
@@ -551,7 +551,7 @@
             for ( int i = 0; i < modifications.size(); i++ )
             {
 
-                ModificationItem modification = ( ModificationItem ) modifications.get( i );
+                ModificationItemImpl modification = ( ModificationItemImpl ) modifications.get( i );
 
                 sb.append( "            Modification[" ).append( i ).append( "]\n" );
                 sb.append( "                Operation : " );

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java Sun Jan  7 18:44:33 2007
@@ -30,6 +30,8 @@
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 import java.io.UnsupportedEncodingException;
@@ -39,8 +41,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 
 
 /**
@@ -113,7 +113,7 @@
         super();
 
         currentFilter = null;
-        attributes = new BasicAttributes( true );
+        attributes = new AttributesImpl( true );
     }
 
 
@@ -149,7 +149,7 @@
      */
     public void addAttribute( String attribute )
     {
-        attributes.put( new BasicAttribute( attribute ) );
+        attributes.put( new AttributeImpl( attribute ) );
     }
 
 
@@ -487,7 +487,7 @@
             // Compute the attributes length
             while ( attributeIterator.hasMoreElements() )
             {
-                Attribute attribute = ( BasicAttribute ) attributeIterator.nextElement();
+                Attribute attribute = ( Attribute ) attributeIterator.nextElement();
 
                 // add the attribute length to the attributes length
                 try
@@ -581,7 +581,7 @@
                 // encode each attribute
                 while ( attributeIterator.hasMoreElements() )
                 {
-                    Attribute attribute = ( BasicAttribute ) attributeIterator.nextElement();
+                    Attribute attribute = ( Attribute ) attributeIterator.nextElement();
 
                     Value.encode( buffer, attribute.getID() );
                 }
@@ -630,7 +630,7 @@
             {
                 while ( attrs.hasMoreElements() )
                 {
-                    Attribute attr = ( BasicAttribute ) attrs.nextElement();
+                    Attribute attr = ( Attribute ) attrs.nextElement();
         
                     if ( isFirst )
                     {

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java Sun Jan  7 18:44:33 2007
@@ -26,6 +26,8 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessage;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -39,8 +41,6 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 
 
 /**
@@ -99,7 +99,7 @@
     public SearchResultEntry()
     {
         super();
-        partialAttributeList = new BasicAttributes( true );
+        partialAttributeList = new AttributesImpl( true );
     }
 
 
@@ -166,7 +166,7 @@
      */
     public void addAttributeValues( String type )
     {
-        currentAttributeValue = new BasicAttribute( StringTools.lowerCase( type ) );
+        currentAttributeValue = new AttributeImpl( StringTools.lowerCase( type ) );
 
         partialAttributeList.put( currentAttributeValue );
     }
@@ -179,7 +179,7 @@
      */
     public void addAttributeValue( Object value )
     {
-        currentAttributeValue.add( value );
+        currentAttributeValue.add( AttributeUtils.cloneValue( value ) );
     }
 
 

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/filter/Assertion.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/filter/Assertion.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/filter/Assertion.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/filter/Assertion.java Sun Jan  7 18:44:33 2007
@@ -40,13 +40,13 @@
      * if they were previously accessed. All assertions should handle cases
      * where the entry argument is null.
      * 
-     * @param a_dn
+     * @param dn
      *            the normalized dn of the candidate entry to be tested
-     * @param a_entry
+     * @param entry
      *            the entry's attributes if available
      * @return true if the candidate satisfies the predicate, false otherwise
      * @throws NamingException
      *             if an error occurs while asserting the predicate
      */
-    boolean assertCandidate( String a_dn, Attributes a_entry ) throws NamingException;
+    boolean assertCandidate( String dn, Attributes entry ) throws NamingException;
 }

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java Sun Jan  7 18:44:33 2007
@@ -31,12 +31,13 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
-import javax.naming.directory.ModificationItem;
 import javax.naming.ldap.Control;
 
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
+import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 /**
@@ -70,7 +71,7 @@
     private boolean deleteOldRdn;
 
     /** attributes of the entry */
-    private BasicAttributes attributeList;
+    private Attributes attributeList;
 
     /** The possible change types */
     public final static int ADD = 0;
@@ -95,7 +96,7 @@
         modificationList = new LinkedList();
         modificationItems = new HashMap();
         dn = null;
-        attributeList = new BasicAttributes( true );
+        attributeList = new AttributesImpl( true );
         control = null;
     }
 
@@ -157,12 +158,16 @@
      * 
      * @param modification The modification to be added
      */
-    public void addModificationItem( ModificationItem modification )
+    public void addModificationItem( ModificationItemImpl modification )
     {
         if ( changeType == MODIFY )
         {
-            modificationList.add( modification );
-            modificationItems.put( modification.getAttribute().getID(), modification );
+            // First, copy the ModificationItem to an internal one
+            ModificationItemImpl newModification =  new ModificationItemImpl( modification );
+            
+            // then add it to the list
+            modificationList.add( newModification );
+            modificationItems.put( newModification.getAttribute().getID(), newModification );
         }
     }
 
@@ -182,19 +187,19 @@
         {
             if ( modificationItems.containsKey( attr.getID() ) )
             {
-                ModificationItem item = (ModificationItem) modificationItems.get( attr.getID() );
+                ModificationItemImpl item = (ModificationItemImpl) modificationItems.get( attr.getID() );
                 Attribute attribute = item.getAttribute();
 
                 Enumeration attrs = attr.getAll();
 
                 while ( attrs.hasMoreElements() )
                 {
-                    attribute.add( attrs.nextElement() );
+                    attribute.add( AttributeUtils.cloneValue( attrs.nextElement() ) );
                 }
             }
             else
             {
-                ModificationItem item = new ModificationItem( modOp, attr );
+                ModificationItemImpl item = new ModificationItemImpl( modOp, attr );
                 modificationList.add( item );
                 modificationItems.put( attr.getID(), item );
             }
@@ -217,11 +222,11 @@
     {
         if ( changeType == MODIFY )
         {
-            BasicAttribute attr = new BasicAttribute( id, value );
+            Attribute attr = new AttributeImpl( id, value );
 
             if ( modificationItems.containsKey( id ) )
             {
-                ModificationItem item = (ModificationItem) modificationItems.get( id );
+                ModificationItemImpl item = (ModificationItemImpl) modificationItems.get( id );
                 
                 if ( item.getModificationOp() != modOp )
                 {
@@ -237,7 +242,7 @@
             }
             else
             {
-                ModificationItem item = new ModificationItem( modOp, attr );
+                ModificationItemImpl item = new ModificationItemImpl( modOp, attr );
                 modificationList.add( item );
                 modificationItems.put( id, item );
             }
@@ -247,12 +252,11 @@
     /**
      * Add an attribute to the entry
      * 
-     * @param attr
-     *            The attribute to be added
+     * @param attr The attribute to be added
      */
     public void addAttribute( Attribute attr )
     {
-        attributeList.put( attr );
+        attributeList.put( AttributeUtils.toAttributeImpl( attr ) );
     }
 
     /**
@@ -349,7 +353,7 @@
     {
         if ( "dn".equalsIgnoreCase( attributeId ) )
         {
-            return new BasicAttribute( "dn", dn );
+            return new AttributeImpl( "dn", dn );
         }
 
         return attributeList.get( attributeId );
@@ -504,10 +508,8 @@
         {
             for ( Iterator iter = modificationList.iterator(); iter.hasNext(); )
             {
-                ModificationItem modif = (ModificationItem) ( iter.next() );
-                ModificationItem modifClone = new ModificationItem( modif.getModificationOp(), (Attribute) modif.getAttribute()
-                        .clone() );
-                clone.modificationList.add( modifClone );
+                ModificationItemImpl modif = (ModificationItemImpl)iter.next();
+                clone.modificationList.add( modif.clone() );
             }
         }
 
@@ -516,8 +518,8 @@
             for ( Iterator iter = modificationItems.entrySet().iterator(); iter.hasNext(); )
             {
                 Object key = iter.next();
-                ModificationItem modif = (ModificationItem) ( modificationItems.get( key ) );
-                ModificationItem modifClone = new ModificationItem( modif.getModificationOp(), (Attribute) modif.getAttribute()
+                ModificationItemImpl modif = (ModificationItemImpl) ( modificationItems.get( key ) );
+                ModificationItemImpl modifClone = new ModificationItemImpl( modif.getModificationOp(), (Attribute) modif.getAttribute()
                         .clone() );
                 clone.modificationItems.put( key, modifClone );
             }
@@ -526,39 +528,7 @@
 
         if ( attributeList != null )
         {
-            try
-            {
-                NamingEnumeration attrs = attributeList.getAll();
-
-                while ( attrs.hasMore() )
-                {
-                    Attribute attribute = (BasicAttribute) attrs.nextElement();
-                    Attribute attrClone = new BasicAttribute( attribute.getID() );
-
-                    for ( NamingEnumeration iter = attribute.getAll(); iter.hasMoreElements(); )
-                    {
-                        Object value = iter.next();
-
-                        if ( value instanceof String )
-                        {
-                            attrClone.add( value );
-                        }
-                        else if ( value instanceof byte[] )
-                        {
-                            int length = ( (byte[]) value ).length;
-                            byte[] valueClone = new byte[length];
-                            System.arraycopy( value, 0, valueClone, 0, length );
-                            attrClone.add( valueClone );
-                        }
-                    }
-
-                    clone.attributeList.put( attrClone );
-                }
-            }
-            catch (NamingException ne)
-            {
-                throw new CloneNotSupportedException( ne.getMessage() );
-            }
+            clone.attributeList = (Attributes)attributeList.clone();
         }
 
         return clone;
@@ -611,7 +581,7 @@
         
         for ( Iterator iter = modificationList.iterator(); iter.hasNext(); )
         {
-            ModificationItem modif = (ModificationItem) ( iter.next() );
+            ModificationItemImpl modif = (ModificationItemImpl) ( iter.next() );
             
             sb.append( "            Operation: " );
             

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java Sun Jan  7 18:44:33 2007
@@ -41,12 +41,12 @@
 import javax.naming.InvalidNameException;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
-import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.DirContext;
 import javax.naming.ldap.Control;
 
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.primitives.OID;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.name.LdapDnParser;
 import org.apache.directory.shared.ldap.util.Base64;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -816,7 +816,7 @@
             Object attributeValue = parseSimpleValue( line, colonIndex );
 
             // Create an attribute
-            return new BasicAttribute( attributeType, attributeValue );
+            return new AttributeImpl( attributeType, attributeValue );
         }
         else
         {

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java Sun Jan  7 18:44:33 2007
@@ -127,7 +127,9 @@
 		while ( ne.hasMore() )
 		{
 			Object attribute = ne.next();
-			if (attribute instanceof Attribute) {
+            
+			if (attribute instanceof Attribute) 
+            {
 				sb.append( convertToLdif( (Attribute) attribute ) );
 			}			
 		}
@@ -141,7 +143,7 @@
      * @return the corresponding LDIF code as a String
      * @throws NamingException If a naming exception is encountered.
      */
-	private static String convertToLdif(Attribute attr) throws NamingException
+	private static String convertToLdif( Attribute attr ) throws NamingException
 	{
 		StringBuffer sb = new StringBuffer();
 		

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequest.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
    (empty)

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequestImpl.java?view=diff&rev=493916&r1=493915&r2=493916
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequestImpl.java (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/message/AddRequestImpl.java Sun Jan  7 18:44:33 2007
@@ -107,7 +107,7 @@
      */
     public void setAttributes( Attributes attributes )
     {
-        this.attributes = attributes;
+        this.attributes = AttributeUtils.toAttributesImpl( attributes );
     }
 
 



Mime
View raw message