directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r937645 - in /directory: apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ apacheds/trunk/core-api/src/main/java/org/apache/dir...
Date Sat, 24 Apr 2010 17:07:24 GMT
Author: elecharny
Date: Sat Apr 24 17:07:23 2010
New Revision: 937645

URL: http://svn.apache.org/viewvc?rev=937645&view=rev
Log:
o Merged ClientModification and ServerModification
o Removed ServerModification class
o Modified the impacted code

Removed:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ServerModification.java
Modified:
    directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
    directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java
    directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AddAuthorizationIT.java
    directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientModification.java

Modified: directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java (original)
+++ directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java Sat Apr 24 17:07:23 2010
@@ -53,7 +53,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapNoSuchObjectException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.name.DN;
@@ -608,7 +608,7 @@ public class AvlStoreTest
             .lookupAttributeTypeRegistry( SchemaConstants.OU_AT_OID ) );
         attrib.add( "Engineering" );
 
-        Modification add = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attrib );
+        Modification add = new ClientModification( ModificationOperation.ADD_ATTRIBUTE, attrib );
 
         mods.add( add );
 
@@ -712,7 +712,7 @@ public class AvlStoreTest
         String attribVal = "Walker";
         attrib.add( attribVal );
 
-        Modification add = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attrib );
+        Modification add = new ClientModification( ModificationOperation.ADD_ATTRIBUTE, attrib );
         mods.add( add );
 
         ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
@@ -744,7 +744,7 @@ public class AvlStoreTest
         String attribVal = "Johnny";
         attrib.add( attribVal );
 
-        Modification add = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );
+        Modification add = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );
         mods.add( add );
 
         ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
@@ -774,7 +774,7 @@ public class AvlStoreTest
         EntryAttribute attrib = new DefaultEntryAttribute( SchemaConstants.SN_AT, schemaManager
             .lookupAttributeTypeRegistry( SchemaConstants.SN_AT_OID ) );
 
-        Modification add = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attrib );
+        Modification add = new ClientModification( ModificationOperation.REMOVE_ATTRIBUTE, attrib );
         mods.add( add );
 
         ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
@@ -817,7 +817,7 @@ public class AvlStoreTest
         String attribVal = "Marketing";
         attrib.add( attribVal );
 
-        Modification add = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );
+        Modification add = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );
         mods.add( add );
 
         ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java Sat Apr 24 17:07:23 2010
@@ -58,8 +58,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.SearchScope;
@@ -555,7 +555,7 @@ public class LdapCoreSessionConnection i
             Iterator<EntryAttribute> itr = entry.iterator();
             while ( itr.hasNext() )
             {
-                mods.add( new ServerModification( modOp, itr.next() ) );
+                mods.add( new ClientModification( modOp, itr.next() ) );
             }
             session.modify( entry.getDn(), mods );
         }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java Sat Apr 24 17:07:23 2010
@@ -34,7 +34,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
 import org.apache.directory.shared.ldap.name.DN;
@@ -126,7 +125,7 @@ public class ModifyOperationContext exte
         
         for ( EntryAttribute attribute:serverEntry )
         {
-            items.add( new ServerModification( modOp, attribute ) );
+            items.add( new ClientModification( modOp, attribute ) );
         }
 
         return items;

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java Sat Apr 24 17:07:23 2010
@@ -54,7 +54,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
@@ -466,11 +466,11 @@ public final class SchemaPartition exten
 
         List<Modification> mods = new ArrayList<Modification>( 2 );
 
-        mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, new DefaultEntryAttribute(
+        mods.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, new DefaultEntryAttribute(
             ApacheSchemaConstants.SCHEMA_MODIFY_TIMESTAMP_AT, schemaManager
                 .lookupAttributeTypeRegistry( ApacheSchemaConstants.SCHEMA_MODIFY_TIMESTAMP_AT ), modifyTimestamp ) ) );
 
