directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r638228 [16/20] - in /directory/sandbox/akarasulu/bigbang/apacheds: ./ apacheds-xbean-spring/src/site/ benchmarks/src/site/ bootstrap-extract/src/site/ bootstrap-partition/src/site/ bootstrap-plugin/src/main/java/org/apache/directory/server...
Date Tue, 18 Mar 2008 06:13:18 GMT
Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java Mon Mar 17 23:12:41 2008
@@ -20,27 +20,25 @@
 package org.apache.directory.server.core.subtree;
 
 
-import junit.framework.TestCase;
-
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
 
+import org.apache.directory.server.core.DefaultDirectoryService;
+import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerAttribute;
+import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.subtree.RefinementLeafEvaluator;
-import org.apache.directory.server.schema.bootstrap.ApacheSchema;
-import org.apache.directory.server.schema.bootstrap.BootstrapSchemaLoader;
-import org.apache.directory.server.schema.bootstrap.CoreSchema;
-import org.apache.directory.server.schema.bootstrap.Schema;
-import org.apache.directory.server.schema.bootstrap.SystemSchema;
-import org.apache.directory.server.schema.registries.DefaultOidRegistry;
-import org.apache.directory.server.schema.registries.DefaultRegistries;
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.GreaterEqNode;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
-
-import java.util.Set;
-import java.util.HashSet;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -49,38 +47,39 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class RefinementLeafEvaluatorTest extends TestCase
+public class RefinementLeafEvaluatorTest
 {
-    /** the global registries */
-    private Registries registries;
+    /** The ObjectClass AttributeType */
+    private static AttributeType OBJECT_CLASS;
+
+    /** A reference to the directory service */
+    private static DirectoryService service;
+    
+    /** the registries */
+    private static Registries registries;
+
     /** the refinement leaf evaluator to test */
     private RefinementLeafEvaluator evaluator;
 
 
     /**
      * Initializes the global registries.
-     * @throws NamingException if there is a failure loading the schema
+     * @throws javax.naming.NamingException if there is a failure loading the schema
      */
-    private void init() throws NamingException
+    @BeforeClass public static void init() throws NamingException
     {
-        BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        DefaultRegistries bsRegistries = new DefaultRegistries( "bootstrap", loader, new DefaultOidRegistry() );
-        Set<Schema> schemas = new HashSet<Schema>();
-        schemas.add( new SystemSchema() );
-        schemas.add( new ApacheSchema() );
-        schemas.add( new CoreSchema() );
-        loader.loadWithDependencies( schemas, bsRegistries );
-        registries = bsRegistries;
+        service = new DefaultDirectoryService();
+        registries = service.getRegistries();
+        OBJECT_CLASS = registries.getAttributeTypeRegistry().lookup( "objectClass" );
     }
-
+    
 
     /**
      * Initializes registries and creates the leaf evalutator
      * @throws Exception if there are schema initialization problems
      */
-    protected void setUp() throws Exception
+    @Before public void setUp() throws Exception
     {
-        init();
         OidRegistry registry = registries.getOidRegistry();
         evaluator = new RefinementLeafEvaluator( registry );
     }
@@ -89,10 +88,9 @@
     /**
      * Sets evaluator and registries to null.
      */
-    protected void tearDown()
+    @After public void tearDown()
     {
         evaluator = null;
-        registries = null;
     }
 
 
@@ -100,9 +98,9 @@
      * Test cases for various bad combinations of arguments
      * @throws Exception if something goes wrongg
      */
-    public void testForBadArguments() throws Exception
+    @Test public void testForBadArguments() throws Exception
     {
-        Attribute objectClasses = null;
+        ServerAttribute objectClasses = null;
 
         try
         {
@@ -142,56 +140,54 @@
 
         try
         {
-            objectClasses = new AttributeImpl( "incorrectAttrId" );
-            assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", "" ), objectClasses ) );
+            objectClasses = new DefaultServerAttribute( "cn", OBJECT_CLASS );
+            assertFalse( evaluator.evaluate( new EqualityNode( "cn", "" ), objectClasses ) );
             fail( "should never get here due to an IAE" );
         }
-        catch ( IllegalArgumentException iae )
+        catch ( NamingException ne )
         {
+            assertTrue( true );
         }
     }
 
 
-    public void testMatchByName() throws Exception
+    @Test public void testMatchByName() throws Exception
     {
-        Attribute objectClasses = null;
-
         // positive test
-        objectClasses = new AttributeImpl( "objectClass", "person" );
+        ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
         assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", "person" ), objectClasses ) );
 
-        objectClasses = new AttributeImpl( "objectClass" );
+        objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS );
         objectClasses.add( "person" );
         objectClasses.add( "blah" );
         assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", "person" ), objectClasses ) );
 
         // negative tests
-        objectClasses = new AttributeImpl( "objectClass", "person" );
+        objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
         assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", "blah" ), objectClasses ) );
 
-        objectClasses = new AttributeImpl( "objectClass", "blah" );
+        objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "blah" );
         assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", "person" ), objectClasses ) );
     }
 
 
-    public void testMatchByOID() throws Exception
+    @Test public void testMatchByOID() throws Exception
     {
-        Attribute objectClasses = null;
+        ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
 
         // positive test
-        objectClasses = new AttributeImpl( "objectClass", "person" );
         assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", "2.5.6.6" ), objectClasses ) );
 
-        objectClasses = new AttributeImpl( "objectClass" );
+        objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS );
         objectClasses.add( "person" );
         objectClasses.add( "blah" );
         assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", "2.5.6.6" ), objectClasses ) );
 
         // negative tests
-        objectClasses = new AttributeImpl( "objectClass", "person" );
+        objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
         assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", "2.5.6.5" ), objectClasses ) );
 
-        objectClasses = new AttributeImpl( "objectClass", "blah" );
+        objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "blah" );
         assertFalse( evaluator.evaluate( new EqualityNode( "objectClass", "2.5.6.5" ), objectClasses ) );
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java Mon Mar 17 23:12:41 2008
@@ -31,10 +31,6 @@
 import java.util.Set;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.ModificationItem;
 
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.Interceptor;
@@ -59,8 +55,8 @@
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerBinaryValue;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
-import org.apache.directory.server.core.entry.ServerValue;
+import org.apache.directory.server.core.entry.ServerModification;
+import org.apache.directory.server.core.entry.ServerStringValue;
 import org.apache.directory.server.core.event.EventInterceptor;
 import org.apache.directory.server.core.trigger.TriggerInterceptor;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
@@ -70,13 +66,14 @@
 import org.apache.directory.server.kerberos.shared.io.encoder.EncryptionKeyEncoder;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
 import org.apache.directory.server.kerberos.shared.store.KerberosAttribute;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationException;
-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.AttributeUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -153,7 +150,7 @@
                 log.debug( "Adding Attribute id : 'userPassword',  Values : [ {} ]", sb.toString() );
             }
 
