Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 42156 invoked from network); 23 Aug 2010 10:28:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Aug 2010 10:28:06 -0000 Received: (qmail 63639 invoked by uid 500); 23 Aug 2010 10:28:04 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 62872 invoked by uid 500); 23 Aug 2010 10:28:03 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 62865 invoked by uid 99); 23 Aug 2010 10:28:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Aug 2010 10:28:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Aug 2010 10:28:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EA256238899C; Mon, 23 Aug 2010 10:26:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: kayyagari@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100823102644.EA256238899C@eris.apache.org> 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 ) ); }