You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2007/12/04 08:05:53 UTC

svn commit: r600811 - /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java

Author: akarasulu
Date: Mon Dec  3 23:05:51 2007
New Revision: 600811

URL: http://svn.apache.org/viewvc?rev=600811&view=rev
Log:
fixing modrdn and moddn type operation signatures for shared ldap changes

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=600811&r1=600810&r2=600811&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Mon Dec  3 23:05:51 2007
@@ -178,6 +178,16 @@
 
     public void rename ( NextInterceptor next, RenameOperationContext renameContext ) throws NamingException
     {
+        Attributes attributes = null;
+        if ( changeLog.isEnabled() )
+        {
+            // @todo make sure we're not putting in operational attributes that cannot be user modified
+            Invocation invocation = InvocationStack.getInstance().peek();
+            PartitionNexusProxy proxy = invocation.getProxy();
+            attributes = proxy.lookup( new LookupOperationContext( renameContext.getDn() ),
+                    PartitionNexusProxy.LOOKUP_BYPASS );
+        }
+
         next.rename( renameContext );
 
         if ( ! changeLog.isEnabled() )
@@ -190,8 +200,8 @@
         forward.setDn( renameContext.getDn().getUpName() );
         forward.setDeleteOldRdn( renameContext.getDelOldDn() );
 
-        Entry reverse = LdifUtils.reverseModifyDN( null, renameContext.getDn(), new Rdn( renameContext.getNewRdn() ),
-                renameContext.getDelOldDn() );
+        Entry reverse = LdifUtils.reverseModifyRdn( attributes, null, renameContext.getDn(),
+                new Rdn( renameContext.getNewRdn() ) );
         changeLog.log( getPrincipal(), forward, reverse );
     }
 
@@ -199,6 +209,16 @@
     public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opCtx )
         throws NamingException
     {
+        Attributes attributes = null;
+        if ( changeLog.isEnabled() )
+        {
+            // @todo make sure we're not putting in operational attributes that cannot be user modified
+            Invocation invocation = InvocationStack.getInstance().peek();
+            PartitionNexusProxy proxy = invocation.getProxy();
+            attributes = proxy.lookup( new LookupOperationContext( opCtx.getDn() ),
+                    PartitionNexusProxy.LOOKUP_BYPASS );
+        }
+
         next.moveAndRename( opCtx );
 
         if ( ! changeLog.isEnabled() )
@@ -213,8 +233,8 @@
         forward.setNewRdn( opCtx.getNewRdn() );
         forward.setNewSuperior( opCtx.getParent().getUpName() );
 
-        Entry reverse = LdifUtils.reverseModifyDN( null, opCtx.getDn(), new Rdn( opCtx.getNewRdn() ),
-                opCtx.getDelOldDn() );
+        Entry reverse = LdifUtils.reverseModifyRdn( attributes, opCtx.getParent(), opCtx.getDn(),
+                new Rdn( opCtx.getNewRdn() ) );
         changeLog.log( getPrincipal(), forward, reverse );
     }
 
@@ -233,7 +253,7 @@
         forward.setDn( opCtx.getDn().getUpName() );
         forward.setNewSuperior( opCtx.getParent().getUpName() );
 
-        Entry reverse = LdifUtils.reverseModifyDN( null, opCtx.getDn(), null, false );
+        Entry reverse = LdifUtils.reverseModifyDn( opCtx.getParent(), opCtx.getDn() );
         changeLog.log( getPrincipal(), forward, reverse );
     }
 }