-        mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, new DefaultEntryAttribute(
+        mods.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, new DefaultEntryAttribute(
             ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT, schemaManager
                 .lookupAttributeTypeRegistry( ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT ), modifiersName ) ) );
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java Sat Apr 24 17:07:23 2010
@@ -45,7 +45,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.filter.AndNode;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
@@ -590,14 +590,14 @@ public class SchemaPartitionDaoImpl impl
             return;
         }
 
-        mods.add( new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, new DefaultEntryAttribute(
+        mods.add( new ClientModification( ModificationOperation.REMOVE_ATTRIBUTE, new DefaultEntryAttribute(
             MetaSchemaConstants.M_DISABLED_AT, schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_DISABLED_AT ) ) ) );
 
-        mods.add( new ServerModification( ModificationOperation.ADD_ATTRIBUTE, new DefaultEntryAttribute(
+        mods.add( new ClientModification( ModificationOperation.ADD_ATTRIBUTE, new DefaultEntryAttribute(
             SchemaConstants.MODIFIERS_NAME_AT, schemaManager.lookupAttributeTypeRegistry( SchemaConstants.MODIFIERS_NAME_AT ),
             ServerDNConstants.ADMIN_SYSTEM_DN ) ) );
 
-        mods.add( new ServerModification( ModificationOperation.ADD_ATTRIBUTE, new DefaultEntryAttribute(
+        mods.add( new ClientModification( ModificationOperation.ADD_ATTRIBUTE, new DefaultEntryAttribute(
             SchemaConstants.MODIFY_TIMESTAMP_AT, schemaManager.lookupAttributeTypeRegistry( SchemaConstants.MODIFY_TIMESTAMP_AT ), DateUtils
                 .getGeneralizedTime() ) ) );
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java Sat Apr 24 17:07:23 2010
@@ -39,8 +39,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
@@ -528,21 +528,21 @@ public class SchemaSynchronizer implemen
         
         // The m-disabled AT
         EntryAttribute disabledAttr = new DefaultEntryAttribute( disabledAT, "FALSE" );
-        Modification disabledMod = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, disabledAttr );
+        Modification disabledMod = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, disabledAttr );
         
         modifications.add( disabledMod );
         
         // The modifiersName AT
         EntryAttribute modifiersNameAttr = 
             new DefaultEntryAttribute( modifiersNameAT, session.getEffectivePrincipal().getName() );
-        Modification modifiersNameMod = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, modifiersNameAttr );
+        Modification modifiersNameMod = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, modifiersNameAttr );
         
         modifications.add( modifiersNameMod );
         
         // The modifyTimestamp AT
         EntryAttribute modifyTimestampAttr = 
             new DefaultEntryAttribute( modifyTimestampAT, DateUtils.getGeneralizedTime() );
-        Modification modifyTimestampMod = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, modifyTimestampAttr );
+        Modification modifyTimestampMod = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, modifyTimestampAttr );
         
         modifications.add( modifyTimestampMod );
         
@@ -634,7 +634,7 @@ public class SchemaSynchronizer implemen
                 
                 EntryAttribute disable = new DefaultEntryAttribute( disabledAT, "TRUE"  );
                 Modification modification = 
-                    new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, disable );
+                    new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, disable );
                 
                 //session.modify( dn, mods, ignoreReferral, log )
             }

Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java Sat Apr 24 17:07:23 2010
@@ -43,8 +43,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeTypeException;
 import org.apache.directory.shared.ldap.name.DN;
@@ -391,7 +391,7 @@ public class ServerEntryUtils
                 
         }
         
