directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r628098 [1/3] - in /directory: apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ apacheds/branches/bigbang/co...
Date Fri, 15 Feb 2008 16:12:48 GMT
Author: elecharny
Date: Fri Feb 15 08:12:35 2008
New Revision: 628098

URL: http://svn.apache.org/viewvc?rev=628098&view=rev
Log:
Defined a ServerSearchResult class to replace the SearchResult JNDI class.
Changed the few tests which were relying on ServerResult.

Added:
    directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerSearchResult.java
      - copied, changed from r627438, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/ServerSearchResult.java
Removed:
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/ServerSearchResult.java
Modified:
    directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultEnumeration.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/interceptor/MockInterceptor.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/common/Constants.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddEntryOperation.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
    directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DefaultSearchHandler.java
    directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/MiscTest.java

Modified: directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java (original)
+++ directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java Fri Feb 15 08:12:35 2008
@@ -21,6 +21,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.NoSuchElementException;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
@@ -30,6 +31,7 @@
 import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.InvalidAttributeIdentifierException;
 import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
@@ -41,6 +43,7 @@
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.util.EmptyEnumeration;
 
 /**
  * A helper class used to manipulate Entries, Attributes and Values.
@@ -500,5 +503,89 @@
         }
         
         return null;
+    }
+    
+    
+    /**
+     * Encapsulate a ServerSearchResult enumeration into a SearchResult enumeration
+     * @param result The ServerSearchResult enumeration
+     * @return A SearchResultEnumeration
+     */
+    public static NamingEnumeration<SearchResult> toSearchResultEnum( final NamingEnumeration<ServerSearchResult> result )
+    {
+    	if ( result instanceof EmptyEnumeration<?> )
+    	{
+    		return new EmptyEnumeration<SearchResult>();
+    	}
+    	
+    	return new NamingEnumeration<SearchResult> ()
+    	{
+    	    public void close() throws NamingException
+    	    {
+    	        result.close();
+    	    }
+
+
+    	    /**
+    	     * @see javax.naming.NamingEnumeration#hasMore()
+    	     */
+    	    public boolean hasMore() throws NamingException
+    	    {
+    	        return result.hasMore();
+    	    }
+
+
+    	    /**
+    	     * @see javax.naming.NamingEnumeration#next()
+    	     */
+    	    public SearchResult next() throws NamingException
+    	    {
+    	        ServerSearchResult rec = result.next();
+    	        
+    	        SearchResult searchResult = new SearchResult( 
+    	        		rec.getDn().getUpName(), 
+    	        		rec.getObject(), 
+    	        		toAttributesImpl( rec.getServerEntry() ), 
+    	        		rec.isRelative() );
+    	        
+    	        return searchResult;
+    	    }
+    	    
+    	    
+    	    /**
+    	     * @see java.util.Enumeration#hasMoreElements()
+    	     */
+    	    public boolean hasMoreElements()
+    	    {
+    	        return result.hasMoreElements();
+    	    }
+
+
+    	    /**
+    	     * @see java.util.Enumeration#nextElement()
+    	     */
+    	    public SearchResult nextElement()
+    	    {
+    	    	try
+    	    	{
+	    	    	ServerSearchResult rec = result.next();
+	
+	    	        SearchResult searchResult = new SearchResult( 
+	    	        		rec.getDn().getUpName(), 
+	    	        		rec.getObject(), 
+	    	        		toAttributesImpl( rec.getServerEntry() ), 
+	    	        		rec.isRelative() );
+	    	        
+	    	        return searchResult;
+    	    	}
+    	    	catch ( NamingException ne )
+    	    	{
+    	            NoSuchElementException nsee = 
+    	                new NoSuchElementException( "Encountered NamingException on underlying enumeration." );
+    	            nsee.initCause( ne );
+    	            throw nsee;
+    	    	}
+    	    }
+    	};
     }
 }

