directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r659432 - in /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi: NamingEnumerationAdapter.java ServerContext.java
Date Fri, 23 May 2008 05:36:29 GMT
Author: akarasulu
Date: Thu May 22 22:36:26 2008
New Revision: 659432

URL: http://svn.apache.org/viewvc?rev=659432&view=rev
Log:
removing SearchResultFilter and SearchResultFilterEnumeration and replacing with EntryFilter
and EntryFilteringCursor

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/NamingEnumerationAdapter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/NamingEnumerationAdapter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/NamingEnumerationAdapter.java?rev=659432&r1=659431&r2=659432&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/NamingEnumerationAdapter.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/NamingEnumerationAdapter.java
Thu May 22 22:36:26 2008
@@ -24,8 +24,10 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
+import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.entry.ClonedServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 
 
@@ -35,7 +37,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class NamingEnumerationAdapter implements NamingEnumeration<ClonedServerEntry>
+public class NamingEnumerationAdapter implements NamingEnumeration<SearchResult>
 {
     private final EntryFilteringCursor cursor;
     private boolean available = false;
@@ -88,7 +90,7 @@
     /* 
      * @see NamingEnumeration#next()
      */
-    public ClonedServerEntry next() throws NamingException
+    public SearchResult next() throws NamingException
     {
         ClonedServerEntry entry = null;
         
@@ -105,7 +107,7 @@
             JndiUtils.wrap( e );
         }
         
-        return entry;
+        return new SearchResult( entry.getDn().getUpName(), null, ServerEntryUtils.toAttributesImpl(
entry ) );
     }
 
 
@@ -121,7 +123,7 @@
     /* 
      * @see Enumeration#nextElement()
      */
-    public ClonedServerEntry nextElement()
+    public SearchResult nextElement()
     {
         ClonedServerEntry entry = null;
         
@@ -140,6 +142,6 @@
             throw nsee;
         }
         
-        return entry;
+        return new SearchResult( entry.getDn().getUpName(), null, ServerEntryUtils.toAttributesImpl(
entry ) );
     }
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=659432&r1=659431&r2=659432&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Thu May 22 22:36:26 2008
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.jndi;
 
 
-import org.apache.commons.lang.NotImplementedException;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.authn.AuthenticationInterceptor;
 import org.apache.directory.server.core.authn.LdapPrincipal;
@@ -1140,9 +1139,15 @@
         { "unchecked" })
     public NamingEnumeration list( Name name ) throws NamingException
     {
-//        return ServerEntryUtils.toSearchResultEnum( doListOperation( buildTarget( name
) ) );
-        // TODO not implemented
-        throw new NotImplementedException();
+        try
+        {
+            return new NamingEnumerationAdapter( doListOperation( buildTarget( name ) ) );
+        }
+        catch ( Exception e )
+        {
+            JndiUtils.wrap( e );
+            return null; // shut up compiler
+        }
     }
 
 



Mime
View raw message