directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r988062 - /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
Date Mon, 23 Aug 2010 10:26:44 GMT
Author: kayyagari
Date: Mon Aug 23 10:26:44 2010
New Revision: 988062

URL: http://svn.apache.org/viewvc?rev=988062&view=rev
Log:
o updated lookup() method to return Entry (DIRAPI-8)

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

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java?rev=988062&r1=988061&r2=988062&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
Mon Aug 23 10:26:44 2010
@@ -41,6 +41,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapOperationException;
+import org.apache.directory.shared.ldap.exception.LdapReferralException;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AbandonRequest;
 import org.apache.directory.shared.ldap.message.AddRequest;
@@ -79,6 +80,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.apache.directory.shared.ldap.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.message.SearchResultEntryImpl;
+import org.apache.directory.shared.ldap.message.SearchResultReference;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
@@ -414,7 +416,7 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    public Response lookup( DN dn, String... attributes ) throws LdapException
+    public Entry lookup( DN dn, String... attributes ) throws LdapException
     {
         return _lookup( dn, attributes );
     }
@@ -424,16 +426,14 @@ public class LdapCoreSessionConnection i
      * this method exists solely for the purpose of calling from
      * lookup(DN dn) avoiding the varargs,
      */
-    private Response _lookup( DN dn, String... attributes )
+    private Entry _lookup( DN dn, String... attributes )
     {
-        int newId = messageId.incrementAndGet();
+        messageId.incrementAndGet();
 
-        SearchResultEntry resp = null;
+        Entry entry = null;
 
         try
         {
-            Entry entry = null;
-
             if ( attributes == null )
             {
                 entry = session.lookup( dn );
@@ -442,23 +442,20 @@ public class LdapCoreSessionConnection i
             {
                 entry = session.lookup( dn, attributes );
             }
-
-            resp = new SearchResultEntryImpl( newId );
-            resp.setEntry( entry );
         }
         catch ( LdapException e )
         {
             LOG.warn( e.getMessage(), e );
         }
 
-        return resp;
+        return entry;
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public Response lookup( String dn, String... attributes ) throws LdapException
+    public Entry lookup( String dn, String... attributes ) throws LdapException
     {
         return _lookup( new DN( dn ), attributes );
     }
@@ -467,7 +464,7 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    public Response lookup( DN dn ) throws LdapException
+    public Entry lookup( DN dn ) throws LdapException
     {
         return _lookup( dn );
     }
@@ -476,7 +473,7 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    public Response lookup( String dn ) throws LdapException
+    public Entry lookup( String dn ) throws LdapException
     {
         return _lookup( new DN( dn ) );
     }



Mime
View raw message