Copied: directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerSearchResult.java (from r627438, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/ServerSearchResult.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerSearchResult.java?p2=directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerSearchResult.java&p1=directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/ServerSearchResult.java&r1=627438&r2=628098&rev=628098&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/ServerSearchResult.java (original)
+++ directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerSearchResult.java Fri Feb 15 08:12:35 2008
@@ -17,12 +17,10 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.shared.ldap.message;
+package org.apache.directory.server.core.entry;
 
 
 import javax.naming.InvalidNameException;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchResult;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 
@@ -33,7 +31,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ServerSearchResult extends SearchResult
+public class ServerSearchResult // extends SearchResult
 {
     /** Unique serial UID */
     public static final long serialVersionUID = 1L;
@@ -41,43 +39,57 @@
     /** Distinguished name for this result */
     private LdapDN dn;
     
+    /** The associated entry */
+    private ServerEntry serverEntry;
+    
+    /** Tells if the name is relative to the target context */
+    private boolean isRelative;
+    
+    /** The bound object */
+    private Object object;
+    
     /**
-     * @see javax.naming.directory.SearchResult#SearchResult(String, Object, Attributes)
+     * @see javax.naming.directory.SearchResult#SearchResult(String, Object, ServerEntry)
      */
-    public ServerSearchResult( String name, Object obj, Attributes attrs ) throws InvalidNameException
+    public ServerSearchResult( String name, Object obj, ServerEntry serverEntry ) throws InvalidNameException
     {
-        super( name, obj, attrs );
         dn = new LdapDN( name );
+        this.serverEntry = serverEntry;
+        this.serverEntry.setDn( dn );
     }
 
 
     /**
-     * @see javax.naming.directory.SearchResult#SearchResult(String, Object, Attributes)
+     * @see javax.naming.directory.SearchResult#SearchResult(String, Object, ServerEntry)
      */
-    public ServerSearchResult( String name, Object obj, Attributes attrs, boolean isRelative ) throws InvalidNameException
+    public ServerSearchResult( String name, Object obj, ServerEntry serverEntry, boolean isRelative ) throws InvalidNameException
     {
-        super( name, obj, attrs, isRelative );
         dn = new LdapDN( name );
+        this.serverEntry = serverEntry;
+        this.serverEntry.setDn( dn );
+        this.isRelative = isRelative;
     }
 
 
     /**
-     * @see javax.naming.directory.SearchResult#SearchResult(String, Object, Attributes)
+     * @see javax.naming.directory.SearchResult#SearchResult(String, Object, ServerEntry)
      */
-    public ServerSearchResult( String name, String className, Object obj, Attributes attrs ) throws InvalidNameException
+    public ServerSearchResult( String name, String className, Object obj, ServerEntry serverEntry ) throws InvalidNameException
     {
-        super( name, className, obj, attrs );
         dn = new LdapDN( name );
+        this.serverEntry = serverEntry;
+        this.serverEntry.setDn( dn );
     }
 
 
     /**
-     * @see javax.naming.directory.SearchResult#SearchResult(String, String, Object, Attributes, boolean)
+     * @see javax.naming.directory.SearchResult#SearchResult(String, String, Object, ServerEntry, boolean)
      */
-    public ServerSearchResult( String name, String className, Object obj, Attributes attrs, boolean isRelative ) throws InvalidNameException
+    public ServerSearchResult( String name, String className, Object obj, ServerEntry serverEntry, boolean isRelative ) throws InvalidNameException
     {
-        super( name, className, obj, attrs, isRelative );
         dn = new LdapDN( name );
+        this.serverEntry = serverEntry;
+        this.serverEntry.setDn( dn );
     }
 
 
@@ -88,4 +100,53 @@
     {
         return dn;
     }
+    
+    
+    /**
+     * @return The entry
+     */
+    public ServerEntry getServerEntry()
+    {
+    	return serverEntry;
+    }
+
+
+	public boolean isRelative() 
+	{
+		return isRelative;
+	}
+
+
+	public void setRelative( boolean isRelative ) 
+	{
+		this.isRelative = isRelative;
+	}
+
+
+	public void setServerEntry( ServerEntry serverEntry ) 
+	{
+		this.serverEntry = serverEntry;
+	}
+
+
+	public Object getObject() 
+	{
+		return object;
+	}
+
+
+	public void setObject( Object object ) 
+	{
+		this.object = object;
+	}
+	
+	
+	/**
+	 * @see Object#toString()
+	 */
+	public String toString()
+	{
+		String name = (dn == null ? "null" : ( dn == LdapDN.EMPTY_LDAPDN ? "\"\"" : dn.getUpName() ) );
+		return "ServerSearchResult : " + name + "\n" + serverEntry;
+	}
 }

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java (original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java Fri Feb 15 08:12:35 2008
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.integ.CiRunner;
@@ -424,7 +425,7 @@
 
 
     @Test
-    public void testSearchTimeLimit() throws NamingException
+    public void testSearchTimeLimit() throws NamingException, InterruptedException
     {
         LdapContext sysRoot = getSystemContext( service );
         createData( sysRoot );
@@ -438,36 +439,24 @@
 
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
         NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=*)", controls );
-        SearchResultFilteringEnumeration srfe = ( SearchResultFilteringEnumeration ) list;
-        srfe.addResultFilter( new SearchResultFilter()
-        {
-            public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
-                throws NamingException
-            {
-                try
-                {
-                    Thread.sleep( 201 );
-                }
-                catch ( InterruptedException e )
-                {
-                    e.printStackTrace();
-                }
-                return true;
-            }
-        } );
 
         try
         {
             while ( list.hasMore() )
             {
                 SearchResult result = ( SearchResult ) list.next();
+                
+                // leep 201 ms before fetching the next element ...
+            	Thread.sleep( 201 );
                 map.put( result.getName(), result.getAttributes() );
             }
+            
             fail( "Should not get here due to a TimeLimitExceededException" );
         }
         catch ( LdapTimeLimitExceededException e )
         {
         }
+        
         assertEquals( "Expected number of results returned was incorrect", 1, map.size() );
     }
     

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Fri Feb 15 08:12:35 2008
@@ -31,6 +31,7 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.Interceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
@@ -62,7 +63,6 @@
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.SearchResult;
 
 
 /**
@@ -266,7 +266,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
     {
         if ( IS_DEBUG )
         {
@@ -384,7 +384,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException
     {
         if ( IS_DEBUG )
         {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Fri Feb 15 08:12:35 2008
@@ -27,6 +27,7 @@
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
@@ -72,7 +73,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 
 import java.text.ParseException;
 import java.util.ArrayList;
@@ -255,14 +255,6 @@
     }
 
 
-    private LdapDN parseNormalized( String name ) throws NamingException
-    {
-        LdapDN dn = new LdapDN( name );
-        dn.normalize( atRegistry.getNormalizerMapping() );
-        return dn;
-    }
-
-
     /**
      * Adds perscriptiveACI tuples to a collection of tuples by accessing the
      * tupleCache.  The tuple cache is accessed for each A/C subentry
@@ -1003,12 +995,12 @@
     }
 
     
-    public NamingEnumeration<SearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
     {
         Invocation invocation = InvocationStack.getInstance().peek();
         ServerLdapContext ctx = ( ServerLdapContext ) invocation.getCaller();
         LdapPrincipal user = ctx.getPrincipal();
-        NamingEnumeration<SearchResult> e = next.list( opContext );
+        NamingEnumeration<ServerSearchResult> e = next.list( opContext );
         
         if ( isPrincipalAnAdministrator( user.getJndiName() ) || !enabled )
         {
@@ -1020,13 +1012,13 @@
     }
 
 
-    public NamingEnumeration<SearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException
     {
         Invocation invocation = InvocationStack.getInstance().peek();
         ServerLdapContext ctx = ( ServerLdapContext ) invocation.getCaller();
         LdapPrincipal user = ctx.getPrincipal();
         LdapDN principalDn = user.getJndiName();
-        NamingEnumeration<SearchResult> e = next.search( opContext );
+        NamingEnumeration<ServerSearchResult> e = next.search( opContext );
 
         boolean isSubschemaSubentryLookup = subschemaSubentryDn.equals( opContext.getDn().getNormName() );
         SearchControls searchCtls = opContext.getSearchControls();
@@ -1133,9 +1125,9 @@
     }
 
 
-    private boolean filter( Invocation invocation, LdapDN normName, SearchResult result ) throws NamingException
+    private boolean filter( Invocation invocation, LdapDN normName, ServerSearchResult result ) throws NamingException
     {
-        ServerEntry resultEntry = ServerEntryUtils.toServerEntry( result.getAttributes(), new LdapDN( result.getName() ) , registries );
+        ServerEntry resultEntry = result.getServerEntry();
 
         /*
          * First call hasPermission() for entry level "Browse" and "ReturnDN" perm
@@ -1177,7 +1169,6 @@
          * not allowed are removed from the attribute.  If the attribute has no more
          * values remaining then the entire attribute is removed.
          */
-        //NamingEnumeration<String> idList = result.getAttributes().getIDs();
         List<AttributeType> attributeToRemove = new ArrayList<AttributeType>();
         
         for ( AttributeType attributeType:resultEntry.getAttributeTypes() )
@@ -1244,7 +1235,7 @@
             resultEntry.remove( attributeType );
         }
 
