directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
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 GMT
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<Modification> 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 );
     }



Mime
View raw message