-        Modification modification = new ServerModification( 
+        Modification modification = new ClientModification( 
             operation,
             ServerEntryUtils.toServerAttribute( modificationImpl.getAttribute(), attributeType ) ); 
         
@@ -440,12 +440,7 @@ public class ServerEntryUtils
      */
     private static Modification toServerModification( Modification modification, AttributeType attributeType ) 
     {
-        if ( modification instanceof ServerModification )
-        {
-            return modification;
-        }
-        
-        Modification serverModification = new ServerModification( 
+        Modification serverModification = new ClientModification( 
             modification.getOperation(),
             new DefaultEntryAttribute( attributeType, modification.getAttribute() ) ); 
         

Modified: directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java (original)
+++ directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java Sat Apr 24 17:07:23 2010
@@ -38,7 +38,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -53,7 +52,7 @@ import org.junit.Test;
 
 
 /**
- * Test the ServerModification class
+ * Test the ClientModification class
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -69,9 +68,9 @@ public class ServerModificationTest
     
     
     /**
-     * Serialize a ServerModification
+     * Serialize a ClientModification
      */
-    private ByteArrayOutputStream serializeValue( ServerModification value ) throws IOException
+    private ByteArrayOutputStream serializeValue( ClientModification value ) throws IOException
     {
         ObjectOutputStream oOut = null;
         ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -107,9 +106,9 @@ public class ServerModificationTest
     
     
     /**
-     * Deserialize a ServerModification
+     * Deserialize a ClientModification
      */
-    private ServerModification deserializeValue( ByteArrayOutputStream out ) throws IOException, ClassNotFoundException, LdapException
+    private ClientModification deserializeValue( ByteArrayOutputStream out ) throws IOException, ClassNotFoundException, LdapException
     {
         ObjectInputStream oIn = null;
         ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray() );
@@ -118,7 +117,7 @@ public class ServerModificationTest
         {
             oIn = new ObjectInputStream( in );
 
-            ServerModification value = new ServerModification();
+            ClientModification value = new ClientModification();
             value.deserialize( oIn, schemaManager );
 
             return value;
@@ -179,12 +178,12 @@ public class ServerModificationTest
     }
 
 
-    @Test public void testCreateServerModification()
+    @Test public void testCreateClientModification()
     {
         EntryAttribute attribute = new DefaultEntryAttribute( atCN );
         attribute.add( "test1", "test2" );
         
-        Modification mod = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
+        Modification mod = new ClientModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
         Modification clone = mod.clone();
         
         attribute.remove( "test2" );
@@ -201,19 +200,19 @@ public class ServerModificationTest
     
     
     /**
-     * Test the copy constructor with a ServerModification
+     * Test the copy constructor with a ClientModification
      *
      */
     @Test
-    public void testCopyServerModification()
+    public void testCopyClientModification()
     {
         EntryAttribute attribute = new DefaultEntryAttribute( atC );
         attribute.add( "test1", "test2" );
-        Modification serverModification = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
+        Modification serverModification = new ClientModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
         
-        Modification copy = new ServerModification( schemaManager, serverModification );
+        Modification copy = new ClientModification( schemaManager, serverModification );
         
-        assertTrue( copy instanceof ServerModification );
+        assertTrue( copy instanceof ClientModification );
         assertEquals( copy, serverModification );
         
         serverModification.setOperation( ModificationOperation.REMOVE_ATTRIBUTE );
@@ -230,16 +229,16 @@ public class ServerModificationTest
      *
      */
     @Test
-    public void testCopyClientModification()
+    public void testCopyModification()
     {
         EntryAttribute attribute = new DefaultEntryAttribute( atC.getName() );
         attribute.add( "test1", "test2" );
         Modification clientModification = new ClientModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
         
-        Modification copy = new ServerModification( schemaManager, clientModification );
+        Modification copy = new ClientModification( schemaManager, clientModification );
         
-        assertTrue( copy instanceof ServerModification );
-        assertFalse( copy instanceof ClientModification );
+        assertTrue( copy instanceof ClientModification );
+        assertTrue( copy instanceof ClientModification );
         assertFalse( copy.equals(  clientModification ) );
         assertTrue( copy.getAttribute() instanceof EntryAttribute );
         assertEquals( atC, copy.getAttribute().getAttributeType() );
@@ -261,7 +260,7 @@ public class ServerModificationTest
         EntryAttribute attribute = new DefaultEntryAttribute( atCN );
         attribute.add( "test1", "test2" );
         
-        ServerModification mod = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
+        ClientModification mod = new ClientModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
         
         Modification modSer = deserializeValue( serializeValue( mod ) );
         
@@ -275,7 +274,7 @@ public class ServerModificationTest
         EntryAttribute attribute = new DefaultEntryAttribute( atCN );
         attribute.add( "test1", "test2" );
         
-        ServerModification mod = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
+        ClientModification mod = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
         
         Modification modSer = deserializeValue( serializeValue( mod ) );
         
@@ -289,7 +288,7 @@ public class ServerModificationTest
         EntryAttribute attribute = new DefaultEntryAttribute( atCN );
         attribute.add( "test1", "test2" );
         
-        ServerModification mod = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attribute );
+        ClientModification mod = new ClientModification( ModificationOperation.REMOVE_ATTRIBUTE, attribute );
         
         Modification modSer = deserializeValue( serializeValue( mod ) );
         
@@ -300,13 +299,13 @@ public class ServerModificationTest
     @Test
     public void testSerializationModificationNoAttribute() throws ClassNotFoundException, IOException, LdapException
     {
-        ServerModification mod = new ServerModification();
+        Modification mod = new ClientModification();
         
         mod.setOperation( ModificationOperation.ADD_ATTRIBUTE );
         
         try
         {
-            deserializeValue( serializeValue( mod ) );
+            deserializeValue( serializeValue( (ClientModification)mod ) );
             fail();
         }
         catch ( IOException ioe )

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AddAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AddAuthorizationIT.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AddAuthorizationIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AddAuthorizationIT.java Sat Apr 24 17:07:23 2010
@@ -58,6 +58,7 @@ public class AddAuthorizationIT extends 
     public void setService()
     {
         AutzIntegUtils.service = service;
+        service.setAccessControlEnabled( true );
     }
     
     

Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java (original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java Sat Apr 24 17:07:23 2010
@@ -49,8 +49,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
@@ -513,7 +513,7 @@ public class MockCoreSession implements 
         
         for ( Modification mod:mods )
         {
-            serverModifications.add( new ServerModification( directoryService.getSchemaManager(), mod ) );
+            serverModifications.add( new ClientModification( directoryService.getSchemaManager(), mod ) );
         }
         
         ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );
@@ -548,7 +548,7 @@ public class MockCoreSession implements 
         
         for ( Modification mod:mods )
         {
-            serverModifications.add( new ServerModification( directoryService.getSchemaManager(), mod ) );
+            serverModifications.add( new ClientModification( directoryService.getSchemaManager(), mod ) );
         }
 
         ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java Sat Apr 24 17:07:23 2010
@@ -49,8 +49,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
@@ -513,7 +513,7 @@ public class DefaultCoreSession implemen
         
         for ( Modification mod:mods )
         {
-            serverModifications.add( new ServerModification( directoryService.getSchemaManager(), mod ) );
+            serverModifications.add( new ClientModification( directoryService.getSchemaManager(), mod ) );
         }
         
         ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );
@@ -548,7 +548,7 @@ public class DefaultCoreSession implemen
         
         for ( Modification mod:mods )
         {
-            serverModifications.add( new ServerModification( directoryService.getSchemaManager(), mod ) );
+            serverModifications.add( new ClientModification( directoryService.getSchemaManager(), mod ) );
         }
 
         ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Sat Apr 24 17:07:23 2010
@@ -42,7 +42,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
 import org.apache.directory.shared.ldap.ldif.ChangeType;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
@@ -266,13 +265,10 @@ public class ChangeLogInterceptor extend
         
         for ( Modification modItem : clonedMods )
         {
-            Modification mod = ((ServerModification)modItem).toClientModification();
-            
             // TODO: handle correctly http://issues.apache.org/jira/browse/DIRSERVER-1198
-            mod.getAttribute().setId( modItem.getAttribute().getId() );
-            mods.add( mod );
+            mods.add( modItem );
             
-            forward.addModificationItem( mod );
+            forward.addModificationItem( modItem );
         }
         
         Entry clientEntry = new DefaultClientEntry( serverEntry.getDn() );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Sat Apr 24 17:07:23 2010
@@ -52,8 +52,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.AVA;
@@ -275,7 +275,7 @@ public class OperationalAttributeInterce
             MODIFIERS_NAME_ATTRIBUTE_TYPE, 
             getPrincipal().getName());
 
-        Modification modifiersName = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
+        Modification modifiersName = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
 
         mods.add( modifiersName );
         
@@ -284,7 +284,7 @@ public class OperationalAttributeInterce
             MODIFY_TIMESTAMP_ATTRIBUTE_TYPE,
             DateUtils.getGeneralizedTime() );
         
-        Modification timestamp = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
+        Modification timestamp = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
 
         mods.add( timestamp );
         

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java Sat Apr 24 17:07:23 2010
@@ -39,7 +39,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
@@ -273,7 +273,7 @@ public class ServerSystemPreferences ext
         {
             at = directoryService.getSchemaManager().lookupAttributeTypeRegistry( key );
             EntryAttribute attr = new DefaultEntryAttribute( at );
-            Modification mi = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attr );
+            Modification mi = new ClientModification( ModificationOperation.REMOVE_ATTRIBUTE, attr );
             addDelta( mi );
         }
         catch ( LdapException e )
@@ -347,7 +347,7 @@ public class ServerSystemPreferences ext
         {
             at = directoryService.getSchemaManager().lookupAttributeTypeRegistry( key );
             EntryAttribute attr = new DefaultEntryAttribute( at, value );
-            Modification mi = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attr );
+            Modification mi = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, attr );
             addDelta( mi );
         }
         catch ( LdapException e )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Sat Apr 24 17:07:23 2010
@@ -62,8 +62,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapAttributeInUseException;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeTypeException;
@@ -1390,7 +1390,7 @@ public class SchemaInterceptor extends B
             
             for ( Modification mod:mods )
             {
-                AttributeType at = ( (ServerModification)mod).getAttribute().getAttributeType();
+                AttributeType at = ( (ClientModification)mod).getAttribute().getAttributeType();
                 
                 if ( !MODIFIERS_NAME_ATTRIBUTE_TYPE.equals( at ) && !MODIFY_TIMESTAMP_ATTRIBUTE_TYPE.equals( at ) ) 
                 {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Sat Apr 24 17:07:23 2010
@@ -62,8 +62,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
@@ -728,7 +728,7 @@ public class SubentryInterceptor extends
                             op = ModificationOperation.REMOVE_ATTRIBUTE;
                         }
 
-                        modList.add( new ServerModification( op, opAttr ) );
+                        modList.add( new ClientModification( op, opAttr ) );
                     }
                 }
             }
