You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/06/15 12:22:48 UTC

svn commit: r954792 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ core/src/main/java/org/apache/directory/server/core/authz/ core/src/main/java/org/apache/directory/server/core/event/ ldif-...

Author: elecharny
Date: Tue Jun 15 10:22:48 2010
New Revision: 954792

URL: http://svn.apache.org/viewvc?rev=954792&view=rev
Log:
Cleanedup (again) the MoveAndRenameOperationContext, removing duplicated fields (alteredEntry and newDn

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
    directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java?rev=954792&r1=954791&r2=954792&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java Tue Jun 15 10:22:48 2010
@@ -40,9 +40,6 @@ public class MoveAndRenameOperationConte
     /** The new superior DN */
     private DN newSuperiorDn;
 
-    /** Cached calculated new DN after move and rename */
-    private DN newDn;
-
     /**
      * Creates a new instance of MoveAndRenameOperationContext.
      */
@@ -123,18 +120,6 @@ public class MoveAndRenameOperationConte
 
     
     /**
-     * Gets cached copy of already computed new name or creates it if not 
-     *
-     * @return the normalized new name after move and rename
-     * @throws Exception if the name cannot be normalized
-     */
-    public DN getNewDn()
-    {
-        return newDn;
-    }
-    
-
-    /**
      * @see Object#toString()
      */
     public String toString()

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java?rev=954792&r1=954791&r2=954792&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java Tue Jun 15 10:22:48 2010
@@ -21,11 +21,9 @@ package org.apache.directory.server.core
 
 
 import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
-import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
@@ -45,15 +43,11 @@ public class RenameOperationContext exte
     private RDN newRdn;
 
     /** Cached copy of the new DN */
-    private DN newDn;
+    protected DN newDn;
 
     /** The flag to remove the old RDN Attribute  */
     private boolean deleteOldRdn;
 
-    /** The entry after being renamed and altered for rdn attributes */ 
-    private ClonedServerEntry alteredEntry;
-    
-
     /**
      * Creates a new instance of RenameOperationContext.
      */
@@ -169,30 +163,6 @@ public class RenameOperationContext exte
     
     
     /**
-     * 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/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=954792&r1=954791&r2=954792&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Tue Jun 15 10:22:48 2010
@@ -861,8 +861,7 @@ public class AciAuthorizationInterceptor
 
         Set<DN> userGroups = groupCache.getGroups( principalDn.getNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
-        addPerscriptiveAciTuples( moveAndRenameContext, tuples, oriChildName, ( ( ClonedServerEntry ) entry )
-            .getOriginalEntry() );
+        addPerscriptiveAciTuples( moveAndRenameContext, tuples, oriChildName,entry );
         addEntryAciTuples( tuples, entry );
         addSubentryAciTuples( moveAndRenameContext, tuples, oriChildName, entry );
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=954792&r1=954791&r2=954792&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java Tue Jun 15 10:22:48 2010
@@ -224,7 +224,7 @@ public class EventInterceptor extends Ba
 
         // Get the modifed entry
         Entry alteredEntry = opContext.lookup( opContext.getNewDn(), ByPassConstants.LOOKUP_BYPASS );
-        opContext.setAlteredEntry( ( ClonedServerEntry ) alteredEntry );
+        opContext.setModifiedEntry( ( ClonedServerEntry ) alteredEntry );
 
         for ( final RegistrationEntry registration : selecting )
         {
@@ -247,8 +247,7 @@ public class EventInterceptor extends Ba
             return;
         }
 
-        moveAndRenameContext.setAlteredEntry( ( ClonedServerEntry ) moveAndRenameContext.lookup( moveAndRenameContext.getNewDn(),
-            ByPassConstants.LOOKUP_BYPASS ) );
+        moveAndRenameContext.setModifiedEntry( moveAndRenameContext.lookup( moveAndRenameContext.getNewDn(), ByPassConstants.LOOKUP_BYPASS ) );
 
         for ( final RegistrationEntry registration : selecting )
         {

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=954792&r1=954791&r2=954792&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Tue Jun 15 10:22:48 2010
@@ -363,7 +363,7 @@ public class LdifPartition extends BTree
 
         // Get the modified entry and store it in the context for post usage
         ClonedServerEntry modifiedEntry = lookup( id );
-        moveAndRenameContext.setAlteredEntry( modifiedEntry );
+        moveAndRenameContext.setModifiedEntry( modifiedEntry );
 
         entryMoved( oldDn, modifiedEntry, id );
     }
@@ -383,7 +383,7 @@ public class LdifPartition extends BTree
 
         // Get the modified entry and store it in the context for post usage
         ClonedServerEntry modifiedEntry = lookup( id );
-        renameContext.setAlteredEntry( modifiedEntry );
+        renameContext.setModifiedEntry( modifiedEntry );
 
         // Now move the potential children for the old entry
         // and remove the old entry

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java?rev=954792&r1=954791&r2=954792&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java Tue Jun 15 10:22:48 2010
@@ -201,8 +201,8 @@ public class PersistentSearchListener im
         }
     
         InternalSearchResponseEntry respEntry = new SearchResponseEntryImpl( req.getMessageId() );
-        respEntry.setObjectName( opContext.getAlteredEntry().getDn() );
-        respEntry.setEntry( opContext.getAlteredEntry() );
+        respEntry.setObjectName( opContext.getModifiedEntry().getDn() );
+        respEntry.setEntry( opContext.getModifiedEntry() );
         setECResponseControl( respEntry, opContext, ChangeType.MODDN );
         session.getIoSession().write( respEntry );
     }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java?rev=954792&r1=954791&r2=954792&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java Tue Jun 15 10:22:48 2010
@@ -318,10 +318,10 @@ public class SyncReplSearchListener impl
 
             if ( pushInRealTime )
             {
-                Entry alteredEntry = opContext.getAlteredEntry();
+                Entry alteredEntry = opContext.getModifiedEntry();
                 
                 InternalSearchResponseEntry respEntry = new SearchResponseEntryImpl( req.getMessageId() );
-                respEntry.setObjectName( opContext.getAlteredEntry().getDn() );
+                respEntry.setObjectName( opContext.getModifiedEntry().getDn() );
                 respEntry.setEntry( alteredEntry );
 
                 SyncStateValueControl syncModify = new SyncStateValueControl();
@@ -372,13 +372,13 @@ public class SyncReplSearchListener impl
                 syncModify.setSyncStateType( SyncStateTypeEnum.MODDN );
                 syncModify.setEntryUUID( StringTools.uuidToBytes( entry.get(
                     SchemaConstants.ENTRY_UUID_AT ).getString() ) );
-                syncModify.setCookie( getCookie( opContext.getAlteredEntry() ) );
+                syncModify.setCookie( getCookie( opContext.getModifiedEntry() ) );
                 respEntry.add( syncModify );
                 respEntry.add( modDnControl );
                 
                 WriteFuture future = session.getIoSession().write( respEntry );
                 
-                handleWriteFuture( future, opContext.getAlteredEntry(), null, modDnControl );
+                handleWriteFuture( future, opContext.getModifiedEntry(), null, modDnControl );
             }
             else
             {