-        result.setAttributes( ServerEntryUtils.toAttributesImpl( resultEntry ) );
+        result.setServerEntry( resultEntry );
         return true;
     }
 
@@ -1254,10 +1245,10 @@
      */
     class AuthorizationFilter implements SearchResultFilter
     {
-        public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
+        public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls )
             throws NamingException
         {
-            LdapDN normName = parseNormalized( result.getName() );
+            LdapDN normName = result.getDn().normalize( atRegistry.getNormalizerMapping() );
             return filter( invocation, normName, result );
         }
     }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Fri Feb 15 08:12:35 2008
@@ -24,6 +24,7 @@
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
@@ -46,7 +47,6 @@
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
-import org.apache.directory.shared.ldap.message.ServerSearchResult;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
@@ -57,7 +57,6 @@
 import javax.naming.NamingException;
 import javax.naming.NoPermissionException;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.HashSet;
 import java.util.Map;
@@ -498,9 +497,9 @@
     }
 
 
-    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
     {
-        NamingEnumeration<SearchResult> e = nextInterceptor.search( opContext );
+        NamingEnumeration<ServerSearchResult> e = nextInterceptor.search( opContext );
 
         if ( !enabled )
         {
@@ -512,7 +511,7 @@
         return new SearchResultFilteringEnumeration( e, opContext.getSearchControls(), invocation, 
             new SearchResultFilter()
         {
-            public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
+            public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls )
                 throws NamingException
             {
                 return DefaultAuthorizationInterceptor.this.isSearchable( invocation, result );
@@ -521,9 +520,9 @@
     }
 
 
-    public NamingEnumeration<SearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
     {
-        NamingEnumeration<SearchResult> result = nextInterceptor.list( opContext );
+        NamingEnumeration<ServerSearchResult> result = nextInterceptor.list( opContext );
         
         if ( !enabled )
         {
@@ -534,7 +533,7 @@
         
         return new SearchResultFilteringEnumeration( result, null, invocation, new SearchResultFilter()
         {
-            public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
+            public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls )
                 throws NamingException
             {
                 return DefaultAuthorizationInterceptor.this.isSearchable( invocation, result );
@@ -543,10 +542,10 @@
     }
 
 
-    private boolean isSearchable( Invocation invocation, SearchResult result ) throws NamingException
+    private boolean isSearchable( Invocation invocation, ServerSearchResult result ) throws NamingException
     {
         LdapDN principalDn = ( ( ServerContext ) invocation.getCaller() ).getPrincipal().getJndiName();
-        LdapDN dn = ((ServerSearchResult)result).getDn();
+        LdapDN dn = result.getDn();
         
         if ( !dn.isNormalized() )
         {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Fri Feb 15 08:12:35 2008
@@ -30,7 +30,7 @@
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
@@ -52,7 +52,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 
 
 /**
@@ -138,15 +137,14 @@
             LdapDN baseDn = new LdapDN( suffix );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            NamingEnumeration<SearchResult> results = nexus.search(
+            NamingEnumeration<ServerSearchResult> results = nexus.search(
                     new SearchOperationContext( registries, baseDn, AliasDerefMode.DEREF_ALWAYS, filter, ctls ) );
 
             while ( results.hasMore() )
             {
-                SearchResult result = results.next();
-                LdapDN groupDn = parseNormalized( result.getName() );
-                ServerAttribute members = getMemberAttribute( 
-                    ServerEntryUtils.toServerEntry( result.getAttributes(), groupDn, registries ) );
+            	ServerSearchResult result = results.next();
+                LdapDN groupDn = result.getDn().normalize( normalizerMap );
+                ServerAttribute members = getMemberAttribute( result.getServerEntry() );
 
                 if ( members != null )
                 {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Fri Feb 15 08:12:35 2008
@@ -22,7 +22,7 @@
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
@@ -50,7 +50,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -132,15 +131,15 @@
                     SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            NamingEnumeration<SearchResult> results = nexus.search( 
+            NamingEnumeration<ServerSearchResult> results = nexus.search( 
                 new SearchOperationContext( registries, baseDn,
                     AliasDerefMode.NEVER_DEREF_ALIASES, filter, ctls ) );
             
             while ( results.hasMore() )
             {
-                SearchResult result = results.next();
-                LdapDN subentryDn = new LdapDN( result.getName() ).normalize( normalizerMap );
-                ServerEntry serverEntry = ServerEntryUtils.toServerEntry( result.getAttributes(), subentryDn, registries );
+            	ServerSearchResult result = results.next();
+                LdapDN subentryDn = result.getDn().normalize( normalizerMap );
+                ServerEntry serverEntry = result.getServerEntry();
                 ServerAttribute aci = serverEntry.get( prescriptiveAciAT );
                 
                 if ( aci == null )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java Fri Feb 15 08:12:35 2008
@@ -24,6 +24,7 @@
 import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.event.EventInterceptor;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.normalization.NormalizationInterceptor;
@@ -45,7 +46,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
@@ -160,7 +160,7 @@
     private int getImmSubCount( Registries registries, PartitionNexusProxy proxy, LdapDN entryName ) throws NamingException
     {
         int cnt = 0;
-        NamingEnumeration<SearchResult> e = null;
+        NamingEnumeration<ServerSearchResult> e = null;
         
         try
         {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Fri Feb 15 08:12:35 2008
@@ -24,7 +24,7 @@
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
@@ -41,14 +41,12 @@
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.message.ServerSearchResult;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -83,7 +81,7 @@
      */
     private final SearchResultFilter SEARCH_FILTER = new SearchResultFilter()
     {
-        public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
+        public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls )
             throws NamingException
         {
             LdapDN name = ((ServerSearchResult)result).getDn();
@@ -93,13 +91,10 @@
             	name = LdapDN.normalize( name, atRegistry.getNormalizerMapping() );
             }
             
-            ServerEntry entry = ServerEntryUtils.toServerEntry( 
-                result.getAttributes(), 
-                name,
-                registries );
+            ServerEntry entry = result.getServerEntry();
             String[] retAttrs = controls.getReturningAttributes();
             addCollectiveAttributes( name, entry, retAttrs );
-            result.setAttributes( ServerEntryUtils.toAttributesImpl( entry ) );
+            result.setServerEntry( entry );
             return true;
         }
     };
@@ -334,18 +329,18 @@
     }
 
 
-    public NamingEnumeration<SearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
     {
-        NamingEnumeration<SearchResult> result = nextInterceptor.list( opContext );
+        NamingEnumeration<ServerSearchResult> result = nextInterceptor.list( opContext );
         Invocation invocation = InvocationStack.getInstance().peek();
         
         return new SearchResultFilteringEnumeration( result, new SearchControls(), invocation, SEARCH_FILTER, "List collective Filter" );
     }
 
 
-    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
     {
-        NamingEnumeration<SearchResult> result = nextInterceptor.search( opContext );
+        NamingEnumeration<ServerSearchResult> result = nextInterceptor.search( opContext );
         Invocation invocation = InvocationStack.getInstance().peek();
         
         return new SearchResultFilteringEnumeration( 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java Fri Feb 15 08:12:35 2008
@@ -27,11 +27,11 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 
-import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerSearchResult;
+import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.referral.ReferralLut;
@@ -53,16 +53,16 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ReferralHandlingEnumeration implements NamingEnumeration<SearchResult>
+public class ReferralHandlingEnumeration implements NamingEnumeration<ServerSearchResult>
 {
     private final Logger log = LoggerFactory.getLogger( ReferralHandlingEnumeration.class );
-    private final List<SearchResult> referrals = new ArrayList<SearchResult>();
-    private final NamingEnumeration<SearchResult> underlying;
+    private final List<ServerSearchResult> referrals = new ArrayList<ServerSearchResult>();
+    private final NamingEnumeration<ServerSearchResult> underlying;
     private final ReferralLut lut;
     private final PartitionNexus nexus;
     private final boolean doThrow;
     private final int scope;
-    private SearchResult prefetched;
+    private ServerSearchResult prefetched;
     private int refIndex = -1;
 
     /**
@@ -74,7 +74,7 @@
     private Registries registries;
 
     public ReferralHandlingEnumeration( 
-            NamingEnumeration<SearchResult> underlying, 
+            NamingEnumeration<ServerSearchResult> underlying, 
             ReferralLut lut, 
             Registries registries, 
             PartitionNexus nexus, 
@@ -96,8 +96,8 @@
     {
         while ( underlying.hasMore() )
         {
-            SearchResult result = underlying.next();
-            LdapDN dn = new LdapDN( result.getName() );
+        	ServerSearchResult result = underlying.next();
+            LdapDN dn = new LdapDN( result.getDn() );
             dn.normalize( normalizerMap );
             
             if ( lut.isReferral( dn ) )
@@ -119,9 +119,9 @@
     }
 
 
-    public SearchResult next() throws NamingException
+    public ServerSearchResult next() throws NamingException
     {
-        SearchResult retval = prefetched;
+    	ServerSearchResult retval = prefetched;
         prefetch();
         return retval;
     }
@@ -165,7 +165,7 @@
     }
 
 
-    public SearchResult nextElement()
+    public ServerSearchResult nextElement()
     {
         try
         {
@@ -183,26 +183,26 @@
     public void doReferralExceptionOnSearchBase( Registries registries ) throws NamingException
     {
         // the refs attribute may be filtered out so we might need to lookup the entry
-        Attribute refs = prefetched.getAttributes().get( SchemaConstants.REF_AT );
+        ServerAttribute refs = prefetched.getServerEntry().get( SchemaConstants.REF_AT );
         
         if ( refs == null )
         {
-            LdapDN prefetchedDn = new LdapDN( prefetched.getName() );
+            LdapDN prefetchedDn = new LdapDN( prefetched.getDn() );
             prefetchedDn.normalize( normalizerMap );
-            refs = ServerEntryUtils.toAttributeImpl( nexus.lookup( new LookupOperationContext( registries, prefetchedDn ) ).get( SchemaConstants.REF_AT ) );
+            refs = nexus.lookup( new LookupOperationContext( registries, prefetchedDn ) ).get( SchemaConstants.REF_AT );
         }
 
         if ( refs == null )
         {
-            throw new IllegalStateException( prefetched.getName()
+            throw new IllegalStateException( prefetched.getDn()
                 + " does not seem like a referral but we're trying to handle it as one." );
         }
 
         List<String> list = new ArrayList<String>( refs.size() );
         
-        for ( int ii = 0; ii < refs.size(); ii++ )
+        for ( ServerValue<?> value:refs )
         {
-            String val = ( String ) refs.get( ii );
+            String val = (String)value.get();
 
             // need to add non-ldap URLs as-is
             if ( !val.startsWith( "ldap" ) )
@@ -220,7 +220,7 @@
             catch ( LdapURLEncodingException e )
             {
                 log
-                    .error( "Bad URL (" + val + ") for ref in " + prefetched.getName()
+                    .error( "Bad URL (" + val + ") for ref in " + prefetched.getDn()
                         + ".  Reference will be ignored." );
             }
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultEnumeration.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultEnumeration.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultEnumeration.java Fri Feb 15 08:12:35 2008
@@ -21,7 +21,8 @@
 
 
 import javax.naming.NamingEnumeration;
-import javax.naming.directory.SearchResult;
+
+import org.apache.directory.server.core.entry.ServerSearchResult;
 
 
 /**
@@ -30,6 +31,6 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface SearchResultEnumeration extends NamingEnumeration<SearchResult>
+public interface SearchResultEnumeration extends NamingEnumeration<ServerSearchResult>
 {
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilter.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilter.java Fri Feb 15 08:12:35 2008
@@ -20,11 +20,11 @@
 package org.apache.directory.server.core.enumeration;
 
 
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.invocation.Invocation;
 
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 
 
 /**
@@ -48,5 +48,5 @@
      * @return true if the result is to be returned, false if it is to be
      * discarded from the result set
      */
-    boolean accept( Invocation invocation, SearchResult result, SearchControls controls ) throws NamingException;
+    boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls ) throws NamingException;
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java Fri Feb 15 08:12:35 2008
@@ -31,10 +31,11 @@
 import javax.naming.Name;
 import javax.naming.spi.DirectoryManager;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.shared.ldap.exception.OperationAbandonedException;
 import org.apache.directory.shared.ldap.message.AbandonListener;
@@ -53,7 +54,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class SearchResultFilteringEnumeration implements NamingEnumeration<SearchResult>, AbandonListener
+public class SearchResultFilteringEnumeration implements NamingEnumeration<ServerSearchResult>, AbandonListener
 {
     /** the logger used by this class */
     private static final Logger log = LoggerFactory.getLogger( SearchResultFilteringEnumeration.class );
@@ -62,10 +63,10 @@
     private final List<SearchResultFilter> filters;
     
     /** the underlying decorated enumeration */
-    private final NamingEnumeration<SearchResult> decorated;
+    private final NamingEnumeration<ServerSearchResult> decorated;
 
     /** the first accepted search result that is prefetched */
-    private SearchResult prefetched;
+    private ServerSearchResult prefetched;
     
     /** flag storing closed state of this naming enumeration */
     private boolean isClosed = false;
@@ -98,7 +99,7 @@
      * creating this enumeration
      * @param invocation the invocation representing the seach that created this enumeration
      */
-    public SearchResultFilteringEnumeration( NamingEnumeration<SearchResult> decorated, SearchControls searchControls,
+    public SearchResultFilteringEnumeration( NamingEnumeration<ServerSearchResult> decorated, SearchControls searchControls,
         Invocation invocation, SearchResultFilter filter, String name ) throws NamingException
     {
         this.searchControls = searchControls;
@@ -128,7 +129,7 @@
      * creating this enumeration
      * @param invocation the invocation representing the seach that created this enumeration
      */
-    public SearchResultFilteringEnumeration( NamingEnumeration<SearchResult> decorated, SearchControls searchControls,
+    public SearchResultFilteringEnumeration( NamingEnumeration<ServerSearchResult> decorated, SearchControls searchControls,
         Invocation invocation, List<SearchResultFilter> filters, String name ) throws NamingException
     {
         this.searchControls = searchControls;
@@ -209,9 +210,9 @@
     }
 
 
-    public SearchResult next() throws NamingException
+    public ServerSearchResult next() throws NamingException
     {
-        SearchResult retVal = this.prefetched;
+    	ServerSearchResult retVal = this.prefetched;
         prefetch();
         return retVal;
     }
@@ -227,9 +228,9 @@
     }
 
 
-    public SearchResult nextElement()
+    public ServerSearchResult nextElement()
     {
-        SearchResult retVal = this.prefetched;
+    	ServerSearchResult retVal = this.prefetched;
 
         try
         {
@@ -249,29 +250,29 @@
     // ------------------------------------------------------------------------
 
     
-    private void applyObjectFactories( SearchResult result ) throws NamingException
+    private void applyObjectFactories( ServerSearchResult result ) throws NamingException
     {
         // if already populated or no factories are available just return
-        if ( result.getObject() != null || !applyObjectFactories )
+        if ( ( result.getObject() != null ) || !applyObjectFactories )
         {
             return;
         }
 
         DirContext ctx = ( DirContext ) invocation.getCaller();
         Hashtable<?,?> env = ctx.getEnvironment();
-        Attributes attrs = result.getAttributes();
-        Name name = new LdapDN( result.getName() );
+        ServerEntry serverEntry = result.getServerEntry();
+        Name name = new LdapDN( result.getDn() );
         
         try
         {
-            Object obj = DirectoryManager.getObjectInstance( null, name, ctx, env, attrs );
+            Object obj = DirectoryManager.getObjectInstance( null, name, ctx, env, ServerEntryUtils.toAttributesImpl( serverEntry ) );
             result.setObject( obj );
         }
         catch ( Exception e )
         {
             StringBuffer buf = new StringBuffer();
             buf.append( "ObjectFactories threw exception while attempting to generate an object for " );
-            buf.append( result.getName() );
+            buf.append( result.getDn() );
             buf.append( ". Call on SearchResult.getObject() will return null." );
             log.warn( buf.toString(), e );
         }
@@ -290,7 +291,8 @@
      */
     private void prefetch() throws NamingException
     {
-        SearchResult tmp;
+    	ServerSearchResult tmp;
+    	
         if ( abandoned )
         {
             this.close();

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Fri Feb 15 08:12:35 2008
@@ -23,6 +23,7 @@
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
@@ -59,7 +60,6 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.SearchResult;
 
 import java.util.List;
 import java.util.Map;
@@ -233,7 +233,7 @@
 
         // check if entry to delete has children (only leaves can be deleted)
         boolean hasChildren = false;
-        NamingEnumeration<SearchResult> list = nextInterceptor.list( new ListOperationContext( registries, name ) );
+        NamingEnumeration<ServerSearchResult> list = nextInterceptor.list( new ListOperationContext( registries, name ) );
         
         if ( list.hasMore() )
         {
@@ -264,12 +264,12 @@
     /**
      * Checks to see the base being searched exists, otherwise throws the appropriate LdapException.
      */
-    public NamingEnumeration<SearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
     {
         if ( opContext.getDn().getNormName().equals( subschemSubentryDn.getNormName() ) )
         {
             // there is nothing under the schema subentry
-            return new EmptyEnumeration<SearchResult>();
+            return new EmptyEnumeration<ServerSearchResult>();
         }
         
         // check if entry to search exists
@@ -517,13 +517,13 @@
     /**
      * Checks to see the entry being searched exists, otherwise throws the appropriate LdapException.
      */
-    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
     {
         LdapDN base = opContext.getDn();
 
         try
         {
-	        NamingEnumeration<SearchResult> result =  nextInterceptor.search( opContext );
+	        NamingEnumeration<ServerSearchResult> result =  nextInterceptor.search( opContext );
 	        
 	        if ( ! result.hasMoreElements() )
 	        {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java Fri Feb 15 08:12:35 2008
@@ -23,6 +23,7 @@
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
@@ -49,7 +50,6 @@
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.Iterator;
 
@@ -161,7 +161,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> list( NextInterceptor next, ListOperationContext opContext ) 
+    public NamingEnumeration<ServerSearchResult> list( NextInterceptor next, ListOperationContext opContext ) 
         throws NamingException
     {
         return next.list( opContext );
@@ -206,7 +206,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException
     {
         return next.search( opContext );
     }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java Fri Feb 15 08:12:35 2008
@@ -22,6 +22,7 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
@@ -47,7 +48,6 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.SearchResult;
 import java.util.Iterator;
 
 
@@ -199,13 +199,13 @@
     /**
      * Filters {@link Partition#list( ListOperationContext )} call.
      */
-    NamingEnumeration<SearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException;
+    NamingEnumeration<ServerSearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException;
 
 
     /**
      * Filters {@link Partition#search( SearchOperationContext )} call.
      */
-    NamingEnumeration<SearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException;
+    NamingEnumeration<ServerSearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java Fri Feb 15 08:12:35 2008
@@ -28,6 +28,7 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
@@ -58,7 +59,6 @@
 import javax.naming.ConfigurationException;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.SearchResult;
 
 
 /**
@@ -144,13 +144,13 @@
         }
 
 
-        public NamingEnumeration<SearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
+        public NamingEnumeration<ServerSearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
         {
             return nexus.list( opContext );
         }
 
 
-        public NamingEnumeration<SearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException
+        public NamingEnumeration<ServerSearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException
         {
             return nexus.search( opContext );
         }
@@ -795,7 +795,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> list( ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( ListOperationContext opContext ) throws NamingException
     {
         Entry entry = getStartingEntry();
         Interceptor head = entry.interceptor;
@@ -817,7 +817,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> search( SearchOperationContext opContext )
+    public NamingEnumeration<ServerSearchResult> search( SearchOperationContext opContext )
         throws NamingException
     {
         Entry entry = getStartingEntry();
@@ -1185,7 +1185,7 @@
                 }
 
                 
-                public NamingEnumeration<SearchResult> list( ListOperationContext opContext ) throws NamingException
+                public NamingEnumeration<ServerSearchResult> list( ListOperationContext opContext ) throws NamingException
                 {
                     Entry next = getNextEntry();
                     Interceptor interceptor = next.interceptor;
@@ -1206,7 +1206,7 @@
                 }
 
 
-                public NamingEnumeration<SearchResult> search( SearchOperationContext opContext )
+                public NamingEnumeration<ServerSearchResult> search( SearchOperationContext opContext )
                     throws NamingException
                 {
                     Entry next = getNextEntry();

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java Fri Feb 15 08:12:35 2008
@@ -24,9 +24,9 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
@@ -122,13 +122,13 @@
     /**
      * Calls the next interceptor's {@link Interceptor#list( NextInterceptor, ListOperationContext )}.
      */
-    NamingEnumeration<SearchResult> list( ListOperationContext opContext ) throws NamingException;
+    NamingEnumeration<ServerSearchResult> list( ListOperationContext opContext ) throws NamingException;
 
 
     /**
      * Calls the next interceptor's {@link Interceptor#search( NextInterceptor, SearchOperationContext opContext )}.
      */
-    NamingEnumeration<SearchResult> search( SearchOperationContext opContext )
+    NamingEnumeration<ServerSearchResult> search( SearchOperationContext opContext )
         throws NamingException;
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java Fri Feb 15 08:12:35 2008
@@ -34,7 +34,6 @@
 import java.io.ObjectOutputStream;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
 
 /**

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=628098&r1=628097&r2=628098&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 Fri Feb 15 08:12:35 2008
@@ -27,6 +27,7 @@
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
@@ -69,7 +70,6 @@
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 import javax.naming.event.EventContext;
 import javax.naming.event.NamingListener;
 import javax.naming.ldap.Control;
@@ -256,7 +256,7 @@
      * @param searchControls
      * @return
      */
-    protected NamingEnumeration<SearchResult> doSearchOperation( LdapDN dn, AliasDerefMode aliasDerefMode,
+    protected NamingEnumeration<ServerSearchResult> doSearchOperation( LdapDN dn, AliasDerefMode aliasDerefMode,
                                                                  ExprNode filter, SearchControls searchControls )
         throws NamingException
     {
@@ -265,7 +265,7 @@
         opCtx.addRequestControls( requestControls );
         
         // execute search operation
-        NamingEnumeration<SearchResult> results = nexusProxy.search( opCtx );
+        NamingEnumeration<ServerSearchResult> results = nexusProxy.search( opCtx );
 
         // clear the request controls and set the response controls 
         requestControls = EMPTY_CONTROLS;
@@ -278,14 +278,14 @@
     /**
      * Used to encapsulate [de]marshalling of controls before and after list operations.
      */
-    protected NamingEnumeration<SearchResult> doListOperation( LdapDN target ) throws NamingException
+    protected NamingEnumeration<ServerSearchResult> doListOperation( LdapDN target ) throws NamingException
     {
         // setup the op context and populate with request controls
         ListOperationContext opCtx = new ListOperationContext( registries, target );
         opCtx.addRequestControls( requestControls );
         
         // execute list operation
-        NamingEnumeration<SearchResult> results = nexusProxy.list( opCtx );
+        NamingEnumeration<ServerSearchResult> results = nexusProxy.list( opCtx );
 
         // clear the request controls and set the response controls 
         requestControls = EMPTY_CONTROLS;
@@ -1029,7 +1029,7 @@
     @SuppressWarnings(value={"unchecked"})
     public NamingEnumeration list( Name name ) throws NamingException
     {
-        return doListOperation( buildTarget( name ) );
+        return ServerEntryUtils.toSearchResultEnum( doListOperation( buildTarget( name ) ) );
     }
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java Fri Feb 15 08:12:35 2008
@@ -543,7 +543,7 @@
         {
             PresenceNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );
             AliasDerefMode aliasDerefMode = AliasDerefMode.getEnum( getEnvironment() );
-            return doSearchOperation( target, aliasDerefMode, filter, ctls );
+            return ServerEntryUtils.toSearchResultEnum( doSearchOperation( target, aliasDerefMode, filter, ctls ) );
         }
 
         // Handle simple filter expressions without multiple terms
@@ -568,7 +568,7 @@
                 }
 
                 AliasDerefMode aliasDerefMode = AliasDerefMode.getEnum( getEnvironment() );
-                return doSearchOperation( target, aliasDerefMode, node, ctls );
+                return ServerEntryUtils.toSearchResultEnum( doSearchOperation( target, aliasDerefMode, node, ctls ) );
             }
         }
         
@@ -615,7 +615,7 @@
         }
 
         AliasDerefMode aliasDerefMode = AliasDerefMode.getEnum( getEnvironment() );
-        return doSearchOperation( target, aliasDerefMode, filter, ctls );
+        return ServerEntryUtils.toSearchResultEnum( doSearchOperation( target, aliasDerefMode, filter, ctls ) );
     }
 
 
@@ -644,7 +644,7 @@
     {
         LdapDN target = buildTarget( name );
         AliasDerefMode aliasDerefMode = AliasDerefMode.getEnum( getEnvironment() );
-        return doSearchOperation( target, aliasDerefMode, filter, cons );
+        return ServerEntryUtils.toSearchResultEnum( doSearchOperation( target, aliasDerefMode, filter, cons ) );
     }
 
 
@@ -670,7 +670,7 @@
         }
 
         AliasDerefMode aliasDerefMode = AliasDerefMode.getEnum( getEnvironment() );
-        return doSearchOperation( target, aliasDerefMode, filterNode, cons );
+        return ServerEntryUtils.toSearchResultEnum( doSearchOperation( target, aliasDerefMode, filterNode, cons ) );
     }
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java Fri Feb 15 08:12:35 2008
@@ -22,6 +22,7 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
@@ -54,7 +55,6 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.SearchResult;
 import java.util.Map;
 
 
@@ -161,7 +161,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
     {
         ExprNode filter = opContext.getFilter();
         opContext.getDn().normalize( attrNormalizers );
@@ -170,7 +170,7 @@
         if ( result == null )
         {
             LOG.warn( "undefined filter based on undefined attributeType not evaluted at all.  Returning empty enumeration." );
-            return new EmptyEnumeration<SearchResult>();
+            return new EmptyEnumeration<ServerSearchResult>();
         }
         else
         {
@@ -189,7 +189,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
     {
         opContext.getDn().normalize( attrNormalizers );
         return nextInterceptor.list( opContext );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=628098&r1=628097&r2=628098&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Fri Feb 15 08:12:35 2008
@@ -31,8 +31,8 @@
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.entry.ServerModification;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
@@ -49,7 +49,6 @@
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
-import org.apache.directory.server.core.jndi.ServerLdapContext;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -65,7 +64,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 
 
 /**
@@ -83,13 +81,10 @@
 {
     private final SearchResultFilter DENORMALIZING_SEARCH_FILTER = new SearchResultFilter()
     {
-        public boolean accept( Invocation invocation, SearchResult result, SearchControls controls ) 
+        public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls ) 
             throws NamingException
         {
-            ServerEntry serverEntry = ServerEntryUtils.toServerEntry( 
-                result.getAttributes(), 
-                new LdapDN( result.getName() ), 
-                ((ServerLdapContext)invocation.getCaller()).getService().getRegistries() );
+            ServerEntry serverEntry = result.getServerEntry(); 
             
             if ( controls.getReturningAttributes() == null )
             {
@@ -98,7 +93,7 @@
             
             boolean denormalized = filterDenormalized( serverEntry );
             
-            result.setAttributes( ServerEntryUtils.toAttributesImpl( serverEntry ) );
+            result.setServerEntry( serverEntry );
             
             return denormalized;
         }
@@ -109,13 +104,10 @@
      */
     private final SearchResultFilter SEARCH_FILTER = new SearchResultFilter()
     {
-        public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
+        public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls )
             throws NamingException
         {
-            ServerEntry serverEntry = ServerEntryUtils.toServerEntry( 
-                result.getAttributes(), 
-                new LdapDN( result.getName() ), 
-                ((ServerLdapContext)invocation.getCaller()).getService().getRegistries() );
+            ServerEntry serverEntry = result.getServerEntry(); 
             
             return controls.getReturningAttributes() != null || filterOperationalAttributes( serverEntry );
         }
@@ -304,19 +296,19 @@
     }
 
 
-    public NamingEnumeration<SearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
     {
-        NamingEnumeration<SearchResult> result = nextInterceptor.list( opContext );
+        NamingEnumeration<ServerSearchResult> result = nextInterceptor.list( opContext );
         Invocation invocation = InvocationStack.getInstance().peek();
         
         return new SearchResultFilteringEnumeration( result, new SearchControls(), invocation, SEARCH_FILTER, "List Operational Filter" );
     }
 
 
-    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
     {
         Invocation invocation = InvocationStack.getInstance().peek();
-        NamingEnumeration<SearchResult> result = nextInterceptor.search( opContext );
+        NamingEnumeration<ServerSearchResult> result = nextInterceptor.search( opContext );
         SearchControls searchCtls = opContext.getSearchControls();
         
         if ( searchCtls.getReturningAttributes() != null )



Mime
View raw message