@@ -741,7 +741,7 @@ public class SubentryInterceptor extends
                     EntryAttribute opAttr = new DefaultEntryAttribute( aSUBENTRY_OPATTRS, schemaManager
                         .lookupAttributeTypeRegistry( aSUBENTRY_OPATTRS ) );
                     opAttr.add( subentryDn );
-                    modList.add( new ServerModification( op, opAttr ) );
+                    modList.add( new ClientModification( op, opAttr ) );
                 }
             }
         }
@@ -1168,7 +1168,7 @@ public class SubentryInterceptor extends
                 operational.add( newName.toString() );
             }
 
-            modList.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
+            modList.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
         }
 
         if ( subentry.isSchemaSubentry() )
@@ -1187,7 +1187,7 @@ public class SubentryInterceptor extends
                 operational.add( newName.toString() );
             }
 
-            modList.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
+            modList.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
         }
 
         if ( subentry.isCollectiveSubentry() )
@@ -1206,7 +1206,7 @@ public class SubentryInterceptor extends
                 operational.add( newName.toString() );
             }
 
-            modList.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
+            modList.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
         }
 
         if ( subentry.isTriggerSubentry() )
@@ -1225,7 +1225,7 @@ public class SubentryInterceptor extends
                 operational.add( newName.toString() );
             }
 
