directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r536257 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
Date Tue, 08 May 2007 17:20:52 GMT
Author: elecharny
Date: Tue May  8 10:20:51 2007
New Revision: 536257

URL: http://svn.apache.org/viewvc?view=rev&rev=536257
Log:
Using the ServerSearchResult class to store the result. This save a DN parsing for each entry
found

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java?view=diff&rev=536257&r1=536256&r2=536257
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
Tue May  8 10:20:51 2007
@@ -44,6 +44,7 @@
 import org.apache.directory.shared.ldap.message.SearchResponseEntryImpl;
 import org.apache.directory.shared.ldap.message.SearchResponseReference;
 import org.apache.directory.shared.ldap.message.SearchResponseReferenceImpl;
+import org.apache.directory.shared.ldap.message.ServerSearchResult;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.mina.common.IoSession;
@@ -94,28 +95,22 @@
         {
             if ( underlying.hasMore() )
             {
-                SearchResult result = ( SearchResult ) underlying.next();
+                ServerSearchResult result = ( ServerSearchResult ) underlying.next();
 
                 /*
                  * Now we have to build the prefetched object from the 'result'
                  * local variable for the following call to next()
                  */
                 Attribute ref = result.getAttributes().get( "ref" );
-                if ( !ctx.isReferral( result.getName() )
+                
+                if ( !ctx.isReferral( result.getDn() )
                     || req.getControls().containsKey( ManageDsaITControl.CONTROL_OID ) )
                 {
                     SearchResponseEntry respEntry;
                     respEntry = new SearchResponseEntryImpl( req.getMessageId() );
                     respEntry.setAttributes( result.getAttributes() );
-                    try
-                    {
-                        respEntry.setObjectName( new LdapDN( result.getName() ) );
-                    }
-                    catch ( InvalidNameException ine )
-                    {
-                        log.error( "Invalid object name : " + result.getName(), ine);
-                        throw new RuntimeException( ine );
-                    }
+                    
+                    respEntry.setObjectName( result.getDn() );
                     
                     prefetched = respEntry;
                 }



Mime
View raw message