directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r952996 - 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/exception/ core/src/main/java/org/apache/directory/server/core/normaliz...
Date Wed, 09 Jun 2010 13:20:02 GMT
Author: elecharny
Date: Wed Jun  9 13:20:01 2010
New Revision: 952996

URL: http://svn.apache.org/viewvc?rev=952996&view=rev
Log:
o Adding some missing accessors into the MoveOperationContext class
o Remove useless lookups
o Adding some more normalization

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java?rev=952996&r1=952995&r2=952996&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
Wed Jun  9 13:20:01 2010
@@ -105,6 +105,15 @@ public class MoveOperationContext extend
 
 
     /**
+     *  @return The oldSuperior DN
+     */
+    public DN getOldSuperior()
+    {
+        return oldSuperior;
+    }
+
+
+    /**
      *  @return The newSuperior DN
      */
     public DN getNewSuperior()
@@ -114,6 +123,15 @@ public class MoveOperationContext extend
     
 
     /**
+     *  @return The RDN
+     */
+    public RDN getRdn()
+    {
+        return rdn;
+    }
+    
+    
+    /**
      *  @return The new DN
      */
     public DN getNewDn()

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=952996&r1=952995&r2=952996&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
Wed Jun  9 13:20:01 2010
@@ -393,29 +393,7 @@ public class ExceptionInterceptor extend
                 subschemSubentryDn, subschemSubentryDn ) );
         }
 
-        // check if child to move exists
-        String msg = "Attempt to move to non-existant parent: ";
-        assertHasEntry( opContext, msg, oriChildName );
-
-        // check if parent to move to exists
-        msg = "Attempt to move to non-existant parent: ";
-        assertHasEntry( opContext, msg, newParentName );
-
-        // check to see if target entry exists
-        DN target = opContext.getNewDn();
-
-        if ( nextInterceptor.hasEntry( new EntryOperationContext( opContext.getSession(),
target ) ) )
-        {
-            // we must calculate the resolved name using the user provided Rdn value
-            String upRdn = new DN( oriChildName.getName() ).get( oriChildName.size() - 1
);
-            DN upTarget = ( DN ) newParentName.clone();
-            upTarget.add( upRdn );
-
-            LdapEntryAlreadyExistsException e;
-            e = new LdapEntryAlreadyExistsException( I18n.err( I18n.ERR_257, upTarget.getName()
) );
-            //e.setResolvedName( new DN( upTarget.getName() ) );
-            throw e;
-        }
+        nextInterceptor.move( opContext );
 
         // Remove the original entry from the NotAlias cache, if needed
         synchronized ( notAliasCache )
@@ -425,8 +403,6 @@ public class ExceptionInterceptor extend
                 notAliasCache.remove( oriChildName.getNormName() );
             }
         }
-
-        nextInterceptor.move( opContext );
     }
 
 

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=952996&r1=952995&r2=952996&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
Wed Jun  9 13:20:01 2010
@@ -174,25 +174,34 @@ public class NormalizationInterceptor ex
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor nextInterceptor, MoveOperationContext opContext ) throws
LdapException
+    public void move( NextInterceptor nextInterceptor, MoveOperationContext moveContext )
throws LdapException
     {
-        if ( !opContext.getDn().isNormalized() )
+        if ( !moveContext.getDn().isNormalized() )
         {
-            opContext.getDn().normalize( schemaManager.getNormalizerMapping() );
+            moveContext.getDn().normalize( schemaManager.getNormalizerMapping() );
         }
 
-        if ( !opContext.getNewSuperior().isNormalized() )
+        if ( !moveContext.getOldSuperior().isNormalized() )
         {
-            opContext.getNewSuperior().normalize( schemaManager.getNormalizerMapping() );
+            moveContext.getOldSuperior().normalize( schemaManager.getNormalizerMapping()
);
         }
         
-        if ( !opContext.getNewDn().isNormalized() )
+        if ( !moveContext.getNewSuperior().isNormalized() )
         {
-            opContext.getNewDn().normalize( schemaManager.getNormalizerMapping() );
+            moveContext.getNewSuperior().normalize( schemaManager.getNormalizerMapping()
);
         }
         
-
-        nextInterceptor.move( opContext );
+        if ( !moveContext.getNewDn().isNormalized() )
+        {
+            moveContext.getNewDn().normalize( schemaManager.getNormalizerMapping() );
+        }
+        
+        if ( !moveContext.getRdn().isNormalized() )
+        {
+            moveContext.getRdn().normalize( schemaManager.getNormalizerMapping() );
+        }
+        
+        nextInterceptor.move( moveContext );
     }
 
 



Mime
View raw message