From commits-return-16443-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Tue Dec 04 07:06:28 2007 Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 62138 invoked from network); 4 Dec 2007 07:06:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2007 07:06:28 -0000 Received: (qmail 62472 invoked by uid 500); 4 Dec 2007 07:06:16 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 62430 invoked by uid 500); 4 Dec 2007 07:06:16 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 62419 invoked by uid 99); 4 Dec 2007 07:06:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2007 23:06:16 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Dec 2007 07:06:15 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9D7BF1A9832; Mon, 3 Dec 2007 23:05:53 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r600811 - /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Date: Tue, 04 Dec 2007 07:05:53 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071204070553.9D7BF1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 ); } }