-            modList.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
+            modList.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
         }
 
         return modList;
@@ -1320,7 +1320,7 @@ public class SubentryInterceptor extends
             {
                 AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( opAttrId );
                 EntryAttribute attr = new DefaultEntryAttribute( opAttrId, attributeType, dn );
-                modList.add( new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attr ) );
+                modList.add( new ClientModification( ModificationOperation.REMOVE_ATTRIBUTE, attr ) );
             }
         }
 
@@ -1372,7 +1372,7 @@ public class SubentryInterceptor extends
                 op = ModificationOperation.ADD_ATTRIBUTE;
             }
 
-            modList.add( new ServerModification( op, result ) );
+            modList.add( new ClientModification( op, result ) );
         }
 
         return modList;
@@ -1480,7 +1480,7 @@ public class SubentryInterceptor extends
                             op = ModificationOperation.REMOVE_ATTRIBUTE;
                         }
 
-                        modList.add( new ServerModification( op, opAttr ) );
+                        modList.add( new ClientModification( op, opAttr ) );
                     }
                 }
             }
@@ -1493,7 +1493,7 @@ public class SubentryInterceptor extends
                     AttributeType type = schemaManager.lookupAttributeTypeRegistry( attribute );
                     EntryAttribute opAttr = new DefaultEntryAttribute( attribute, type );
                     opAttr.add( subentryDn );
