directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1221739 - in /directory/apacheds/branches/apacheds-txns: core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
Date Wed, 21 Dec 2011 14:20:32 GMT
Author: elecharny
Date: Wed Dec 21 14:20:31 2011
New Revision: 1221739

URL: http://svn.apache.org/viewvc?rev=1221739&view=rev
Log:
o Removed the useless _lookup method
o Added a speedup in the DefaultOperationManager.add() method : if the Dn is already normalized,
don't do it again

Modified:
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
    directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java?rev=1221739&r1=1221738&r2=1221739&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
Wed Dec 21 14:20:31 2011
@@ -481,7 +481,7 @@ public class LdapCoreSessionConnection i
      */
     public Entry lookup( Dn dn, String... attributes ) throws LdapException
     {
-        return _lookup( dn, null, attributes );
+        return lookup( dn, (Control[])null, attributes );
     }
 
 
@@ -490,7 +490,20 @@ public class LdapCoreSessionConnection i
      */
     public Entry lookup( Dn dn, Control[] controls, String... attributes ) throws LdapException
     {
-        return _lookup( dn, controls, attributes );
+        messageId.incrementAndGet();
+
+        Entry entry = null;
+
+        try
+        {
+            entry = session.lookup( dn, controls, attributes );
+        }
+        catch ( LdapException e )
+        {
+            LOG.warn( e.getMessage(), e );
+        }
+
+        return entry;
     }
 
 
@@ -499,7 +512,7 @@ public class LdapCoreSessionConnection i
      */
     public Entry lookup( String dn, String... attributes ) throws LdapException
     {
-        return _lookup( new Dn( schemaManager, dn ), null, attributes );
+        return lookup( new Dn( schemaManager, dn ), (Control[])null, attributes );
     }
 
 
@@ -508,30 +521,7 @@ public class LdapCoreSessionConnection i
      */
     public Entry lookup( String dn, Control[] controls, String... attributes ) throws LdapException
     {
-        return _lookup( new Dn( schemaManager, dn ), controls, attributes );
-    }
-
-
-    /*
-     * this method exists solely for the purpose of calling from
-     * lookup(Dn dn) avoiding the varargs,
-     */
-    private Entry _lookup( Dn dn, Control[] controls, String... attributes )
-    {
-        messageId.incrementAndGet();
-
-        Entry entry = null;
-
-        try
-        {
-            entry = session.lookup( dn, controls, attributes );
-        }
-        catch ( LdapException e )
-        {
-            LOG.warn( e.getMessage(), e );
-        }
-
-        return entry;
+        return lookup( new Dn( schemaManager, dn ), controls, attributes );
     }
 
 
@@ -590,7 +580,7 @@ public class LdapCoreSessionConnection i
      */
     public Entry lookup( Dn dn ) throws LdapException
     {
-        return _lookup( dn, null );
+        return lookup( dn, (Control[])null );
     }
 
 
@@ -599,7 +589,7 @@ public class LdapCoreSessionConnection i
      */
     public Entry lookup( String dn ) throws LdapException
     {
-        return _lookup( new Dn( schemaManager, dn ), null );
+        return lookup( new Dn( schemaManager, dn ), (Control[])null );
     }
 
 

Modified: directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java?rev=1221739&r1=1221738&r2=1221739&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
Wed Dec 21 14:20:31 2011
@@ -283,8 +283,12 @@ public class DefaultOperationManager imp
 
         // Normalize the addContext Dn
         Dn dn = addContext.getDn();
-        dn.apply( directoryService.getSchemaManager() );
         
+        if ( !dn.isSchemaAware() )
+        {
+            dn.apply( directoryService.getSchemaManager() );
+        }
+       
         // We have to deal with the referral first
         directoryService.getReferralManager().lockRead();
         



Mime
View raw message