-            ServerValue<?> principalNameValue = entry.get( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ).get();
+            Value<?> principalNameValue = entry.get( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ).get();
             
             String principalName = (String)principalNameValue.get();
 
@@ -216,65 +213,64 @@
     void detectPasswordModification( ModifyOperationContext modContext, ModifySubContext subContext )
         throws NamingException
     {
-        List<ModificationItemImpl> mods = modContext.getModItems();
+        List<Modification> mods = modContext.getModItems();
 
         String operation = null;
 
         // Loop over attributes being modified to pick out 'userPassword' and 'krb5PrincipalName'.
-        for ( ModificationItem mod:mods )
+        for ( Modification mod:mods )
         {
             if ( log.isDebugEnabled() )
             {
-                switch ( mod.getModificationOp() )
+                switch ( mod.getOperation() )
                 {
-                    case DirContext.ADD_ATTRIBUTE:
+                    case ADD_ATTRIBUTE:
                         operation = "Adding";
                         break;
                         
-                    case DirContext.REMOVE_ATTRIBUTE:
+                    case REMOVE_ATTRIBUTE:
                         operation = "Removing";
                         break;
                         
-                    case DirContext.REPLACE_ATTRIBUTE:
+                    case REPLACE_ATTRIBUTE:
                         operation = "Replacing";
                         break;
                 }
             }
 
-            Attribute attr = mod.getAttribute();
-            String attrId = attr.getID();
+            ServerAttribute attr = (ServerAttribute)mod.getAttribute();
 
-            if ( attrId.equalsIgnoreCase( SchemaConstants.USER_PASSWORD_AT ) )
+            if ( attr.instanceOf( SchemaConstants.USER_PASSWORD_AT ) )
             {
                 Object firstValue = attr.get();
+                String password = null;
 
-                if ( firstValue instanceof String )
+                if ( firstValue instanceof ServerStringValue )
                 {
-                    log.debug( "{} Attribute id : 'userPassword',  Values : [ '{}' ]", operation, firstValue );
+                    password = ((ServerStringValue)firstValue).get();
+                    log.debug( "{} Attribute id : 'userPassword',  Values : [ '{}' ]", operation, password );
                 }
-                else if ( firstValue instanceof byte[] )
+                else if ( firstValue instanceof ServerBinaryValue )
                 {
-                    String string = StringTools.utf8ToString( ( byte[] ) firstValue );
+                    password = StringTools.utf8ToString( ((ServerBinaryValue)firstValue).get() );
 
                     if ( log.isDebugEnabled() )
                     {
                         StringBuffer sb = new StringBuffer();
-                        sb.append( "'" + string + "' ( " );
-                        sb.append( StringTools.dumpBytes( ( byte[] ) firstValue ).trim() );
+                        sb.append( "'" + password + "' ( " );
+                        sb.append( StringTools.dumpBytes( ((ServerBinaryValue)firstValue).get() ).trim() );
                         sb.append( " )" );
                         log.debug( "{} Attribute id : 'userPassword',  Values : [ {} ]", operation, sb.toString() );
                     }
-
-                    firstValue = string;
                 }
 
-                subContext.setUserPassword( ( String ) firstValue );
+                subContext.setUserPassword( password );
                 log.debug( "Got userPassword '{}'.", subContext.getUserPassword() );
             }
 
-            if ( attrId.equalsIgnoreCase( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ) )
+            if ( attr.instanceOf( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ) )
             {
-                subContext.setPrincipalName( ( String ) attr.get() );
+                subContext.setPrincipalName( attr.getString() );
                 log.debug( "Got principal '{}'.", subContext.getPrincipalName() );
             }
         }
@@ -295,7 +291,7 @@
 
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        Attributes userEntry;
+        ServerEntry userEntry;
 
         LookupOperationContext lookupContext = 
             new LookupOperationContext( modContext.getRegistries(),
@@ -315,9 +311,9 @@
             throw new LdapAuthenticationException( "Failed to authenticate user '" + principalDn + "'." );
         }
 
-        Attribute objectClass = userEntry.get( SchemaConstants.OBJECT_CLASS_AT );
+        ServerAttribute objectClass = userEntry.get( SchemaConstants.OBJECT_CLASS_AT );
         
-        if ( !AttributeUtils.containsValueCaseIgnore( objectClass, SchemaConstants.KRB5_PRINCIPAL_OC ) )
+        if ( !objectClass.contains( SchemaConstants.KRB5_PRINCIPAL_OC ) )
         {
             return;
         }
@@ -329,13 +325,13 @@
 
         if ( subContext.getPrincipalName() == null )
         {
-            Attribute principalAttribute = userEntry.get( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT );
-            String principalName = ( String ) principalAttribute.get();
+            ServerAttribute principalAttribute = userEntry.get( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT );
+            String principalName = principalAttribute.getString();
             subContext.setPrincipalName( principalName );
             log.debug( "Found principal '{}' from lookup.", principalName );
         }
 
-        Attribute keyVersionNumberAttr = userEntry.get( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT );
+        ServerAttribute keyVersionNumberAttr = userEntry.get( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT );
 
         if ( keyVersionNumberAttr == null )
         {
@@ -344,7 +340,7 @@
         }
         else
         {
-            int oldKeyVersionNumber = Integer.valueOf( ( String ) keyVersionNumberAttr.get() );
+            int oldKeyVersionNumber = Integer.valueOf( keyVersionNumberAttr.getString() );
             int newKeyVersionNumber = oldKeyVersionNumber + 1;
             subContext.setNewKeyVersionNumber( newKeyVersionNumber );
             log.debug( "Found key version number '{}', setting to '{}'.", oldKeyVersionNumber, newKeyVersionNumber );
@@ -362,7 +358,7 @@
      */
     void deriveKeys( ModifyOperationContext modContext, ModifySubContext subContext ) throws NamingException
     {
-        List<ModificationItemImpl> mods = modContext.getModItems();
+        List<Modification> mods = modContext.getModItems();
 
         String principalName = subContext.getPrincipalName();
         String userPassword = subContext.getUserPassword();
@@ -372,22 +368,35 @@
 
         Map<EncryptionType, EncryptionKey> keys = generateKeys( principalName, userPassword );
 
-        List<ModificationItemImpl> newModsList = new ArrayList<ModificationItemImpl>();
+        List<Modification> newModsList = new ArrayList<Modification>();
 
         // Make sure we preserve any other modification items.
-        for ( ModificationItemImpl mod:mods )
+        for ( Modification mod:mods )
         {
             newModsList.add( mod );
         }
+        
+        AttributeTypeRegistry atRegistry = modContext.getRegistries().getAttributeTypeRegistry();
 
         // Add our modification items.
-        newModsList.add( new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, new AttributeImpl(
-            KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, principalName ) ) );
-        newModsList.add( new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, new AttributeImpl(
-            KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT, Integer.toString( kvno ) ) ) );
+        newModsList.add( 
+            new ServerModification( 
+                ModificationOperation.REPLACE_ATTRIBUTE, 
+                new DefaultServerAttribute(
+                    KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, 
+                    atRegistry.lookup( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ),
+                    principalName ) ) );
+        newModsList.add( 
+            new ServerModification( 
+                ModificationOperation.REPLACE_ATTRIBUTE, 
+                new DefaultServerAttribute(
+                    KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT, 
+                    atRegistry.lookup( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT ),
+                    Integer.toString( kvno ) ) ) );
         
-        Attribute attribute = ServerEntryUtils.toAttributeImpl( getKeyAttribute( modContext.getRegistries(), keys ) );
-        newModsList.add( new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attribute ) );
+        ServerAttribute attribute = getKeyAttribute( modContext.getRegistries(), keys );
+        newModsList.add( 
+            new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute ) );
 
         modContext.setModItems( newModsList );
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyInterceptor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyInterceptor.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyInterceptor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyInterceptor.java Mon Mar 17 23:12:41 2008
@@ -20,6 +20,7 @@
 package org.apache.directory.server.core.kerberos;
 
 
