Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 87799 invoked from network); 24 Sep 2009 15:15:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Sep 2009 15:15:55 -0000 Received: (qmail 55300 invoked by uid 500); 24 Sep 2009 15:15:55 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 55241 invoked by uid 500); 24 Sep 2009 15:15:55 -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 55232 invoked by uid 99); 24 Sep 2009 15:15:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2009 15:15:55 +0000 X-ASF-Spam-Status: No, hits=-1999.6 required=10.0 tests=ALL_TRUSTED,SUBJECT_FUZZY_TION X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2009 15:15:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 163EA23888FD; Thu, 24 Sep 2009 15:15:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r818511 - in /directory/apacheds/branches/apacheds-schema: core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/ protocol-ldap/src/main/jav... Date: Thu, 24 Sep 2009 15:15:28 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090924151529.163EA23888FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Thu Sep 24 15:15:28 2009 New Revision: 818511 URL: http://svn.apache.org/viewvc?rev=818511&view=rev Log: Fixed 4 failures : the modify operation was not updating the modified entry, but the previous one, when updating the operational attributes, in some cases. That led to a revival of the previous values... Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java directory/apacheds/branches/apacheds-schema/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java?rev=818511&r1=818510&r2=818511&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java (original) +++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java Thu Sep 24 15:15:28 2009 @@ -26,6 +26,7 @@ import javax.naming.NamingException; import org.apache.directory.server.core.CoreSession; +import org.apache.directory.server.core.entry.ClonedServerEntry; import org.apache.directory.server.core.entry.ServerEntry; import org.apache.directory.server.core.entry.ServerEntryUtils; import org.apache.directory.server.core.entry.ServerModification; @@ -53,6 +54,9 @@ /** The modification items */ private List modItems; + /** The entry after being renamed and altered for rdn attributes */ + private ClonedServerEntry alteredEntry; + /** * Creates a new instance of ModifyOperationContext. */ @@ -139,6 +143,30 @@ /** + * Returns the entry after it has been renamed and potentially changed for + * Rdn alterations. + * + * @return the new renamed entry + */ + public ClonedServerEntry getAlteredEntry() + { + return alteredEntry; + } + + + /** + * Set the modified entry once the operation has been proceced + * on the backend. + * + * @param alteredEntry The modified entry + */ + public void setAlteredEntry( ClonedServerEntry alteredEntry ) + { + this.alteredEntry = alteredEntry; + } + + + /** * @see Object#toString() */ public String toString() Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java?rev=818511&r1=818510&r2=818511&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java (original) +++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java Thu Sep 24 15:15:28 2009 @@ -179,6 +179,12 @@ } + /** + * Set the modified entry once the operation has been proceced + * on the backend. + * + * @param alteredEntry The modified entry + */ public void setAlteredEntry( ClonedServerEntry alteredEntry ) { this.alteredEntry = alteredEntry; Modified: directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=818511&r1=818510&r2=818511&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original) +++ directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Thu Sep 24 15:15:28 2009 @@ -319,12 +319,13 @@ wrappedPartition.modify( id, modifyContext.getModItems() ); + // Get the modified entry and store it in the context for post usage + ClonedServerEntry modifiedEntry = lookup( id ); + modifyContext.setAlteredEntry( modifiedEntry ); + // just overwrite the existing file LdapDN dn = modifyContext.getDn(); - // Get the modified entry - Entry modifiedEntry = wrappedPartition.lookup( id ); - // And write it back on disk FileWriter fw = new FileWriter( getFile( dn, DELETE ) ); fw.write( LdifUtils.convertEntryToLdif( modifiedEntry ) ); Modified: directory/apacheds/branches/apacheds-schema/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java?rev=818511&r1=818510&r2=818511&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java (original) +++ directory/apacheds/branches/apacheds-schema/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java Thu Sep 24 15:15:28 2009 @@ -39,7 +39,6 @@ import org.apache.directory.shared.ldap.message.SearchResponseEntryImpl; import org.apache.directory.shared.ldap.message.control.EntryChangeControl; import org.apache.directory.shared.ldap.message.control.PersistentSearchControl; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -168,7 +167,7 @@ InternalSearchResponseEntry respEntry = new SearchResponseEntryImpl( req.getMessageId() ); respEntry.setObjectName( opContext.getDn() ); - respEntry.setEntry( opContext.getEntry() ); + respEntry.setEntry( opContext.getAlteredEntry() ); setECResponseControl( respEntry, opContext, ChangeType.MODIFY ); session.getIoSession().write( respEntry ); }