-                    modList.add( new ServerModification( op, opAttr ) );
+                    modList.add( new ClientModification( op, opAttr ) );
                 }
             }
         }

Modified: directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java Sat Apr 24 17:07:23 2010
@@ -67,8 +67,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -373,14 +373,14 @@ public class KeyDerivationInterceptor ex
 
         // Add our modification items.
         newModsList.add( 
-            new ServerModification( 
+            new ClientModification( 
                 ModificationOperation.REPLACE_ATTRIBUTE, 
                 new DefaultEntryAttribute(
                     KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, 
                     schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ),
                     principalName ) ) );
         newModsList.add( 
-            new ServerModification( 
+            new ClientModification( 
                 ModificationOperation.REPLACE_ATTRIBUTE, 
                 new DefaultEntryAttribute(
                     KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT, 
@@ -389,7 +389,7 @@ public class KeyDerivationInterceptor ex
         
         EntryAttribute attribute = getKeyAttribute( modContext.getSession()
             .getDirectoryService().getSchemaManager(), keys );
-        newModsList.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute ) );
+        newModsList.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute ) );
 
         modContext.setModItems( newModsList );
     }

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Sat Apr 24 17:07:23 2010
@@ -54,7 +54,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.exception.LdapNoSuchObjectException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.name.DN;
@@ -662,7 +662,7 @@ public class JdbmStoreTest
             .lookupAttributeTypeRegistry( SchemaConstants.OU_AT_OID ) );
         attrib.add( "Engineering" );
 
-        Modification add = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attrib );
+        Modification add = new ClientModification( ModificationOperation.ADD_ATTRIBUTE, attrib );
 
         mods.add( add );
 
@@ -766,7 +766,7 @@ public class JdbmStoreTest
         String attribVal = "Walker";
         attrib.add( attribVal );
 
-        Modification add = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attrib );
+        Modification add = new ClientModification( ModificationOperation.ADD_ATTRIBUTE, attrib );
         mods.add( add );
 
         ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
@@ -798,7 +798,7 @@ public class JdbmStoreTest
         String attribVal = "Johnny";
         attrib.add( attribVal );
 
