directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1421375 - /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
Date Thu, 13 Dec 2012 16:40:53 GMT
Author: elecharny
Date: Thu Dec 13 16:40:52 2012
New Revision: 1421375

URL: http://svn.apache.org/viewvc?rev=1421375&view=rev
Log:
Somplified the lookup() methods : we don't need a _lookup() method anymore

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

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java?rev=1421375&r1=1421374&r2=1421375&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
Thu Dec 13 16:40:52 2012
@@ -473,7 +473,7 @@ public class LdapCoreSessionConnection e
      */
     public Entry lookup( Dn dn, String... attributes ) throws LdapException
     {
-        return _lookup( dn, null, attributes );
+        return lookup( dn, null, attributes );
     }
 
 
@@ -482,7 +482,20 @@ public class LdapCoreSessionConnection e
      */
     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;
     }
 
 
@@ -491,7 +504,9 @@ public class LdapCoreSessionConnection e
      */
     public Entry lookup( String dn, String... attributes ) throws LdapException
     {
-        return _lookup( new Dn( schemaManager, dn ), null, attributes );
+        Dn baseDn = new Dn( schemaManager, dn );
+        
+        return lookup( baseDn, null, attributes );
     }
 
 
@@ -500,30 +515,9 @@ public class LdapCoreSessionConnection e
      */
     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 );
-        }
+        Dn baseDn = new Dn( schemaManager, dn );
 
-        return entry;
+        return lookup( baseDn, controls, attributes );
     }
 
 
@@ -582,7 +576,7 @@ public class LdapCoreSessionConnection e
      */
     public Entry lookup( Dn dn ) throws LdapException
     {
-        return _lookup( dn, null );
+        return lookup( dn, (String[])null );
     }
 
 
@@ -591,7 +585,7 @@ public class LdapCoreSessionConnection e
      */
     public Entry lookup( String dn ) throws LdapException
     {
-        return _lookup( new Dn( schemaManager, dn ), null );
+        return lookup( new Dn( schemaManager, dn ), (String[])null );
     }
 
 



Mime
View raw message