directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r291082 - /directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/SearchHandler.java
Date Fri, 23 Sep 2005 06:30:51 GMT
Author: akarasulu
Date: Thu Sep 22 23:30:48 2005
New Revision: 291082

URL: http://svn.apache.org/viewcvs?rev=291082&view=rev
Log:
using new overload removing hack that stuffs filter into jndi env

Modified:
    directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/SearchHandler.java

Modified: directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/SearchHandler.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/SearchHandler.java?rev=291082&r1=291081&r2=291082&view=diff
==============================================================================
--- directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/SearchHandler.java
(original)
+++ directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/SearchHandler.java
Thu Sep 22 23:30:48 2005
@@ -42,6 +42,8 @@
 import org.apache.ldap.common.message.SearchResponseReferenceImpl;
 import org.apache.ldap.common.util.ArrayUtils;
 import org.apache.ldap.common.util.ExceptionUtils;
+import org.apache.ldap.common.name.LdapName;
+import org.apache.ldap.server.jndi.ServerLdapContext;
 import org.apache.mina.protocol.ProtocolSession;
 import org.apache.mina.protocol.handler.MessageHandler;
 
@@ -62,7 +64,7 @@
 
     public void messageReceived( ProtocolSession session, Object request )
     {
-        LdapContext ctx;
+        ServerLdapContext ctx;
         SearchRequest req = ( SearchRequest ) request;
         NamingEnumeration list = null;
 
@@ -92,28 +94,9 @@
 
         try
         {
-            ctx = SessionRegistry.getSingleton().getLdapContext( session, null, true );
+            ctx = ( ServerLdapContext ) SessionRegistry.getSingleton().getLdapContext( session,
null, true ).lookup( "" );
             ctx.addToEnvironment( DEREFALIASES_KEY, req.getDerefAliases().getName() );
-
-            /*
-             * Eve JNDI Provider Specific Hack!
-             *
-             * Hack to get around not having to generate the filter string and
-             * reparse the expression back into a tree: instead we sneak the
-             * filter into the environment so the Eve context implementation
-             * can pick it up.
-             *
-             * @todo change this so we test for the Eve provider to use the hack
-             * @todo find better way to do this
-             * @todo if provider is not Eve provider then we need to generate filter
-             *
-             * To generate we're going to need a visitor for this.  Can't use the
-             * toString() method which uses scan counts and is for pretty printing
-             * the filter.
-             */
-            ctx.addToEnvironment( "__filter__", req.getFilter() );
-            list = ctx.search( req.getBase(), null, controls );
-            ctx.removeFromEnvironment( "__filter__" );
+            list = ctx.search( new LdapName( req.getBase() ), req.getFilter(), controls );
 
             if( list.hasMore() )
             {



Mime
View raw message