-        Modification add = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );
+        Modification add = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );
         mods.add( add );
 
         ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
@@ -828,7 +828,7 @@ public class JdbmStoreTest
         EntryAttribute attrib = new DefaultEntryAttribute( SchemaConstants.SN_AT, schemaManager
             .lookupAttributeTypeRegistry( SchemaConstants.SN_AT_OID ) );
 
-        Modification add = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attrib );
+        Modification add = new ClientModification( ModificationOperation.REMOVE_ATTRIBUTE, attrib );
         mods.add( add );
 
         ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );
@@ -871,7 +871,7 @@ public class JdbmStoreTest
         String attribVal = "Marketing";
         attrib.add( attribVal );
 
-        Modification add = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );
+        Modification add = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );
         mods.add( add );
 
         ServerEntry lookedup = store.lookup( store.getEntryId( dn.getNormName() ) );

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java Sat Apr 24 17:07:23 2010
@@ -34,7 +34,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.ServerEntry;
-import org.apache.directory.shared.ldap.entry.ServerModification;
+import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -82,11 +82,11 @@ public class ChangePassword implements D
         
         EntryAttribute newPasswordAttribute = new DefaultEntryAttribute( 
             schemaManager.lookupAttributeTypeRegistry( SchemaConstants.USER_PASSWORD_AT ), StringTools.getBytesUtf8( newPassword ) );
-        mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, newPasswordAttribute ) );
+        mods.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, newPasswordAttribute ) );
         
         EntryAttribute principalAttribute = new DefaultEntryAttribute( 
             schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ), principal.getName() );
