directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r954655 - 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/event/ core/src/main/java/org/apache/directory/server/core/normalizatio...
Date Mon, 14 Jun 2010 21:43:20 GMT
Author: elecharny
Date: Mon Jun 14 21:43:20 2010
New Revision: 954655

URL: http://svn.apache.org/viewvc?rev=954655&view=rev
Log:
Cleaned the OperationContext from duplicate fields

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/event/EventInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.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=954655&r1=954654&r2=954655&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
Mon Jun 14 21:43:20 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=954655&r1=954654&r2=954655&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
Mon Jun 14 21:43:20 2010
@@ -25,7 +25,6 @@ import org.apache.directory.server.core.
 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 +44,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.
      */
@@ -112,16 +107,6 @@ public class RenameOperationContext exte
 
 
     /**
-     * Set the flag to delete the old RDN
-     * @param deleteOldRdn the flag to set
-     */
-    public void setDelOldDn( boolean deleteOldRdn ) 
-    {
-        this.deleteOldRdn = deleteOldRdn;
-    }
-
-
-    /**
      * @return The new DN either computed if null or already computed
      */
     public DN getNewDn()
@@ -140,16 +125,6 @@ public class RenameOperationContext exte
 
 
     /**
-     * Set the new RDN
-     * @param newRdn The new RDN
-     */
-    public void setNewRdn( RDN newRdn )
-    {
-        this.newRdn = newRdn;
-    }
-
-
-    /**
      * Set the new DN
      * @param newDn The new DN
      */
@@ -169,30 +144,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/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=954655&r1=954654&r2=954655&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
Mon Jun 14 21:43:20 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,7 +247,7 @@ public class EventInterceptor extends Ba
             return;
         }
 
-        moveAndRenameContext.setAlteredEntry( ( ClonedServerEntry ) moveAndRenameContext.lookup(
moveAndRenameContext.getNewDn(),
+        moveAndRenameContext.setModifiedEntry( ( ClonedServerEntry ) moveAndRenameContext.lookup(
moveAndRenameContext.getNewDn(),
             ByPassConstants.LOOKUP_BYPASS ) );
 
         for ( final RegistrationEntry registration : selecting )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=954655&r1=954654&r2=954655&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
Mon Jun 14 21:43:20 2010
@@ -213,10 +213,8 @@ public class NormalizationInterceptor ex
     public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext
moveAndRenameContext )
         throws LdapException
     {
-        DN rdn = new DN();
-        rdn.add( moveAndRenameContext.getNewRdn() );
+        RDN rdn = moveAndRenameContext.getNewRdn();
         rdn.normalize( schemaManager.getNormalizerMapping() );
-        moveAndRenameContext.setNewRdn( rdn.getRdn() );
 
         if ( !moveAndRenameContext.getDn().isNormalized() )
         {

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=954655&r1=954654&r2=954655&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
Mon Jun 14 21:43:20 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=954655&r1=954654&r2=954655&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
Mon Jun 14 21:43:20 2010
@@ -189,7 +189,16 @@ public class PersistentSearchListener im
 
     public void entryMovedAndRenamed( MoveAndRenameOperationContext opContext )
     {
-        entryRenamed( opContext );
+        if ( ! control.isNotificationEnabled( ChangeType.MODDN ) )
+        {
+            return;
+        }
+    
+        InternalSearchResponseEntry respEntry = new SearchResponseEntryImpl( req.getMessageId()
);
+        respEntry.setObjectName( opContext.getModifiedEntry().getDn() );
+        respEntry.setEntry( opContext.getModifiedEntry() );
+        setECResponseControl( respEntry, opContext, ChangeType.MODDN );
+        session.getIoSession().write( respEntry );
     }
 
 
@@ -201,8 +210,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=954655&r1=954654&r2=954655&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
Mon Jun 14 21:43:20 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
             {



Mime
View raw message