+import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerBinaryValue;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerStringValue;
@@ -29,16 +30,14 @@
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.ModificationItem;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -115,61 +114,69 @@
     {
         LdapDN name = modContext.getDn();
 
-        List<ModificationItemImpl> mods = modContext.getModItems();
+        List<Modification> mods = modContext.getModItems();
 
         String operation = null;
 
-        for ( ModificationItem mod:mods )
+        for ( Modification mod:mods )
         {
             if ( log.isDebugEnabled() )
             {
-            	switch ( mod.getModificationOp() )
+            	switch ( mod.getOperation() )
 	            {
-	                case DirContext.ADD_ATTRIBUTE:
+	                case ADD_ATTRIBUTE:
 	                    operation = "Adding";
 	                    break;
 	                    
-	                case DirContext.REMOVE_ATTRIBUTE:
+	                case REMOVE_ATTRIBUTE:
 	                    operation = "Removing";
 	                    break;
 	                    
-	                case DirContext.REPLACE_ATTRIBUTE:
+	                case REPLACE_ATTRIBUTE:
 	                    operation = "Replacing";
 	                    break;
 	            }
             }
 
-            Attribute attr = mod.getAttribute();
-            String id = attr.getID();
+            ServerAttribute attr = (ServerAttribute)mod.getAttribute();
 
-            if ( id.equalsIgnoreCase( SchemaConstants.USER_PASSWORD_AT ) )
+            if ( attr.instanceOf( SchemaConstants.USER_PASSWORD_AT ) )
             {
-                Object userPassword = attr.get();
+                Value<?> userPassword = attr.get();
+                String pwd = "";
 
                 if ( userPassword != null )
                 {
-                    if ( userPassword instanceof String )
+                    if ( userPassword instanceof ServerStringValue )
                     {
                         log.debug( "{} Attribute id : 'userPassword',  Values : [ '{}' ]", operation, attr );
+                        pwd = ((ServerStringValue)userPassword).get();
                     }
-                    else if ( userPassword instanceof byte[] )
+                    else if ( userPassword instanceof ServerBinaryValue )
                     {
-                        String string = StringTools.utf8ToString( ( byte[] ) userPassword );
+                        ServerBinaryValue password = (ServerBinaryValue)userPassword.get();
+                        
+                        String string = "";
+                        
+                        if ( password != null )
+                        {
+                            string = StringTools.utf8ToString( password.get() );
+                        }
 
                         if ( log.isDebugEnabled() )
                         {
                             StringBuffer sb = new StringBuffer();
                             sb.append( "'" + string + "' ( " );
-                            sb.append( StringTools.dumpBytes( ( byte[] ) userPassword ).trim() );
+                            sb.append( StringTools.dumpBytes( password.get() ).trim() );
                             sb.append( " )" );
                             log.debug( "{} Attribute id : 'userPassword',  Values : [ {} ]", operation, sb.toString() );
                         }
 
-                        userPassword = string;
+                        pwd = string;
                     }
 
                     // if userPassword fails checks, throw new NamingException.
-                    check( name.getUpName(), ( String ) userPassword );
+                    check( name.getUpName(), pwd );
                 }
             }
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java Mon Mar 17 23:12:41 2008
@@ -49,7 +49,46 @@
 
         public int compare( Long o1, Long o2 )
         {
-            return o1.compareTo( o2 );
+            if ( o1 == null )
+            {
+                throw new IllegalArgumentException( "Argument 'obj1' is null" );
+            } else if ( o2 == null )
+            {
+                throw new IllegalArgumentException( "Argument 'obj2' is null" );
+            }
+
+            long thisVal = ( Long ) o1;
+            long anotherVal = ( Long ) o2;
+            
+            if ( thisVal == anotherVal )
+            {
+                return 0;
+            }
+            
+            if ( thisVal == anotherVal )
+            {
+                return 0;
+            }
+            
+            if ( thisVal >= 0 )
+            {
+                if ( anotherVal >= 0 )
+                {
+                    return ( thisVal > anotherVal ) ? 1 : -1;
+                }
+                else
+                {
+                    return -1;
+                }
+            }
+            else if ( anotherVal >= 0 )
+            {
+                return 1;
+            }
+            else
+            {
+                return ( thisVal < anotherVal ) ? -1 : 1;
+            }
         }
     };
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java Mon Mar 17 23:12:41 2008
@@ -25,6 +25,7 @@
 import jdbm.recman.BaseRecordManager;
 import jdbm.recman.CacheRecordManager;
 
+import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.partition.Oid;
@@ -34,11 +35,13 @@
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 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.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
@@ -54,8 +57,6 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.ModificationItem;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -1241,14 +1242,14 @@
      * @param mods the attribute and values to add 
      * @throws Exception if index alteration or attribute addition fails
      */
-    private void add( Long id, Attributes entry, Attribute mods ) throws Exception
+    private void add( Long id, Attributes entry, ServerAttribute mods ) throws Exception
     {
-        String modsOid = oidRegistry.getOid( mods.getID() );
+        String modsOid = oidRegistry.getOid( mods.getId() );
         
         if ( hasUserIndexOn( modsOid ) )
         {
             Index idx = getUserIndex( modsOid );
-            idx.add( mods, id );
+            idx.add( ServerEntryUtils.toAttributeImpl( mods ), id );
 
             // If the attr didn't exist for this id add it to existance index
             if ( !existanceIdx.has( modsOid, id ) )
@@ -1263,19 +1264,19 @@
 
         if ( entryAttrToAddTo == null )
         {
-            entryAttrToAddTo = new AttributeImpl( mods.getID() );
+            entryAttrToAddTo = new AttributeImpl( mods.getId() );
             entry.put( entryAttrToAddTo );
         }
 
-        for ( int ii = 0; ii < mods.size(); ii++ )
+        for ( Value<?> value:mods )
         {
-            entryAttrToAddTo.add( mods.get( ii ) );
+            entryAttrToAddTo.add( value.get() );
         }
 
         if ( modsOid.equals( oidRegistry.getOid( SchemaConstants.ALIASED_OBJECT_NAME_AT ) ) )
         {
             String ndnStr = ndnIdx.reverseLookup( id );
-            addAliasIndices( id, new LdapDN( ndnStr ), ( String ) mods.get() );
+            addAliasIndices( id, new LdapDN( ndnStr ), mods.getString() );
         }
     }
 
@@ -1293,14 +1294,14 @@
      * @param mods the attribute and its values to delete
      * @throws Exception if index alteration or attribute modification fails.
      */
-    private void remove( Long id, Attributes entry, Attribute mods ) throws Exception
+    private void remove( Long id, Attributes entry, ServerAttribute mods ) throws Exception
     {
-        String modsOid = oidRegistry.getOid( mods.getID() );
+        String modsOid = oidRegistry.getOid( mods.getId() );
         
         if ( hasUserIndexOn( modsOid ) )
         {
             Index idx = getUserIndex( modsOid );
-            idx.drop( mods, id );
+            idx.drop( ServerEntryUtils.toAttributeImpl( mods ), id );
 
             /* 
              * If no attribute values exist for this entryId in the index then
@@ -1326,11 +1327,10 @@
         else
         {
             Attribute entryAttr = AttributeUtils.getAttribute( entry, attrType );
-            NamingEnumeration<?> values = mods.getAll();
             
-            while ( values.hasMore() )
+            for ( Value<?> value:mods )
             {
-                entryAttr.remove( values.next() );
+                entryAttr.remove( value.get() );
             }
 
             // if nothing is left just remove empty attribute
@@ -1360,9 +1360,9 @@
      * @throws NamingException if index alteration or attribute modification 
      * fails.
      */
-    private void replace( Long id, Attributes entry, Attribute mods ) throws Exception
+    private void replace( Long id, Attributes entry, ServerAttribute mods ) throws Exception
     {
-        String modsOid = oidRegistry.getOid( mods.getID() );
+        String modsOid = oidRegistry.getOid( mods.getId() );
         
         if ( hasUserIndexOn( modsOid ) )
         {
@@ -1370,7 +1370,7 @@
 
             // Drop all existing attribute value index entries and add new ones
             idx.drop( id );
-            idx.add( mods, id );
+            idx.add( ServerEntryUtils.toAttributeImpl( mods ), id );
 
             /* 
              * If no attribute values exist for this entryId in the index then
@@ -1392,67 +1392,49 @@
         // replaces old attributes with new modified ones if they exist
         if ( mods.size() > 0 )
         {
-            entry.put( mods );
+            entry.put( ServerEntryUtils.toAttributeImpl( mods ) );
         }
         else  // removes old attributes if new replacements do not exist
         {
-            entry.remove( mods.getID() );
+            entry.remove( mods.getId() );
         }
 
         if ( modsOid.equals( aliasAttributeOid ) && mods.size() > 0 )
         {
             String ndnStr = ndnIdx.reverseLookup( id );
-            addAliasIndices( id, new LdapDN( ndnStr ), ( String ) mods.get() );
+            addAliasIndices( id, new LdapDN( ndnStr ), mods.getString() );
         }
     }
 
 
-    public void modify( LdapDN dn, int modOp, Attributes mods ) throws Exception
+    public void modify( LdapDN dn, ModificationOperation modOp, ServerEntry mods ) throws Exception
     {
         NamingEnumeration<String> attrs;
         Long id = getEntryId( dn.toString() );
         Attributes entry = master.get( id );
 
-        switch ( modOp )
+        for ( AttributeType attributeType:mods.getAttributeTypes() )
         {
-            case ( DirContext.ADD_ATTRIBUTE  ):
-                attrs = mods.getIDs();
+            ServerAttribute attr = mods.get( attributeType );
 
-                while ( attrs.hasMore() )
-                {
-                    String attrId = attrs.next();
-                    Attribute attr = mods.get( attrId );
+            switch ( modOp )
+            {
+                case ADD_ATTRIBUTE :
                     add( id, entry, attr );
-                }
-
-                break;
+                    break;
                 
-            case ( DirContext.REMOVE_ATTRIBUTE  ):
-                attrs = mods.getIDs();
-
-                while ( attrs.hasMore() )
-                {
-                    String attrId = attrs.next();
-                    Attribute attr = mods.get( attrId );
+                case REMOVE_ATTRIBUTE :
                     remove( id, entry, attr );
-                }
-
-                break;
+                    break;
                 
-            case ( DirContext.REPLACE_ATTRIBUTE  ):
-                attrs = mods.getIDs();
-
-                while ( attrs.hasMore() )
-                {
-                    String attrId = attrs.next();
-                    Attribute attr = mods.get( attrId );
+                case REPLACE_ATTRIBUTE :
                     replace( id, entry, attr );
-                }
-
-                break;
-                
-            default:
-                throw new NamingException( "Unidentified modification operation" );
+    
+                    break;
+                    
+                default:
+                    throw new NamingException( "Unidentified modification operation" );
+            }
         }
 
         master.put( id, entry );
@@ -1464,26 +1446,26 @@
     }
 
 
-    public void modify( LdapDN dn, List<ModificationItemImpl> mods ) throws Exception
+    public void modify( LdapDN dn, List<Modification> mods ) throws Exception
     {
         Long id = getEntryId( dn.toString() );
         Attributes entry = master.get( id );
 
-        for ( ModificationItem mod : mods )
+        for ( Modification mod : mods )
         {
-            Attribute attrMods = mod.getAttribute();
+            ServerAttribute attrMods = (ServerAttribute)mod.getAttribute();
 
-            switch ( mod.getModificationOp() )
+            switch ( mod.getOperation() )
             {
-                case ( DirContext.ADD_ATTRIBUTE ):
+                case ADD_ATTRIBUTE :
                     add( id, entry, attrMods );
                     break;
 
-                case ( DirContext.REMOVE_ATTRIBUTE ):
+                case REMOVE_ATTRIBUTE :
                     remove(id, entry, attrMods);
                     break;
 
-                case ( DirContext.REPLACE_ATTRIBUTE ):
+                case REPLACE_ATTRIBUTE :
                     replace( id, entry, attrMods );
                     break;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java Mon Mar 17 23:12:41 2008
@@ -946,4 +946,4 @@
 
         return first;
     }
-}
\ No newline at end of file
+}

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mina-xbean-spring/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mina-xbean-spring/pom.xml?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mina-xbean-spring/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mina-xbean-spring/pom.xml Mon Mar 17 23:12:41 2008
@@ -14,14 +14,14 @@
       <dependency>
         <groupId>org.apache.mina</groupId>
         <artifactId>mina-core</artifactId>
-        <version>1.1.4-SNAPSHOT</version>
+        <version>1.1.6</version>
         <classifier>sources</classifier>
       </dependency>
 
       <dependency>
         <groupId>org.apache.mina</groupId>
         <artifactId>mina-filter-ssl</artifactId>
-        <version>1.1.4-SNAPSHOT</version>
+        <version>1.1.6</version>
         <classifier>sources</classifier>
       </dependency>
   </dependencies>
@@ -72,4 +72,4 @@
       </plugin>
     </plugins>
   </build>
-</project>
\ No newline at end of file
+</project>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/Constants.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/Constants.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/Constants.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/Constants.java Mon Mar 17 23:12:41 2008
@@ -21,11 +21,11 @@
 
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.invocation.Invocation;
 
@@ -61,11 +61,11 @@
      */
     public static final SearchResultFilter DELETED_ENTRIES_FILTER = new SearchResultFilter()
     {
-        public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
+        public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls )
             throws NamingException
         {
-            Attributes entry = result.getAttributes();
-            Attribute deleted = entry.get( ENTRY_DELETED );
+            ServerEntry entry = result.getServerEntry();
+            ServerAttribute deleted = entry.get( ENTRY_DELETED );
             Object value = deleted == null ? null : deleted.get();
             return ( value == null || !"TRUE".equalsIgnoreCase( value.toString() ) );
         }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddAttributeOperation.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddAttributeOperation.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddAttributeOperation.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddAttributeOperation.java Mon Mar 17 23:12:41 2008
@@ -21,17 +21,17 @@
 
 
 import org.apache.directory.mitosis.common.CSN;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.schema.registries.Registries;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
 import java.util.List;
 
 
@@ -50,7 +50,7 @@
      * 
      * @param attribute an attribute to add
      */
-    public AddAttributeOperation( CSN csn, LdapDN name, Attribute attribute )
+    public AddAttributeOperation( CSN csn, LdapDN name, ServerAttribute attribute )
     {
         super( csn, name, attribute );
     }
@@ -58,15 +58,16 @@
 
     public String toString()
     {
-        return super.toString() + ".add( " + getAttribute() + " )";
+        return super.toString() + ".add( " + getAttributeString() + " )";
     }
 
 
     protected void execute1( PartitionNexus nexus, Registries registries ) throws NamingException
     {
-        Attributes attrs = new AttributesImpl( true );
-        attrs.put( getAttribute() );
-        List<ModificationItemImpl> items = ModifyOperationContext.createModItems( attrs, DirContext.ADD_ATTRIBUTE );
+        ServerEntry serverEntry = new DefaultServerEntry( registries, LdapDN.EMPTY_LDAPDN );
+        ServerAttribute attribute = getAttribute( registries.getAttributeTypeRegistry() );
+        serverEntry.put( attribute );
+        List<Modification> items = ModifyOperationContext.createModItems( serverEntry, ModificationOperation.ADD_ATTRIBUTE );
         nexus.modify( new ModifyOperationContext( registries, getName(), items ) );
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddEntryOperation.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddEntryOperation.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddEntryOperation.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddEntryOperation.java Mon Mar 17 23:12:41 2008
@@ -23,13 +23,13 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchResult;
 
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.operation.support.EntryUtil;
 import org.apache.directory.mitosis.store.ReplicationStore;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
@@ -99,7 +99,7 @@
     private void recursiveDelete( PartitionNexus nexus, LdapDN normalizedName, Registries registries )
         throws NamingException
     {
-        NamingEnumeration<SearchResult> ne = nexus.list( new ListOperationContext( registries, normalizedName ) );
+        NamingEnumeration<ServerSearchResult> ne = nexus.list( new ListOperationContext( registries, normalizedName ) );
         
         if ( !ne.hasMore() )
         {
@@ -109,8 +109,8 @@
 
         while ( ne.hasMore() )
         {
-            SearchResult sr = ne.next();
-            LdapDN dn = new LdapDN( sr.getName() );
+        	ServerSearchResult sr = ne.next();
+            LdapDN dn = sr.getDn();
             dn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
             recursiveDelete( nexus, dn, registries );
         }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AttributeOperation.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AttributeOperation.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AttributeOperation.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/AttributeOperation.java Mon Mar 17 23:12:41 2008
@@ -22,8 +22,12 @@
 
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
+import javax.naming.directory.InvalidAttributeIdentifierException;
 
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.partition.PartitionNexus;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.mitosis.common.CSN;
@@ -40,6 +44,7 @@
 {
     private final LdapDN name;
     private final Attribute attribute;
+    private transient ServerAttribute serverAttribute;
 
 
     /**
@@ -48,24 +53,35 @@
      * @param name the normalized name of an entry 
      * @param attribute an attribute to modify
      */
-    public AttributeOperation( CSN csn, LdapDN name, Attribute attribute )
+    public AttributeOperation( CSN csn, LdapDN name, ServerAttribute serverAttribute )
     {
         super( csn );
 
         assert name != null;
-        assert attribute != null;
+        assert serverAttribute != null;
 
         this.name = name;
-        this.attribute = ( Attribute ) attribute.clone();
+        this.serverAttribute = (ServerAttribute)serverAttribute.clone();
+        this.attribute = ServerEntryUtils.toAttributeImpl( this.serverAttribute );
     }
 
 
     /**
      * Returns the attribute to modify.
      */
-    public Attribute getAttribute()
+    public ServerAttribute getAttribute( AttributeTypeRegistry atRegistry ) throws InvalidAttributeIdentifierException, NamingException
     {
-        return ( Attribute ) attribute.clone();
+        if ( serverAttribute != null )
+        {
+            return ( ServerAttribute ) serverAttribute.clone();
+        }
+        else
+        {
+            Attribute attr = (Attribute)attribute.clone();
+            
+            serverAttribute = ServerEntryUtils.toServerAttribute( attr, atRegistry.lookup( attr.getID() ) );
+            return (ServerAttribute)serverAttribute.clone();
+        }
     }
 
 
@@ -93,6 +109,14 @@
 
     protected abstract void execute1( PartitionNexus nexus, Registries registries ) throws NamingException;
 
+
+    /**
+     * Returns the attribute to modify.
+     */
+    public String getAttributeString()
+    {
+        return attribute.toString();
+    }
 
     /**
      * Returns string representation of this operation.

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/DeleteAttributeOperation.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/DeleteAttributeOperation.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/DeleteAttributeOperation.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/DeleteAttributeOperation.java Mon Mar 17 23:12:41 2008
@@ -21,17 +21,17 @@
 
 
 import org.apache.directory.mitosis.common.CSN;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.schema.registries.Registries;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
 import java.util.List;
 
 
@@ -50,7 +50,7 @@
      * 
      * @param attribute an attribute to delete
      */
-    public DeleteAttributeOperation( CSN csn, LdapDN name, Attribute attribute )
+    public DeleteAttributeOperation( CSN csn, LdapDN name, ServerAttribute attribute )
     {
         super( csn, name, attribute );
     }
@@ -58,15 +58,16 @@
 
     public String toString()
     {
-        return super.toString() + ".delete( " + getAttribute() + " )";
+        return super.toString() + ".delete( " + getAttributeString() + " )";
     }
 
 
     protected void execute1( PartitionNexus nexus, Registries registries ) throws NamingException
     {
-        Attributes attrs = new AttributesImpl( true );
-        attrs.put( getAttribute() );
-        List<ModificationItemImpl> items = ModifyOperationContext.createModItems( attrs, DirContext.REMOVE_ATTRIBUTE );
+        ServerEntry serverEntry = new DefaultServerEntry( registries, LdapDN.EMPTY_LDAPDN );
+        ServerAttribute attribute = getAttribute( registries.getAttributeTypeRegistry() );
+        serverEntry.put( attribute );
+        List<Modification> items = ModifyOperationContext.createModItems( serverEntry, ModificationOperation.REMOVE_ATTRIBUTE );
 
         nexus.modify( new ModifyOperationContext( registries, getName(), items ) );
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationCodec.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationCodec.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationCodec.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationCodec.java Mon Mar 17 23:12:41 2008
@@ -77,7 +77,6 @@
         }
         catch ( IOException e )
         {
-            e.printStackTrace();
             throw ( InternalError ) new InternalError().initCause( e );
         }
         catch ( ClassNotFoundException e )

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java Mon Mar 17 23:12:41 2008
@@ -26,9 +26,10 @@
 import org.apache.directory.mitosis.common.UUIDFactory;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
@@ -38,22 +39,17 @@
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
-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.name.Rdn;
 
 import javax.naming.NameAlreadyBoundException;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 
 import java.util.List;
 
@@ -148,14 +144,17 @@
      * The created {@link Operation} doesn't actually delete the entry.
      * Instead, it sets {@link Constants#ENTRY_DELETED} to "TRUE". 
      */
-    public Operation newDelete( LdapDN normalizedName )
+    public Operation newDelete( LdapDN normalizedName ) throws NamingException
     {
         CSN csn = newCSN();
         CompositeOperation result = new CompositeOperation( csn );
 
         // Transform into replace operation.
-        result.add( new ReplaceAttributeOperation( csn, normalizedName, new AttributeImpl( Constants.ENTRY_DELETED,
-            "TRUE" ) ) );
+        result.add( new ReplaceAttributeOperation( csn, normalizedName, 
+            new DefaultServerAttribute( 
+                Constants.ENTRY_DELETED, 
+                attributeRegistry.lookup( Constants.ENTRY_DELETED ),
+                "TRUE" ) ) );
 
         return addDefaultOperations( result, csn, normalizedName );
     }
@@ -169,23 +168,34 @@
      * sets {@link Constants#ENTRY_DELETED} to "FALSE" to resurrect the
      * entry the modified attributes belong to.
      */
-    public Operation newModify( ModifyOperationContext opContext )
+    public Operation newModify( ModifyOperationContext opContext ) throws NamingException
     {
-        List<ModificationItemImpl> items = opContext.getModItems();
+        List<Modification> items = opContext.getModItems();
         LdapDN normalizedName = opContext.getDn();
 
         CSN csn = newCSN();
         CompositeOperation result = new CompositeOperation( csn );
         
         // Transform into multiple {@link AttributeOperation}s.
-        for ( ModificationItem item:items )
+        for ( Modification item:items )
         {
-            result.add( newModify( csn, normalizedName, item.getModificationOp(), item.getAttribute() ) );
+            result.add( 
+                newModify( 
+                    csn, 
+                    normalizedName, 
+                    item.getOperation(), 
+                    (ServerAttribute)item.getAttribute() ) );
         }
 
         // Resurrect the entry in case it is deleted.
-        result.add( new ReplaceAttributeOperation( csn, normalizedName, new AttributeImpl( Constants.ENTRY_DELETED,
-            "FALSE" ) ) );
+        result.add( 
+            new ReplaceAttributeOperation( 
+                csn, 
+                normalizedName, 
+                new DefaultServerAttribute( 
+                    Constants.ENTRY_DELETED,
+                    attributeRegistry.lookup( Constants.ENTRY_DELETED ),
+                    "FALSE" ) ) );
 
         return addDefaultOperations( result, csn, normalizedName );
     }
@@ -197,16 +207,19 @@
      * methods internally to create an appropriate {@link AttributeOperation}
      * instance from the specified <tt>modOp</tt> value.
      */
-    private Operation newModify( CSN csn, LdapDN normalizedName, int modOp, Attribute attribute )
+    private Operation newModify( CSN csn, LdapDN normalizedName, ModificationOperation modOp, ServerAttribute attribute )
     {
         switch ( modOp )
         {
-            case DirContext.ADD_ATTRIBUTE:
+            case ADD_ATTRIBUTE:
                 return new AddAttributeOperation( csn, normalizedName, attribute );
-            case DirContext.REPLACE_ATTRIBUTE:
+            
+            case REPLACE_ATTRIBUTE:
                 return new ReplaceAttributeOperation( csn, normalizedName, attribute );
-            case DirContext.REMOVE_ATTRIBUTE:
+            
+            case REMOVE_ATTRIBUTE:
                 return new DeleteAttributeOperation( csn, normalizedName, attribute );
+            
             default:
                 throw new IllegalArgumentException( "Unknown modOp: " + modOp );
         }
@@ -257,25 +270,30 @@
         SearchControls ctrl = new SearchControls();
         ctrl.setSearchScope( SearchControls.SUBTREE_SCOPE );
         
-        NamingEnumeration<SearchResult> e = nexus.search( 
+        NamingEnumeration<ServerSearchResult> e = nexus.search( 
             new SearchOperationContext( registries, oldName, AliasDerefMode.DEREF_ALWAYS,
                     new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ), ctrl ) );
 
         while ( e.hasMore() )
         {
-            SearchResult sr = e.next();
+        	ServerSearchResult sr = e.next();
 
             // Get the name of the old entry
-            LdapDN oldEntryName = new LdapDN( sr.getName() );
+            LdapDN oldEntryName = sr.getDn();
             oldEntryName.normalize( attributeRegistry.getNormalizerMapping() );
 
             // Delete the old entry
-            result.add( new ReplaceAttributeOperation( csn, oldEntryName, new AttributeImpl( Constants.ENTRY_DELETED,
-                "TRUE" ) ) );
+            result.add( 
+                new ReplaceAttributeOperation( 
+                    csn, 
+                    oldEntryName, 
+                    new DefaultServerAttribute( 
+                        Constants.ENTRY_DELETED,
+                        attributeRegistry.lookup( Constants.ENTRY_DELETED ),
+                        "TRUE" ) ) );
 
             // Get the old entry attributes and replace RDN if required
-            LdapDN entryName = new LdapDN( sr.getName() ); 
-            ServerEntry entry = ServerEntryUtils.toServerEntry( sr.getAttributes(), entryName, registries );
+            ServerEntry entry = sr.getServerEntry();
             
             if ( oldEntryName.size() == oldName.size() )
             {
@@ -347,8 +365,8 @@
     {
         if ( nexus.hasEntry( new EntryOperationContext( registries, newEntryName ) ) )
         {
-            Attributes entry = nexus.lookup( new LookupOperationContext( registries, newEntryName ) );
-            Attribute deleted = entry.get( Constants.ENTRY_DELETED );
+            ServerEntry entry = nexus.lookup( new LookupOperationContext( registries, newEntryName ) );
+            ServerAttribute deleted = entry.get( Constants.ENTRY_DELETED );
             Object value = deleted == null ? null : deleted.get();
 
             /*
@@ -372,10 +390,17 @@
      * currently adds only one attribute, {@link Constants#ENTRY_CSN}.
      * @return what you specified as a parameter to enable invocation chaining
      */
-    private CompositeOperation addDefaultOperations( CompositeOperation result, CSN csn, LdapDN normalizedName )
+    private CompositeOperation addDefaultOperations( CompositeOperation result, CSN csn, LdapDN normalizedName ) throws NamingException
     {
-        result.add( new ReplaceAttributeOperation( csn, normalizedName, new AttributeImpl( Constants.ENTRY_CSN, csn
-            .toOctetString() ) ) );
+        result.add( 
+            new ReplaceAttributeOperation( 
+                csn, 
+                normalizedName, 
+                new DefaultServerAttribute( 
+                    Constants.ENTRY_DELETED,
+                    attributeRegistry.lookup( Constants.ENTRY_CSN ),
+                    csn.toOctetString() ) ) );
+
         return result;
     }
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/ReplaceAttributeOperation.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/ReplaceAttributeOperation.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/ReplaceAttributeOperation.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/ReplaceAttributeOperation.java Mon Mar 17 23:12:41 2008
@@ -21,17 +21,17 @@
 
 
 import org.apache.directory.mitosis.common.CSN;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.schema.registries.Registries;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
 import java.util.List;
 
 
@@ -52,7 +52,7 @@
      * @param csn ??
      * @param name ??
      */
-    public ReplaceAttributeOperation( CSN csn, LdapDN name, Attribute attribute )
+    public ReplaceAttributeOperation( CSN csn, LdapDN name, ServerAttribute attribute )
     {
         super( csn, name, attribute );
     }
@@ -60,15 +60,16 @@
 
     public String toString()
     {
-        return super.toString() + ".replace( " + getAttribute() + " )";
+        return super.toString() + ".replace( " + getAttributeString() + " )";
     }
 
 
     protected void execute1( PartitionNexus nexus, Registries registries ) throws NamingException
     {
-        Attributes attrs = new AttributesImpl( true );
-        attrs.put( getAttribute() );
-        List<ModificationItemImpl> items = ModifyOperationContext.createModItems( attrs, DirContext.REPLACE_ATTRIBUTE );
+        ServerEntry serverEntry = new DefaultServerEntry( registries, LdapDN.EMPTY_LDAPDN );
+        ServerAttribute attribute = getAttribute( registries.getAttributeTypeRegistry() );
+        serverEntry.put( attribute );
+        List<Modification> items = ModifyOperationContext.createModItems( serverEntry, ModificationOperation.REPLACE_ATTRIBUTE );
 
         nexus.modify( new ModifyOperationContext( registries, getName(), items ) );
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java Mon Mar 17 23:12:41 2008
@@ -22,10 +22,9 @@
 
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 
 import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
@@ -46,14 +45,14 @@
     @SuppressWarnings("unchecked")
     public static boolean isEntryUpdatable( Registries registries, PartitionNexus nexus, LdapDN name, CSN newCSN ) throws NamingException
     {
-        Attributes entry = nexus.lookup( new LookupOperationContext( registries, name ) );
+        ServerEntry entry = nexus.lookup( new LookupOperationContext( registries, name ) );
 
         if ( entry == null )
         {
             return true;
         }
 
-        Attribute entryCSNAttr = entry.get( Constants.ENTRY_CSN );
+        ServerAttribute entryCSNAttr = entry.get( Constants.ENTRY_CSN );
 
         if ( entryCSNAttr == null )
         {

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java Mon Mar 17 23:12:41 2008
@@ -384,7 +384,7 @@
             }
             catch ( RuntimeIOException e )
             {
-                LOG.error( "[Replica-" + ClientConnectionManager.this.configuration.getReplicaId()
+                LOG.warn( "[Replica-" + ClientConnectionManager.this.configuration.getReplicaId()
                         + "] Failed to connect to replica-" + replica.getId(), e );
             }
             finally

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java Mon Mar 17 23:12:41 2008
@@ -35,7 +35,7 @@
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerValue;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.Interceptor;
@@ -56,6 +56,7 @@
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
@@ -73,11 +74,7 @@
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 
 import java.net.InetSocketAddress;
 import java.text.ParseException;
@@ -329,7 +326,7 @@
         }
 
         // Iterate all context partitions to send all entries of them.
-        for ( ServerValue<?> namingContext:namingContextsAttr )
+        for ( Value<?> namingContext:namingContextsAttr )
         {
             // Convert attribute value to JNDI name.
             LdapDN contextName;
@@ -351,20 +348,21 @@
         ctrl.setSearchScope( SearchControls.SUBTREE_SCOPE );
         ctrl.setReturningAttributes( new String[] { "entryCSN", "entryDeleted" } );
 
-        NamingEnumeration<SearchResult> e = nexus.search(
+        NamingEnumeration<ServerSearchResult> e = nexus.search(
             new SearchOperationContext( registries, contextName, AliasDerefMode.DEREF_ALWAYS, filter, ctrl ) );
 
         List<LdapDN> names = new ArrayList<LdapDN>();
+        
         try
         {
             while ( e.hasMore() )
             {
-                SearchResult sr = e.next();
-                LdapDN name = new LdapDN( sr.getName() );
+            	ServerSearchResult sr = e.next();
+                LdapDN name = sr.getDn();
                 
                 if ( name.size() > contextName.size() )
                 {
-                    names.add( new LdapDN( sr.getName() ) );
+                    names.add( name );
                 }
             }
         }
@@ -378,7 +376,7 @@
             try
             {
                 name.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
-                Attributes entry = nexus.lookup( new LookupOperationContext( registries, name ) );
+                ServerEntry entry = nexus.lookup( new LookupOperationContext( registries, name ) );
                 LOG.info( "[Replica-{}] Purge: " + name + " (" + entry + ')', configuration.getReplicaId() );
                 nexus.delete( new DeleteOperationContext( registries, name ) );
             }
@@ -450,12 +448,11 @@
             // Check DELETED attribute.
             try
             {
-                Attributes entry = nextInterceptor.lookup( new LookupOperationContext( registries, entryContext.getDn() ) );
+                ServerEntry entry = nextInterceptor.lookup( new LookupOperationContext( registries, entryContext.getDn() ) );
                 hasEntry = !isDeleted( entry );
             }
             catch ( NameNotFoundException e )
             {
-                System.out.println( e.toString( true ) );
                 hasEntry = false;
             }
         }
@@ -464,7 +461,7 @@
     }
 
 
-    public Attributes lookup( NextInterceptor nextInterceptor, LookupOperationContext lookupContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext lookupContext ) throws NamingException
     {
         if ( lookupContext.getAttrsId() != null )
         {
@@ -492,18 +489,16 @@
             }
         }
 
-        Attributes result = nextInterceptor.lookup( lookupContext );
+        ServerEntry result = nextInterceptor.lookup( lookupContext );
         ensureNotDeleted( lookupContext.getDn(), result );
         return result;
     }
 
 
     @Override
-    public NamingEnumeration<SearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
     {
-        DirContext ctx = ( DirContext ) InvocationStack.getInstance().peek().getCaller();
-
-    	NamingEnumeration<SearchResult> result = nextInterceptor.search(
+    	NamingEnumeration<ServerSearchResult> result = nextInterceptor.search(
 	            new SearchOperationContext(
 	                registries, opContext.getDn(), opContext.getAliasDerefMode(),
 	                new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ),
@@ -515,7 +510,7 @@
 
 
     @Override
-    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
     {
         SearchControls searchControls = opContext.getSearchControls();
 
@@ -528,14 +523,14 @@
             searchControls.setReturningAttributes( newAttrIds );
         }
 
-    	NamingEnumeration<SearchResult> result = nextInterceptor.search(
+    	NamingEnumeration<ServerSearchResult> result = nextInterceptor.search(
             new SearchOperationContext( registries, opContext.getDn(), opContext.getAliasDerefMode(), opContext.getFilter(), searchControls ) );
         return new SearchResultFilteringEnumeration( result, searchControls, InvocationStack.getInstance().peek(),
             Constants.DELETED_ENTRIES_FILTER, "Search Replication filter" );
     }
 
 
-    private void ensureNotDeleted( LdapDN name, Attributes entry ) throws NamingException {
+    private void ensureNotDeleted( LdapDN name, ServerEntry entry ) throws NamingException {
         if ( isDeleted( entry ) )
         {
             LdapNameNotFoundException e = new LdapNameNotFoundException( "Deleted entry: " + name.getUpName() );
@@ -545,15 +540,14 @@
     }
 
 
-    private boolean isDeleted( Attributes entry ) throws NamingException
+    private boolean isDeleted( ServerEntry entry ) throws NamingException
     {
         if ( entry == null )
         {
             return true;
         }
 
-        Attribute deleted = entry.get( Constants.ENTRY_DELETED );
-        return ( deleted != null && "TRUE".equalsIgnoreCase( deleted.get().toString() ) );
+        return entry.contains( Constants.ENTRY_DELETED, "TRUE" );
     }
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java Mon Mar 17 23:12:41 2008
@@ -44,10 +44,10 @@
 import org.apache.directory.mitosis.store.ReplicationStore;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
-import org.apache.directory.server.core.entry.ServerValue;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -60,7 +60,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 import java.net.InetSocketAddress;
 import java.util.Map;
 
@@ -361,7 +360,7 @@
         }
 
         // Iterate all context partitions to send all entries of them.
-        for ( ServerValue<?> namingContext:namingContextsAttr )
+        for ( Value<?> namingContext:namingContextsAttr )
         {
             // Convert attribute value to JNDI name.
             LdapDN contextName;
@@ -384,7 +383,7 @@
         // Retrieve all subtree including the base entry
         SearchControls ctrl = new SearchControls();
         ctrl.setSearchScope( SearchControls.SUBTREE_SCOPE );
-        NamingEnumeration<SearchResult> e = ctx.getDirectoryService().getPartitionNexus().search(
+        NamingEnumeration<ServerSearchResult> e = ctx.getDirectoryService().getPartitionNexus().search(
             new SearchOperationContext( ctx.getDirectoryService().getRegistries(), contextName, AliasDerefMode.DEREF_ALWAYS,
             new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ), ctrl ) );
 
@@ -392,11 +391,8 @@
         {
             while ( e.hasMore() )
             {
-                SearchResult sr = e.next();
-                ServerEntry attrs = ServerEntryUtils.toServerEntry( 
-                    sr.getAttributes(), 
-                    new LdapDN( sr.getName() ), 
-                    ctx.getDirectoryService().getRegistries() ) ;
+            	ServerSearchResult sr = e.next();
+                ServerEntry attrs = sr.getServerEntry(); 
 
                 // Skip entries without entryCSN attribute.
                 ServerAttribute entryCSNAttr = attrs.get( org.apache.directory.mitosis.common.Constants.ENTRY_CSN );
@@ -424,12 +420,12 @@
                 }
                 catch ( IllegalArgumentException ex )
                 {
-                    SessionLog.warn( ctx.getSession(), "An entry with improper entryCSN: " + sr.getName() );
+                    SessionLog.warn( ctx.getSession(), "An entry with improper entryCSN: " + sr.getDn() );
                     continue;
                 }
 
                 // Convert the entry into AddEntryOperation log.
-                LdapDN dn = new LdapDN( sr.getName() );
+                LdapDN dn = sr.getDn();
                 dn.normalize( ctx.getDirectoryService().getRegistries()
                         .getAttributeTypeRegistry().getNormalizerMapping() );
                 Operation op = new AddEntryOperation( csn, dn, attrs );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java Mon Mar 17 23:12:41 2008
@@ -33,7 +33,8 @@
 import org.apache.directory.mitosis.service.protocol.codec.LogEntryMessageEncoder;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.LogEntryMessage;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.server.core.DefaultDirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
@@ -43,13 +44,17 @@
 {
     private static Map<String, OidNormalizer> oids = new HashMap<String, OidNormalizer>();
 
+    private static DefaultDirectoryService service;
+    
     static 
     {
         oids.put( "ou", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
         oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
         oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
+        service = new DefaultDirectoryService();        
     }
     
+    
 
     public LogEntryMessageCodecTest() throws InvalidNameException, NamingException
     {
@@ -60,7 +65,6 @@
         oids.put( "organizationalUnitName", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
         oids.put( "2.5.4.11", new OidNormalizer( "ou", new DeepTrimToLowerNormalizer() ) );
          */
-        
         super(
             new LogEntryMessage( 
                 1234, 
@@ -68,7 +72,8 @@
                     new DefaultCSN( System.currentTimeMillis(),
                         new ReplicaId( "testReplica0" ), 1234 ), 
                     new LdapDN( "ou=system" ).normalize( oids ),
-                    new AttributeImpl( "Hello", "Test" ) ) ), 
+                    new DefaultServerAttribute( "ou", 
+                        service.getRegistries().getAttributeTypeRegistry().lookup( "ou" ), "Test" ) ) ), 
             new LogEntryMessageEncoder(), 
             new LogEntryMessageDecoder() );
     }



Mime
View raw message