-        mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, principalAttribute ) );
+        mods.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, principalAttribute ) );
         
         //FIXME check if keyderivation is necessary
         

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientModification.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientModification.java?rev=937645&r1=937644&r2=937645&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientModification.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientModification.java Sat Apr 24 17:07:23 2010
@@ -23,11 +23,16 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 
-import javax.naming.directory.DirContext;
-
+import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * An internal implementation for a ModificationItem. The name has been
@@ -39,14 +44,15 @@ import org.apache.directory.shared.ldap.
 public class ClientModification implements Modification
 {
     /** The modification operation */
-    private ModificationOperation operation;
+    protected ModificationOperation operation;
     
     /** The attribute which contains the modification */
-    private EntryAttribute attribute;
+    protected EntryAttribute attribute;
  
-    
+    /** logger for reporting errors that might not be handled properly upstream */
+    protected static final Logger LOG = LoggerFactory.getLogger( Modification.class );
+
     /**
-     * 
      * Creates a new instance of ClientModification.
      *
      * @param operation The modification operation
@@ -60,30 +66,44 @@ public class ClientModification implemen
     
     
     /**
-     * 
      * Creates a new instance of ClientModification.
+     *
+     * @param schemaManager The schema manager 
+     * @param operation The modification operation
      */
-    public ClientModification()
+    public ClientModification( SchemaManager schemaManager, Modification modification )
     {
+        operation = modification.getOperation();
+        
+        EntryAttribute modAttribute = modification.getAttribute();
+        
+        try
+        {
+            AttributeType at = modAttribute.getAttributeType();
+            
+            if ( at == null )
+            {
+                at = schemaManager.lookupAttributeTypeRegistry( modAttribute.getId() );
+            }
+            
+            attribute = new DefaultEntryAttribute( at, modAttribute );
+        }
+        catch ( LdapException ne )
+        {
+            // The attributeType is incorrect. Log, but do nothing otherwise.
+            LOG.error( I18n.err( I18n.ERR_04472, modAttribute.getId() ) );
+        }
     }
-    
-    
     /**
-     * 
      * Creates a new instance of ClientModification.
-     *
-     * @param operation The modification operation
-     * @param attribute The asociated attribute 
      */
-    public ClientModification( int operation, EntryAttribute attribute )
+    public ClientModification()
     {
-        setOperation( operation );
-        this.attribute = attribute;
     }
     
     
     /**
-     *  @return the operation
+     * {@inheritDoc}
      */
     public ModificationOperation getOperation()
     {
@@ -98,27 +118,12 @@ public class ClientModification implemen
      */
     public void setOperation( int operation )
     {
-        switch ( operation )
-        {
-            case DirContext.ADD_ATTRIBUTE :
-                this.operation = ModificationOperation.ADD_ATTRIBUTE;
-                break;
-
-            case DirContext.REPLACE_ATTRIBUTE :
-                this.operation = ModificationOperation.REPLACE_ATTRIBUTE;
-                break;
-            
-            case DirContext.REMOVE_ATTRIBUTE :
-                this.operation = ModificationOperation.REMOVE_ATTRIBUTE;
-                break;
-        }
+        this.operation = ModificationOperation.getOperation( operation );
     }
 
     
     /**
-     * Store the modification operation
-     *
-     * @param operation The DirContext value to assign
+     * {@inheritDoc}
      */
     public void setOperation( ModificationOperation operation )
     {
@@ -127,7 +132,7 @@ public class ClientModification implemen
         
     
     /**
-     * @return the attribute containing the modifications
+     * {@inheritDoc}
      */
     public EntryAttribute getAttribute()
     {
@@ -150,28 +155,27 @@ public class ClientModification implemen
      * @see Object#equals(Object)
      * @return <code>true</code> if both values are equal
      */
-    public boolean equals( Object o )
+    public boolean equals( Object that )
     {
         // Basic equals checks
-        if ( this == o )
+        if ( this == that )
         {
             return true;
         }
         
-        if ( ! (o instanceof ClientModification ) )
+        if ( ! (that instanceof Modification ) )
         {
             return false;
         }
         
-        Modification otherModification = (ClientModification)o;
+        Modification otherModification = (Modification)that;
         
         // Check the operation
-        if ( !operation.equals( otherModification.getOperation() ) )
+        if ( operation != otherModification.getOperation() )
         {
             return false;
         }
 
-        
         // Check the attribute
         if ( attribute == null )
         {
@@ -228,6 +232,58 @@ public class ClientModification implemen
     
     
     /**
+     * Serialize a ClientModification.
+     */
+    public void serialize( ObjectOutput out ) throws IOException
+    {
+        if ( attribute == null )
+        {
+            throw new IOException( I18n.err( I18n.ERR_04471 ) );
+        }
+        
+        // Write the operation
+        out.writeInt( operation.getValue() );
+        
+        AttributeType at = attribute.getAttributeType();
+        
+        // Write the attribute's oid
+        out.writeUTF( at.getOid() );
+        
+        // Write the attribute
+        ((DefaultEntryAttribute)attribute).serialize( out );
+    }
+    
+    
+    /**
+     * Deserialize a ServerModification
+     * 
+     * @param in The buffer containing the serialized value
+     * @param atRegistry The AttributeType registry
+     * @throws IOException If we weren't able to deserialize the data
+     * @throws ClassNotFoundException if we weren't able to construct a Modification instance
+     * @throws LdapException If we didn't found the AttributeType in the registries
+     */
+    public void deserialize( ObjectInput in, SchemaManager schemaManager ) throws IOException, ClassNotFoundException, LdapException
+    {
+        // Read the operation
+        int op = in.readInt();
+        
+        operation = ModificationOperation.getOperation( op );
+        
+        // Read the attribute OID
+        String oid = in.readUTF();
+        
+        // Lookup for tha associated AttributeType
+        AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( oid );
+        
+        attribute = new DefaultEntryAttribute( attributeType );
+        
+        // Read the attribute
+        ((DefaultEntryAttribute)attribute).deserialize( in );
+    }
+
+    
+    /**
      * Clone a modification
      * 
      * @return  a copied instance of the current modification



Mime
View raw message