directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r638228 [11/20] - in /directory/sandbox/akarasulu/bigbang/apacheds: ./ apacheds-xbean-spring/src/site/ benchmarks/src/site/ bootstrap-extract/src/site/ bootstrap-partition/src/site/ bootstrap-plugin/src/main/java/org/apache/directory/server...
Date Tue, 18 Mar 2008 06:13:18 GMT
Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java Mon Mar 17 23:12:41 2008
@@ -28,13 +28,11 @@
 import java.util.Set;
 
 import javax.naming.Context;
-import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.ServiceUnavailableException;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 import javax.naming.event.EventContext;
 import javax.naming.event.NamingListener;
 import javax.naming.ldap.LdapContext;
@@ -44,7 +42,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.ServerEntryUtils;
+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.event.EventInterceptor;
@@ -479,13 +477,13 @@
     }
 
 
-    public NamingEnumeration<SearchResult> list( ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( ListOperationContext opContext ) throws NamingException
     {
         return list( opContext, null );
     }
 
 
-    public NamingEnumeration<SearchResult> list( ListOperationContext opContext, Collection<String> bypass )
+    public NamingEnumeration<ServerSearchResult> list( ListOperationContext opContext, Collection<String> bypass )
             throws NamingException
     {
         ensureStarted();
@@ -503,10 +501,10 @@
     }
 
 
-    public NamingEnumeration<SearchResult> search( SearchOperationContext opContext )
+    public NamingEnumeration<ServerSearchResult> search( SearchOperationContext opContext )
             throws NamingException
     {
-        NamingEnumeration<SearchResult> ne = search( opContext, null );
+        NamingEnumeration<ServerSearchResult> ne = search( opContext, null );
 
         if ( ne instanceof SearchResultFilteringEnumeration )
         {
@@ -524,7 +522,7 @@
                     int count = 1; // with prefetch we've missed one which is ok since 1 is the minimum
 
 
-                    public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
+                    public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls )
                             throws NamingException
                     {
                         if ( controls.getTimeLimit() > 0 )
@@ -555,7 +553,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> search( SearchOperationContext opContext, Collection<String> bypass )
+    public NamingEnumeration<ServerSearchResult> search( SearchOperationContext opContext, Collection<String> bypass )
             throws NamingException
     {
         ensureStarted();
@@ -573,7 +571,7 @@
     }
 
 
-    public Attributes lookup( LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext opContext ) throws NamingException
     {
         if ( opContext.getDn().size() == 0 )
         {
@@ -585,11 +583,11 @@
                 {
                     if ( ROOT_DSE_NO_OPERATIONNAL == null )
                     {
-                        ROOT_DSE_NO_OPERATIONNAL = ServerEntryUtils.toServerEntry( lookup( opContext, null ), opContext.getDn(), opContext.getRegistries() );
+                        ROOT_DSE_NO_OPERATIONNAL = lookup( opContext, null );
                     }
                 }
 
-                return ServerEntryUtils.toAttributesImpl( ROOT_DSE_NO_OPERATIONNAL );
+                return ROOT_DSE_NO_OPERATIONNAL;
             } 
             else if ( ( attrs.size() == 1 ) && ( attrs.contains( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES ) ) )
             {
@@ -597,11 +595,11 @@
                 {
                     if ( ROOT_DSE_ALL == null )
                     {
-                        ROOT_DSE_ALL = ServerEntryUtils.toServerEntry( lookup( opContext, null ), opContext.getDn(), opContext.getRegistries() );
+                        ROOT_DSE_ALL = lookup( opContext, null );
                     }
                 }
 
-                return ServerEntryUtils.toAttributesImpl( ROOT_DSE_ALL );
+                return ROOT_DSE_ALL;
             }
 
         }
@@ -610,7 +608,7 @@
     }
 
 
-    public Attributes lookup( LookupOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext opContext, Collection<String> bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -886,7 +884,7 @@
      * interceptor.
      */
 
-    public void addNamingListener( EventContext ctx, Name name, ExprNode filter, SearchControls searchControls,
+    public void addNamingListener( EventContext ctx, LdapDN name, ExprNode filter, SearchControls searchControls,
             NamingListener namingListener ) throws NamingException
     {
         InterceptorChain chain = service.getInterceptorChain();

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Mon Mar 17 23:12:41 2008
@@ -20,7 +20,11 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
+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.ServerSearchResult;
 import org.apache.directory.server.core.enumeration.SearchResultEnumeration;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
@@ -35,8 +39,6 @@
 import org.apache.directory.server.core.partition.Oid;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.gui.PartitionViewer;
-import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.exception.LdapContextNotEmptyException;
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
@@ -45,10 +47,8 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -83,8 +83,7 @@
     protected SearchEngine searchEngine;
     protected Optimizer optimizer;
 
-    protected AttributeTypeRegistry attributeTypeRegistry;
-    protected OidRegistry oidRegistry;
+    protected Registries registries;
 
     protected String id;
     protected int cacheSize = -1;
@@ -301,21 +300,21 @@
     private static final String[] ENTRY_DELETED_ATTRS = new String[] { "entrydeleted" };
 
 
-    public NamingEnumeration<SearchResult> list( ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( ListOperationContext opContext ) throws NamingException
     {
         SearchResultEnumeration list;
         list = new BTreeSearchResultEnumeration( ENTRY_DELETED_ATTRS, list( getEntryId( opContext.getDn().getNormName() ) ),
-            this, attributeTypeRegistry );
+            this, registries );
         return list;
     }
 
 
-    public NamingEnumeration<SearchResult> search( SearchOperationContext opContext )
+    public NamingEnumeration<ServerSearchResult> search( SearchOperationContext opContext )
         throws NamingException
     {
         SearchControls searchCtls = opContext.getSearchControls();
         String[] attrIds = searchCtls.getReturningAttributes();
-        NamingEnumeration underlying;
+        NamingEnumeration<IndexRecord> underlying;
 
         underlying = searchEngine.search( 
             opContext.getDn(),
@@ -323,24 +322,27 @@
             opContext.getFilter(), 
             searchCtls );
 
-        return new BTreeSearchResultEnumeration( attrIds, underlying, this, attributeTypeRegistry );
+        return new BTreeSearchResultEnumeration( attrIds, underlying, this, registries );
     }
 
 
-    public Attributes lookup( LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext opContext ) throws NamingException
     {
-        Attributes entry = lookup( getEntryId( opContext.getDn().getNormName() ) );
+        ServerEntry entry = ServerEntryUtils.toServerEntry( 
+            lookup( getEntryId( opContext.getDn().getNormName() ) ),
+                opContext.getDn(),
+                opContext.getRegistries() );
 
         if ( ( opContext.getAttrsId() == null ) || ( opContext.getAttrsId().size() == 0 ) )
         {
             return entry;
         }
 
-        Attributes retval = new AttributesImpl();
+        ServerEntry retval = new DefaultServerEntry( opContext.getRegistries(), opContext.getDn() );
 
         for ( String attrId:opContext.getAttrsId() )
         {
-            Attribute attr = entry.get( attrId );
+            ServerAttribute attr = entry.get( attrId );
 
             if ( attr != null )
             {
@@ -586,10 +588,10 @@
     public abstract String getProperty( String key ) throws NamingException;
 
 
-    public abstract Iterator getUserIndices();
+    public abstract Iterator<String> getUserIndices();
 
 
-    public abstract Iterator getSystemIndices();
+    public abstract Iterator<String> getSystemIndices();
 
 
     public abstract Attributes getIndices( Long id ) throws NamingException;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java Mon Mar 17 23:12:41 2008
@@ -21,9 +21,10 @@
 
 
 import javax.naming.InvalidNameException;
-import javax.naming.directory.Attributes;
 
-import org.apache.directory.shared.ldap.message.ServerSearchResult;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -52,11 +53,11 @@
      * @param id the database id of the entry
      * @param name the user provided relative or distinguished name
      * @param obj the object if any
-     * @param attrs the attributes of the entry
+     * @param attrs the entry
      */
-    public BTreeSearchResult(Long id, String name, Object obj, Attributes attrs) throws InvalidNameException
+    public BTreeSearchResult( Long id, LdapDN dn, Object obj, ServerEntry attrs ) throws InvalidNameException
     {
-        super( name, obj, attrs );
+        super( dn, obj, attrs );
         this.id = id;
     }
 
@@ -67,12 +68,12 @@
      * @param id the database id of the entry
      * @param name the user provided relative or distinguished name
      * @param obj the object if any
-     * @param attrs the attributes of the entry
+     * @param attrs the entry
      * @param isRelative whether or not the name is relative to the base
      */
-    public BTreeSearchResult(Long id, String name, Object obj, Attributes attrs, boolean isRelative) throws InvalidNameException
+    public BTreeSearchResult( Long id, LdapDN dn, Object obj, ServerEntry attrs, boolean isRelative ) throws InvalidNameException
     {
-        super( name, obj, attrs, isRelative );
+        super( dn, obj, attrs, isRelative );
         this.id = id;
     }
 
@@ -84,11 +85,11 @@
      * @param name the user provided relative or distinguished name
      * @param className the classname of the entry if any
      * @param obj the object if any
-     * @param attrs the attributes of the entry
+     * @param attrs the entry
      */
-    public BTreeSearchResult(Long id, String name, String className, Object obj, Attributes attrs) throws InvalidNameException
+    public BTreeSearchResult( Long id, LdapDN dn, String className, Object obj, ServerEntry attrs ) throws InvalidNameException
     {
-        super( name, className, obj, attrs );
+        super( dn, className, obj, attrs );
         this.id = id;
     }
 
@@ -100,13 +101,13 @@
      * @param name the user provided relative or distinguished name
      * @param className the classname of the entry if any
      * @param obj the object if any
-     * @param attrs the attributes of the entry
+     * @param attrs the entry
      * @param isRelative whether or not the name is relative to the base
      */
-    public BTreeSearchResult(Long id, String name, String className, Object obj, Attributes attrs,
-        boolean isRelative) throws InvalidNameException
+    public BTreeSearchResult( Long id, LdapDN dn, String className, Object obj, ServerEntry attrs,
+        boolean isRelative ) throws InvalidNameException
     {
-        super( name, className, obj, attrs, isRelative );
+        super( dn, className, obj, attrs, isRelative );
         this.id = id;
     }
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java Mon Mar 17 23:12:41 2008
@@ -27,15 +27,18 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchResult;
 
+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.ServerSearchResult;
 import org.apache.directory.server.core.enumeration.SearchResultEnumeration;
-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.AttributesImpl;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 
 
 /**
@@ -60,7 +63,7 @@
 
     private boolean attrIdsHasStar = false;
     private boolean attrIdsHasPlus = false;
-    private AttributeTypeRegistry registry = null;
+    private Registries registries = null;
 
 
     /**
@@ -70,15 +73,15 @@
      * @param attrIds the returned attributes
      * @param underlying the enumeration over IndexRecords
      */
-    public BTreeSearchResultEnumeration(String[] attrIds, NamingEnumeration<ForwardIndexEntry> underlying, BTreePartition db,
-        AttributeTypeRegistry registry)
+    public BTreeSearchResultEnumeration( String[] attrIds, NamingEnumeration<ForwardIndexEntry> underlying, BTreePartition db,
+        Registries registries )
     {
         this.partition = db;
         this.attrIds = attrIds;
         this.underlying = underlying;
         this.attrIdsHasStar = containsStar( attrIds );
         this.attrIdsHasPlus = containsPlus( attrIds );
-        this.registry = registry;
+        this.registries = registries;
     }
 
 
@@ -103,11 +106,12 @@
     /**
      * @see javax.naming.NamingEnumeration#next()
      */
-    public SearchResult next() throws NamingException
+    public ServerSearchResult next() throws NamingException
     {
         IndexEntry rec = underlying.next();
-        Attributes entry;
+        ServerEntry entry;
         String name = partition.getEntryUpdn( (Long)rec.getId() );
+        LdapDN dn = new LdapDN( name );
 
         if ( null == rec.getObject() )
         {
@@ -116,128 +120,134 @@
 
         if ( attrIds == null )
         {
-            entry = ( Attributes ) rec.getObject().clone();
+            entry = ServerEntryUtils.toServerEntry( ( Attributes ) rec.getObject().clone(), dn, registries );
         }
         else if ( attrIdsHasPlus && attrIdsHasStar )
         {
-            entry = ( Attributes ) rec.getObject().clone();
+            entry = ServerEntryUtils.toServerEntry( ( Attributes ) rec.getObject().clone(), dn, registries );
         }
         else if ( attrIdsHasPlus )
         {
-            entry = new AttributesImpl();
+            entry = new DefaultServerEntry( registries, dn );
 
             // add all listed attributes
-            for ( int ii = 0; ii < attrIds.length; ii++ )
+            for ( String attrId:attrIds )
             {
-                if ( attrIds[ii].equals( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES ) )
+                if ( attrId.equals( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES ) )
                 {
                     continue;
                 }
                 // there is no attribute by that name in the entry so we continue
-                if ( null == rec.getObject().get( attrIds[ii] ) )
+                if ( null == rec.getObject().get( attrId ) )
                 {
                     continue;
                 }
 
-                // clone attribute to stuff into the new resultant entry
-                Attribute attr = ( Attribute ) rec.getObject().get( attrIds[ii] ).clone();
+            	ServerAttribute attr = ServerEntryUtils.toServerAttribute( ( Attribute ) rec.getObject().get( attrId ).clone(), 
+            			registries.getAttributeTypeRegistry().lookup( attrId ) ); 
                 entry.put( attr );
             }
 
             // add all operational attributes
-            NamingEnumeration list = rec.getObject().getIDs();
+            NamingEnumeration<String> list = rec.getObject().getIDs();
+            
             while ( list.hasMore() )
             {
-                String attrId = ( String ) list.next();
-                AttributeType attrType = registry.lookup( attrId );
+                String attrId = list.next();
+                AttributeType attrType = registries.getAttributeTypeRegistry().lookup( attrId );
+                
                 if ( attrType.getUsage() == UsageEnum.USER_APPLICATIONS )
                 {
                     continue;
                 }
 
-                Attribute attr = ( Attribute ) rec.getObject().get( attrId ).clone();
+            	ServerAttribute attr = ServerEntryUtils.toServerAttribute( ( Attribute ) rec.getObject().get( attrId ).clone(), 
+            			registries.getAttributeTypeRegistry().lookup( attrId ) ); 
                 entry.put( attr );
             }
         }
         else if ( attrIdsHasStar )
         {
-            entry = new AttributesImpl();
+            entry = new DefaultServerEntry( registries, dn );
 
             // add all listed operational attributes
-            for ( int ii = 0; ii < attrIds.length; ii++ )
+            for ( String attrId:attrIds )
             {
-                if ( attrIds[ii].equals( SchemaConstants.ALL_USER_ATTRIBUTES ) )
+                if ( attrId.equals( SchemaConstants.ALL_USER_ATTRIBUTES ) )
                 {
                     continue;
                 }
                 // there is no attribute by that name in the entry so we continue
-                if ( null == rec.getObject().get( attrIds[ii] ) )
+                if ( null == rec.getObject().get( attrId ) )
                 {
                     continue;
                 }
 
                 // clone attribute to stuff into the new resultant entry
-                Attribute attr = ( Attribute ) rec.getObject().get( attrIds[ii] ).clone();
+            	ServerAttribute attr = ServerEntryUtils.toServerAttribute( ( Attribute ) rec.getObject().get( attrId ).clone(), 
+            			registries.getAttributeTypeRegistry().lookup( attrId ) ); 
                 entry.put( attr );
             }
 
             // add all user attributes
-            NamingEnumeration list = rec.getObject().getIDs();
+            NamingEnumeration<String> list = rec.getObject().getIDs();
+            
             while ( list.hasMore() )
             {
-                String attrId = ( String ) list.next();
-                AttributeType attrType = registry.lookup( attrId );
+                String attrId = list.next();
+                AttributeType attrType = registries.getAttributeTypeRegistry().lookup( attrId );
+                
                 if ( attrType.getUsage() == UsageEnum.USER_APPLICATIONS )
                 {
-                    Attribute attr = ( Attribute ) rec.getObject().get( attrId ).clone();
+                	ServerAttribute attr = ServerEntryUtils.toServerAttribute( ( Attribute ) rec.getObject().get( attrId ).clone(), 
+                			registries.getAttributeTypeRegistry().lookup( attrId ) ); 
                     entry.put( attr );
                 }
             }
         }
         else
         {
-            entry = new AttributesImpl();
-
-            Attributes attrs = rec.getObject();
+            entry = new DefaultServerEntry( registries, dn );
+            ServerEntry attrs = ServerEntryUtils.toServerEntry( rec.getObject(), dn, registries );
             
-            for ( int ii = 0; ii < attrIds.length; ii++ )
+            for ( String attrId:attrIds )
             {
-                if ( SchemaConstants.NO_ATTRIBUTE.equals( attrIds[ii] ) )
+                if ( SchemaConstants.NO_ATTRIBUTE.equals( attrId ) )
                 {
                     break;
                 }
                 
-                Attribute attr = AttributeUtils.getAttribute( attrs, registry.lookup( attrIds[ii] ) );
+                ServerAttribute attr = attrs.get( registries.getAttributeTypeRegistry().lookup( attrId ) );
                 
                 // there is no attribute by that name in the entry so we continue
                 if ( null == attr )
                 {
                     // May be it's because the attributeType is a inherited one?
-                    Iterator descendants = registry.descendants( attrIds[ii] );
+                    Iterator<AttributeType> descendants = registries.getAttributeTypeRegistry().descendants( attrId );
                     
                     while ( descendants.hasNext() )
                     {
-                        AttributeType atype = (AttributeType)descendants.next();
+                        AttributeType atype = descendants.next();
                         
-                        attr = AttributeUtils.getAttribute( attrs, atype );
+                        attr = attrs.get( atype );
                         
                         if ( attr != null )
                         {
                             // we may have more than one descendant, like sn and cn
                             // for name, so add all of them
-                            entry.put( (Attribute)attr.clone() );
+                            entry.put( (ServerAttribute)attr.clone() );
                         }
                     }
                 }
                 else
                 {
                     // clone attribute to stuff into the new resultant entry
-                    entry.put( (Attribute)attr.clone() );
+                    entry.put( (ServerAttribute)attr.clone() );
                 }
             }
         }
 
-        BTreeSearchResult result = new BTreeSearchResult( (Long)rec.getId(), name, null, entry );
+        BTreeSearchResult result = new BTreeSearchResult( (Long)rec.getId(), dn, null, entry );
         result.setRelative( false );
         return result;
     }
@@ -293,7 +303,7 @@
     /**
      * @see java.util.Enumeration#nextElement()
      */
-    public SearchResult nextElement()
+    public ServerSearchResult nextElement()
     {
         try
         {

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java Mon Mar 17 23:12:41 2008
@@ -85,7 +85,7 @@
     }
 
 
-    public NamingEnumeration search( Name base, AliasDerefMode aliasDerefMode, ExprNode filter, SearchControls searchCtls )
+    public NamingEnumeration<IndexRecord> search( Name base, AliasDerefMode aliasDerefMode, ExprNode filter, SearchControls searchCtls )
         throws Exception
     {
         Name effectiveBase;
@@ -93,11 +93,11 @@
         String aliasedBase = ( String ) db.getAliasIndex().reverseLookup( baseId );
 
         // --------------------------------------------------------------------
-        // Determine the eective base with aliases
+        // Determine the effective base with aliases
         // --------------------------------------------------------------------
 
         /*
-         * If the base is not an alias or if alias dereerencing does not
+         * If the base is not an alias or if alias dereferencing does not
          * occur on finding the base then we set the effective base to the
          * given base.
          */
@@ -107,16 +107,16 @@
         }
 
         /*
-         * If the base is an alias and alias dereerencing does occur on
-         * inding the base then we set the eective base to the alias target
-         * gotten rom the alias index.
+         * If the base is an alias and alias dereferencing does occur on
+         * finding the base then we set the effective base to the alias target
+         * got from the alias index.
          */
         else
         {
             effectiveBase = new LdapDN( aliasedBase );
         }
         
-        // Add the scope node using the eective base to the ilter
+        // Add the scope node using the effective base to the filter
         BranchNode root = new AndNode();
         ExprNode node = new ScopeNode( aliasDerefMode, effectiveBase.toString(), searchCtls.getSearchScope() );
         root.getChildren().add( node );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DisjunctionEnumeration.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DisjunctionEnumeration.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DisjunctionEnumeration.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DisjunctionEnumeration.java Mon Mar 17 23:12:41 2008
@@ -40,7 +40,8 @@
 public class DisjunctionEnumeration implements NamingEnumeration<IndexEntry>
 {
     /** The underlying child enumerations */
-    private final NamingEnumeration[] children;
+    private final NamingEnumeration<IndexRecord>[] children;
+    
     /** LUT used to avoid returning duplicates */
     private final Map<Object, Object> candidates = new HashMap<Object, Object>();
     /** Index of current cursor used */
@@ -65,7 +66,7 @@
      * @param children array of child NamingInstances
      * @throws NamingException if something goes wrong
      */
-    public DisjunctionEnumeration( NamingEnumeration[] children ) throws NamingException
+    public DisjunctionEnumeration( NamingEnumeration<IndexRecord>[] children ) throws NamingException
     {
         this.children = children;
 
@@ -91,7 +92,7 @@
         }
 
         // Grab the next candidate and add it's id to the LUT/hash of candidates
-        IndexEntry rec = ( IndexEntry ) children[index].next();
+        IndexEntry rec = children[index].next();
         prefetched.copy( rec );
         candidates.put( rec.getId(), rec.getId() );
     }
@@ -163,7 +164,7 @@
             }
 
             // Grab next candidate!
-            IndexEntry rec = ( IndexEntry ) children[index].next();
+            IndexEntry rec = children[index].next();
             prefetched.copy( rec );
 
             // Break through do/while if the candidate is seen for the first

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Enumerator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Enumerator.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Enumerator.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Enumerator.java Mon Mar 17 23:12:41 2008
@@ -42,5 +42,5 @@
      * @return an enumeration over the 
      * @throws NamingException if database access fails
      */
-    NamingEnumeration enumerate( ExprNode node ) throws NamingException;
+    NamingEnumeration<IndexRecord> enumerate( ExprNode node ) throws NamingException;
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java Mon Mar 17 23:12:41 2008
@@ -173,7 +173,7 @@
     private NamingEnumeration<ForwardIndexEntry> enumDisj( OrNode node ) throws NamingException
     {
         List<ExprNode> children = node.getChildren();
-        NamingEnumeration[] childEnumerations = new NamingEnumeration[children.size()];
+        NamingEnumeration<IndexRecord>[] childEnumerations = new NamingEnumeration[children.size()];
 
         // Recursively create NamingEnumerations for each child expression node
         for ( int ii = 0; ii < childEnumerations.length; ii++ )

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java Mon Mar 17 23:12:41 2008
@@ -22,8 +22,7 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.server.schema.registries.OidRegistry;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.filter.AndNode;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -67,15 +66,14 @@
      * @param oidRegistry the oid reg used for attrID to oid resolution
      * @param attributeTypeRegistry the attribtype reg used for value comparison
      */
-    public ExpressionEvaluator(BTreePartition db, OidRegistry oidRegistry,
-        AttributeTypeRegistry attributeTypeRegistry)
+    public ExpressionEvaluator(BTreePartition db, Registries registries )
     {
         ScopeEvaluator scopeEvaluator = null;
         SubstringEvaluator substringEvaluator = null;
 
         scopeEvaluator = new ScopeEvaluator( db );
-        substringEvaluator = new SubstringEvaluator( db, oidRegistry, attributeTypeRegistry );
-        leafEvaluator = new LeafEvaluator( db, oidRegistry, attributeTypeRegistry, scopeEvaluator, substringEvaluator );
+        substringEvaluator = new SubstringEvaluator( db, registries );
+        leafEvaluator = new LeafEvaluator( db, registries, scopeEvaluator, substringEvaluator );
     }
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java Mon Mar 17 23:12:41 2008
@@ -28,8 +28,7 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
-import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.server.schema.registries.OidRegistry;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.filter.ApproximateNode;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
@@ -70,10 +69,7 @@
     private BTreePartition db;
 
     /** Oid Registry used to translate attributeIds to OIDs */
-    private OidRegistry oidRegistry;
-
-    /** AttributeType registry needed for normalizing and comparing values */
-    private AttributeTypeRegistry attributeTypeRegistry;
+    private Registries registries;
 
     /** Substring node evaluator we depend on */
     private SubstringEvaluator substringEvaluator;
@@ -89,12 +85,11 @@
      * @param scopeEvaluator
      * @param substringEvaluator
      */
-    public LeafEvaluator( BTreePartition db, OidRegistry oidRegistry, AttributeTypeRegistry attributeTypeRegistry,
+    public LeafEvaluator( BTreePartition db, Registries registries,
         ScopeEvaluator scopeEvaluator, SubstringEvaluator substringEvaluator )
     {
         this.db = db;
-        this.oidRegistry = oidRegistry;
-        this.attributeTypeRegistry = attributeTypeRegistry;
+        this.registries = registries;
         this.scopeEvaluator = scopeEvaluator;
         this.substringEvaluator = substringEvaluator;
     }
@@ -387,7 +382,8 @@
         }
 
         // Now, get the AttributeType associated with the Attribute id
-        AttributeType type = attributeTypeRegistry.lookup( oidRegistry.getOid( attrId ) );
+        AttributeType type = registries.getAttributeTypeRegistry().lookup( 
+        		registries.getOidRegistry().getOid( attrId ) );
 
         // here, we may have some descendants if the attribute is not found
         if ( AttributeUtils.getAttribute( entry, type ) != null )
@@ -399,11 +395,11 @@
         {
             // The attribute was not found in the entry, but it may have
             // some descendant. Let's chack that
-            if ( attributeTypeRegistry.hasDescendants( attrId ) )
+            if ( registries.getAttributeTypeRegistry().hasDescendants( attrId ) )
             {
                 // Ok, we have to check for each descendant if pone of 
                 // them is present into the entry
-                Iterator<AttributeType> descendants = attributeTypeRegistry.descendants( attrId );
+                Iterator<AttributeType> descendants = registries.getAttributeTypeRegistry().descendants( attrId );
 
                 while ( descendants.hasNext() )
                 {
@@ -487,7 +483,7 @@
         }
 
         // get the attribute associated with the node 
-        AttributeType type = attributeTypeRegistry.lookup( filterAttr );
+        AttributeType type = registries.getAttributeTypeRegistry().lookup( filterAttr );
         Attribute attr = AttributeUtils.getAttribute( entry, type );
 
         if ( attr != null )
@@ -516,9 +512,9 @@
 
         // If we do not have the attribute, loop through the descendant
         // May be the node Attribute has descendant ?
-        if ( attributeTypeRegistry.hasDescendants( filterAttr ) )
+        if ( registries.getAttributeTypeRegistry().hasDescendants( filterAttr ) )
         {
-            Iterator<AttributeType> descendants = attributeTypeRegistry.descendants( filterAttr );
+            Iterator<AttributeType> descendants = registries.getAttributeTypeRegistry().descendants( filterAttr );
 
             while ( descendants.hasNext() )
             {
@@ -601,8 +597,8 @@
     private MatchingRule getMatchingRule( String attrId, int matchType ) throws NamingException
     {
         MatchingRule mrule = null;
-        String oid = oidRegistry.getOid( attrId );
-        AttributeType type = attributeTypeRegistry.lookup( oid );
+        String oid = registries.getOidRegistry().getOid( attrId );
+        AttributeType type = registries.getAttributeTypeRegistry().lookup( oid );
 
         switch ( matchType )
         {

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java Mon Mar 17 23:12:41 2008
@@ -84,7 +84,7 @@
      * @return enumeration over SearchResults
      * @throws Exception if the search fails
      */
-    NamingEnumeration search( Name base, AliasDerefMode aliasDerefMode, ExprNode filter,
+    NamingEnumeration<IndexRecord> search( Name base, AliasDerefMode aliasDerefMode, ExprNode filter,
                               SearchControls searchCtls ) throws Exception;
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java Mon Mar 17 23:12:41 2008
@@ -45,8 +45,10 @@
 {
     /** Database used */
     private final BTreePartition db;
+    
     /** Evaluator used is an Avalon dependent object */
     private final SubstringEvaluator evaluator;
+    
     /** the attribute type registry */
     private final AttributeTypeRegistry attributeTypeRegistry;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java Mon Mar 17 23:12:41 2008
@@ -29,8 +29,7 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
-import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.server.schema.registries.OidRegistry;
+import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -51,11 +50,8 @@
     private BTreePartition db;
     
     /** Oid Registry used to translate attributeIds to OIDs */
-    private OidRegistry oidRegistry;
+    private Registries registries;
     
-    /** AttributeType registry needed for normalizing and comparing values */
-    private AttributeTypeRegistry attributeTypeRegistry;
-
 
     /**
      * Creates a new SubstringEvaluator for substring expressions.
@@ -64,12 +60,10 @@
      * @param oidRegistry the OID registry for name to OID mapping
      * @param attributeTypeRegistry the attributeType registry
      */
-    public SubstringEvaluator( BTreePartition db, OidRegistry oidRegistry,
-        AttributeTypeRegistry attributeTypeRegistry )
+    public SubstringEvaluator( BTreePartition db, Registries registries )
     {
         this.db = db;
-        this.oidRegistry = oidRegistry;
-        this.attributeTypeRegistry = attributeTypeRegistry;
+        this.registries = registries;
     }
 
 
@@ -82,8 +76,8 @@
         SubstringNode snode = ( SubstringNode ) node;
         String filterAttribute = snode.getAttribute();
         
-        String oid = oidRegistry.getOid( filterAttribute );
-        AttributeType type = attributeTypeRegistry.lookup( oid );
+        String oid = registries.getOidRegistry().getOid( filterAttribute );
+        AttributeType type = registries.getAttributeTypeRegistry().lookup( oid );
 
         MatchingRule rule = type.getSubstr();
         
@@ -209,9 +203,9 @@
         
         // If we do not have the attribute, loop through the descendant
         // May be the node Attribute has descendant ?
-        if ( attributeTypeRegistry.hasDescendants( filterAttribute ) )
+        if ( registries.getAttributeTypeRegistry().hasDescendants( filterAttribute ) )
         {
-            Iterator<AttributeType> descendants = attributeTypeRegistry.descendants( filterAttribute );
+            Iterator<AttributeType> descendants = registries.getAttributeTypeRegistry().descendants( filterAttribute );
 
             while ( descendants.hasNext() )
             {

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java Mon Mar 17 23:12:41 2008
@@ -84,7 +84,7 @@
     }
 
 
-    public Enumeration children()
+    public Enumeration<ASTNode> children()
     {
         return Collections.enumeration( children );
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java Mon Mar 17 23:12:41 2008
@@ -73,12 +73,12 @@
         this.entry = entry;
         this.isMutable = isMutable;
 
-        NamingEnumeration list = entry.getIDs();
+        NamingEnumeration<String> list = entry.getIDs();
         int rowCount = 0;
 
         while ( list.hasMoreElements() )
         {
-            String attrId = ( String ) list.nextElement();
+            String attrId = list.nextElement();
             rowCount = rowCount + entry.get( attrId ).size();
         }
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java Mon Mar 17 23:12:41 2008
@@ -81,11 +81,11 @@
         try
         {
             List<ForwardIndexEntry> recordForwards = new ArrayList<ForwardIndexEntry>();
-            NamingEnumeration childList = db.list( id );
+            NamingEnumeration<IndexEntry> childList = db.list( id );
             
             while ( childList.hasMore() )
             {
-                IndexEntry old = ( IndexEntry ) childList.next();
+                IndexEntry old = childList.next();
                 ForwardIndexEntry newRec = new ForwardIndexEntry();
                 newRec.copy( old );
                 recordForwards.add( newRec );
@@ -139,7 +139,7 @@
     }
 
 
-    public Enumeration children()
+    public Enumeration<TreeNode> children()
     {
         return Collections.enumeration( children );
     }
@@ -199,7 +199,6 @@
         }
         catch ( NamingException e )
         {
-            e.printStackTrace();
             buf.append( "ERROR: " + e.getMessage() );
         }
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java Mon Mar 17 23:12:41 2008
@@ -286,7 +286,7 @@
 
         try
         {
-            NamingEnumeration list = null;
+            NamingEnumeration<IndexRecord> list = null;
 
             if ( scanType == EQUALITY_CURSOR )
             {

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java Mon Mar 17 23:12:41 2008
@@ -70,7 +70,7 @@
 
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -449,7 +449,7 @@
 
             while ( list.hasNext() )
             {
-                Entry entry = ( Entry ) list.next();
+                LdifEntry entry = ( LdifEntry ) list.next();
                 String updn = entry.getDn();
                 Attributes attrs = entry.getAttributes();
                 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java Mon Mar 17 23:12:41 2008
@@ -47,6 +47,7 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
+
 import java.io.File;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -150,10 +151,9 @@
 
     protected void initRegistries( Registries registries )
     {
-        attributeTypeRegistry = registries.getAttributeTypeRegistry();
-        oidRegistry = registries.getOidRegistry();
-        ExpressionEvaluator evaluator = new ExpressionEvaluator( this, oidRegistry, attributeTypeRegistry );
-        ExpressionEnumerator enumerator = new ExpressionEnumerator( this, attributeTypeRegistry, evaluator );
+        this.registries = registries;
+        ExpressionEvaluator evaluator = new ExpressionEvaluator( this, registries );
+        ExpressionEnumerator enumerator = new ExpressionEnumerator( this, registries.getAttributeTypeRegistry(), evaluator );
         this.searchEngine = new DefaultSearchEngine( this, evaluator, enumerator, optimizer );
         store.initRegistries( registries );
     }
@@ -197,8 +197,8 @@
                 index.setWkDirPath( obj.getWkDirPath() );
             }
 
-            String oid = oidRegistry.getOid( index.getAttributeId() );
-            if ( SYS_INDEX_OIDS.contains( oidRegistry.getOid( index.getAttributeId() ) ) )
+            String oid = registries.getOidRegistry().getOid( index.getAttributeId() );
+            if ( SYS_INDEX_OIDS.contains( registries.getOidRegistry().getOid( index.getAttributeId() ) ) )
             {
                 if ( oid.equals( Oid.ALIAS ) )
                 {
@@ -241,7 +241,7 @@
             store.setEnableOptimizer( isOptimizerEnabled() );
         }
 
-        store.init( oidRegistry, attributeTypeRegistry );
+        store.init( registries.getOidRegistry(), registries.getAttributeTypeRegistry() );
     }
 
 
@@ -382,13 +382,13 @@
     }
 
 
-    public final Iterator getUserIndices()
+    public final Iterator<String> getUserIndices()
     {
         return store.userIndices();
     }
 
 
-    public final Iterator getSystemIndices()
+    public final Iterator<String> getSystemIndices()
     {
         return store.systemIndices();
     }
@@ -555,12 +555,13 @@
     }
 
 
-    public final void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
+    public final void bind( LdapDN bindDn, byte[] credentials, List<String> mechanisms, String saslAuthId ) throws NamingException
     {
         if ( bindDn == null || credentials == null || mechanisms == null ||  saslAuthId == null )
         {
             // do nothing just using variables to prevent yellow lights : bad :)
         }
+        
         // does nothing
         throw new LdapAuthenticationNotSupportedException(
                 "Bind requests only tunnel down into partitions if there are no authenticators to handle the mechanism.\n"

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/tree/BranchNode.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/tree/BranchNode.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/tree/BranchNode.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/tree/BranchNode.java Mon Mar 17 23:12:41 2008
@@ -23,8 +23,12 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -38,6 +42,8 @@
  */
 public class BranchNode implements Node
 {
+    private static final Logger LOG = LoggerFactory.getLogger( BranchNode.class );
+
     /** Stores the list of all the descendant partitions and containers */
     private Map<String, Node> children;
     
@@ -71,7 +77,7 @@
      * @param partition The associated partition to add as a tree node
      * @return The modified tree structure.
      */
-    public BranchNode recursivelyAddPartition( BranchNode current, LdapDN dn, int index, Partition partition )
+    public BranchNode recursivelyAddPartition( BranchNode current, LdapDN dn, int index, Partition partition ) throws NamingException
     {
         String rdnAtIndex = dn.getRdn( index ).toString();
         
@@ -81,7 +87,21 @@
         }
         else
         {
-            Node child = recursivelyAddPartition( new BranchNode(), dn, index + 1, partition );
+            Node newNode = current.getChild( rdnAtIndex );
+            
+            if ( newNode instanceof LeafNode )
+            {
+                String message = "Overlapping partitions are not allowed";
+                LOG.error( message );
+                throw new NamingException( message );
+            }
+        
+            if ( newNode == null )
+            {
+                newNode = new BranchNode();
+            }
+
+            Node child = recursivelyAddPartition( (BranchNode)newNode, dn, index + 1, partition );
             return current.addNode( rdnAtIndex, child );
         }
     }
@@ -137,7 +157,7 @@
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
-        sb.append( " { " );
+        sb.append( "{" );
         boolean isFirst = true;
         
         for ( Node child:children.values() )
@@ -153,7 +173,7 @@
 
             if ( child instanceof BranchNode )
             {
-                sb.append( "Branch:").append( child.toString() );
+                sb.append( "Branch: ").append( child.toString() );
             }
             else
             {
@@ -161,7 +181,7 @@
             }
         }
 
-        sb.append( " } " );
+        sb.append( "}" );
         return sb.toString();
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/tree/LeafNode.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/tree/LeafNode.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/tree/LeafNode.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/partition/tree/LeafNode.java Mon Mar 17 23:12:41 2008
@@ -20,8 +20,6 @@
 package org.apache.directory.server.core.partition.tree;
 
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.partition.Partition;
 
 
@@ -70,13 +68,6 @@
      */
     public String toString()
     {
-        try
-        {
-            return partition.getSuffixDn().getUpName();
-        }
-        catch ( NamingException ne )
-        {
-            return "Unkown partition";
-        }
+        return partition.getSuffix();
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Mon Mar 17 23:12:41 2008
@@ -33,9 +33,8 @@
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
 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.ServerStringValue;
-import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.enumeration.ReferralHandlingEnumeration;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
@@ -71,12 +70,13 @@
 import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.exception.LdapReferralException;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -87,12 +87,7 @@
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
 
 
 /**
@@ -150,29 +145,6 @@
     }
 
 
-    static boolean hasValue( Attribute attr, String value ) throws NamingException
-    {
-        if ( attr == null )
-        {
-            return false;
-        }
-        
-        for ( int ii = 0; ii < attr.size(); ii++ )
-        {
-            if ( !( attr.get( ii ) instanceof String ) )
-            {
-                continue;
-            }
-            
-            if ( value.equalsIgnoreCase( ( String ) attr.get( ii ) ) )
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-
     static boolean isReferral( ServerEntry entry ) throws NamingException
     {
         ServerAttribute oc = entry.get( SchemaConstants.OBJECT_CLASS_AT );
@@ -199,7 +171,7 @@
                 throw new NamingException( message );
             }
             
-            for ( ServerValue<?> value:refAttr )
+            for ( Value<?> value:refAttr )
             {
                 ServerStringValue ref = (ServerStringValue)value; 
                 
@@ -300,7 +272,7 @@
         // handle referral here
         List<String> list = new ArrayList<String>( refs.size() );
         
-        for ( ServerValue<?> value:refs )
+        for ( Value<?> value:refs )
         {
             String val = (String)value.get();
 
@@ -409,11 +381,9 @@
                 return;
             }
 
-            ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                invocation.getProxy().lookup( 
+            ServerEntry referral = invocation.getProxy().lookup( 
                     new LookupOperationContext( registries, farthest ), 
-                    PartitionNexusProxy.LOOKUP_BYPASS ),
-                farthest, registries );
+                    PartitionNexusProxy.LOOKUP_BYPASS );
             
             AttributeType refsType = atRegistry.lookup( oidRegistry.getOid( SchemaConstants.REF_AT ) );
             ServerAttribute refs = referral.get( refsType );
@@ -454,11 +424,10 @@
                 return next.compare( opContext );
             }
 
-            ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                invocation.getProxy().lookup( 
+            ServerEntry referral = invocation.getProxy().lookup( 
                     new LookupOperationContext( registries, farthest ), 
-                    PartitionNexusProxy.LOOKUP_BYPASS ),
-                farthest, registries );
+                    PartitionNexusProxy.LOOKUP_BYPASS );
+            
             ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
             doReferralException( farthest, new LdapDN( name.getUpName() ), refs );
 
@@ -513,11 +482,10 @@
                 return;
             }
 
-            ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                invocation.getProxy().lookup( 
+            ServerEntry referral = invocation.getProxy().lookup( 
                     new LookupOperationContext( registries, farthest ), 
-                    PartitionNexusProxy.LOOKUP_BYPASS ),
-                farthest, registries );
+                    PartitionNexusProxy.LOOKUP_BYPASS );
+            
             ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
             doReferralException( farthest, new LdapDN( name.getUpName() ), refs );
             
@@ -590,11 +558,10 @@
             }
             else if ( farthestSrc != null )
             {
-                ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                    invocation.getProxy().lookup( 
+                ServerEntry referral = invocation.getProxy().lookup( 
                         new LookupOperationContext( registries, farthestSrc ), 
-                        PartitionNexusProxy.LOOKUP_BYPASS ),
-                    farthestSrc, registries );
+                        PartitionNexusProxy.LOOKUP_BYPASS );
+                
                 ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
                 doReferralException( farthestSrc, new LdapDN( oldName.getUpName() ), refs );
             }
@@ -665,11 +632,10 @@
             }
             else if ( farthestSrc != null )
             {
-                ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                    invocation.getProxy().lookup( 
+                ServerEntry referral = invocation.getProxy().lookup( 
                         new LookupOperationContext( registries, farthestSrc ), 
-                        PartitionNexusProxy.LOOKUP_BYPASS ),
-                    farthestSrc, registries );
+                        PartitionNexusProxy.LOOKUP_BYPASS );
+                
                 ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
                 doReferralException( farthestSrc, new LdapDN( oldName.getUpName() ), refs );
                 
@@ -746,11 +712,10 @@
             
             if ( farthestSrc != null )
             {
-                ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                    invocation.getProxy().lookup( 
+                ServerEntry referral = invocation.getProxy().lookup( 
                         new LookupOperationContext( registries, farthestSrc ), 
-                        PartitionNexusProxy.LOOKUP_BYPASS ),
-                    farthestSrc, registries );
+                        PartitionNexusProxy.LOOKUP_BYPASS );
+                
                 ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
                 doReferralException( farthestSrc, new LdapDN( oldName.getUpName() ), refs );
                 
@@ -782,7 +747,7 @@
     }
 
 
-    private void checkModify( LdapDN name, List<ModificationItemImpl> mods ) throws NamingException
+    private void checkModify( LdapDN name, List<Modification> mods ) throws NamingException
     {
         boolean isTargetReferral = lut.isReferral( name );
 
@@ -790,19 +755,19 @@
         // Check and update lut if we change the objectClass 
         // -------------------------------------------------------------------
 
-        for ( ModificationItem mod : mods )
+        for ( Modification mod : mods )
         {
-            if ( mod.getAttribute().getID().equalsIgnoreCase( SchemaConstants.OBJECT_CLASS_AT ) )
+            if ( mod.getAttribute().getId().equalsIgnoreCase( SchemaConstants.OBJECT_CLASS_AT ) )
             {
-                boolean modsOcHasReferral = hasValue( mod.getAttribute(), SchemaConstants.REFERRAL_OC );
+                boolean modsOcHasReferral = ((ServerAttribute)mod.getAttribute()).contains( SchemaConstants.REFERRAL_OC );
 
-                switch ( mod.getModificationOp() )
+                switch ( mod.getOperation() )
                 {
                     /* 
                      * if ADD op where refferal is added to objectClass of a
                      * non-referral entry then we add a new referral to lut
                      */
-                    case ( DirContext.ADD_ATTRIBUTE ):
+                    case ADD_ATTRIBUTE :
                         if ( modsOcHasReferral && !isTargetReferral )
                         {
                             lut.referralAdded( name );
@@ -814,7 +779,7 @@
                         * if REMOVE op where refferal is removed from objectClass of a
                         * referral entry then we remove the referral from lut
                         */
-                    case ( DirContext.REMOVE_ATTRIBUTE ):
+                    case REMOVE_ATTRIBUTE :
                         if ( modsOcHasReferral && isTargetReferral )
                         {
                             lut.referralDeleted( name );
@@ -830,7 +795,7 @@
                         * if REPLACE op on non-referral has new set of OC values with
                         * referral value then we add the new referral to the lut
                         */
-                    case ( DirContext.REPLACE_ATTRIBUTE ):
+                    case REPLACE_ATTRIBUTE :
                         if ( isTargetReferral && !modsOcHasReferral )
                         {
                             lut.referralDeleted( name );
@@ -858,7 +823,7 @@
         ServerLdapContext caller = ( ServerLdapContext ) invocation.getCaller();
         String refval = ( String ) caller.getEnvironment().get( Context.REFERRAL );
         LdapDN name = opContext.getDn();
-        List<ModificationItemImpl> mods = opContext.getModItems();
+        List<Modification> mods = opContext.getModItems();
 
         // handle a normal modify without following referrals
         if ( refval == null || refval.equals( IGNORE ) )
@@ -879,11 +844,10 @@
                 return;
             }
 
-            ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                invocation.getProxy().lookup( 
+            ServerEntry referral = invocation.getProxy().lookup( 
                     new LookupOperationContext( registries, farthest ), 
-                    PartitionNexusProxy.LOOKUP_BYPASS ),
-                    farthest, registries );
+                    PartitionNexusProxy.LOOKUP_BYPASS );
+            
             ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
             doReferralException( farthest, new LdapDN( name.getUpName() ), refs );
         }
@@ -922,7 +886,7 @@
         Partition partition = opContext.getPartition();
         LdapDN suffix = partition.getSuffixDn();
         Invocation invocation = InvocationStack.getInstance().peek();
-        NamingEnumeration<SearchResult> list = invocation.getProxy().search( new SearchOperationContext( registries, suffix,
+        NamingEnumeration<ServerSearchResult> list = invocation.getProxy().search( new SearchOperationContext( registries, suffix,
                 AliasDerefMode.DEREF_ALWAYS, getReferralFilter(), getControls() ), SEARCH_BYPASS );
         addReferrals( list, suffix );
     }
@@ -932,7 +896,7 @@
     {
         // remove referrals immediately before removing the partition
         Invocation invocation = InvocationStack.getInstance().peek();
-        NamingEnumeration<SearchResult> list = invocation.getProxy().search( 
+        NamingEnumeration<ServerSearchResult> list = invocation.getProxy().search( 
             new SearchOperationContext( registries, opContext.getDn(), AliasDerefMode.DEREF_ALWAYS,
                     getReferralFilter(), getControls() ), SEARCH_BYPASS );
         
@@ -941,13 +905,13 @@
     }
 
 
-    private void addReferrals( NamingEnumeration<SearchResult> referrals, LdapDN base ) throws NamingException
+    private void addReferrals( NamingEnumeration<ServerSearchResult> referrals, LdapDN base ) throws NamingException
     {
         while ( referrals.hasMore() )
         {   
-            SearchResult r = referrals.next();
+        	ServerSearchResult r = referrals.next();
             LdapDN referral;
-            LdapDN result = new LdapDN( r.getName() );
+            LdapDN result = new LdapDN( r.getDn() );
             result.normalize( atRegistry.getNormalizerMapping() );
             
             if ( r.isRelative() )
@@ -962,13 +926,13 @@
     }
 
 
-    private void deleteReferrals( NamingEnumeration<SearchResult> referrals, LdapDN base ) throws NamingException
+    private void deleteReferrals( NamingEnumeration<ServerSearchResult> referrals, LdapDN base ) throws NamingException
     {
         while ( referrals.hasMore() )
         {
-            SearchResult r = referrals.next();
+        	ServerSearchResult r = referrals.next();
             LdapDN referral;
-            LdapDN result = new LdapDN( r.getName() );
+            LdapDN result = new LdapDN( r.getDn() );
             result.normalize( atRegistry.getNormalizerMapping() );
 
             if ( r.isRelative() )
@@ -983,7 +947,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> search( NextInterceptor next, SearchOperationContext opContext )
+    public NamingEnumeration<ServerSearchResult> search( NextInterceptor next, SearchOperationContext opContext )
         throws NamingException
     {
         Invocation invocation = InvocationStack.getInstance().peek();
@@ -1009,8 +973,8 @@
         {
             if ( lut.isReferral( base ) )
             {
-                Attributes referral = invocation.getProxy().lookup( new LookupOperationContext( registries, base ), PartitionNexusProxy.LOOKUP_BYPASS );
-                Attribute refs = referral.get( SchemaConstants.REF_AT );
+                ServerEntry referral = invocation.getProxy().lookup( new LookupOperationContext( registries, base ), PartitionNexusProxy.LOOKUP_BYPASS );
+                ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
                 doReferralExceptionOnSearchBase( base, refs, controls.getSearchScope() );
             }
 
@@ -1021,8 +985,8 @@
                 return next.search( opContext );
             }
 
-            Attributes referral = invocation.getProxy().lookup( new LookupOperationContext( registries, farthest ), PartitionNexusProxy.LOOKUP_BYPASS );
-            Attribute refs = referral.get( SchemaConstants.REF_AT );
+            ServerEntry referral = invocation.getProxy().lookup( new LookupOperationContext( registries, farthest ), PartitionNexusProxy.LOOKUP_BYPASS );
+            ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
             doReferralExceptionOnSearchBase( farthest, new LdapDN( base.getUpName() ), refs, controls.getSearchScope() );
             throw new IllegalStateException( "Should never get here: shutting up compiler" );
         }
@@ -1031,8 +995,8 @@
         {
             if ( lut.isReferral( base ) )
             {
-                Attributes referral = invocation.getProxy().lookup( new LookupOperationContext( registries, base ), PartitionNexusProxy.LOOKUP_BYPASS );
-                Attribute refs = referral.get( SchemaConstants.REF_AT );
+                ServerEntry referral = invocation.getProxy().lookup( new LookupOperationContext( registries, base ), PartitionNexusProxy.LOOKUP_BYPASS );
+                ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
                 doReferralExceptionOnSearchBase( base, refs, controls.getSearchScope() );
             }
 
@@ -1045,8 +1009,8 @@
                 return new ReferralHandlingEnumeration( srfe, lut, opContext.getRegistries(), nexus, controls.getSearchScope(), true );
             }
 
-            Attributes referral = invocation.getProxy().lookup( new LookupOperationContext( registries, farthest ), PartitionNexusProxy.LOOKUP_BYPASS );
-            Attribute refs = referral.get( SchemaConstants.REF_AT );
+            ServerEntry referral = invocation.getProxy().lookup( new LookupOperationContext( registries, farthest ), PartitionNexusProxy.LOOKUP_BYPASS );
+            ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
             doReferralExceptionOnSearchBase( farthest, new LdapDN( base.getUpName() ), refs, controls.getSearchScope() );
             throw new IllegalStateException( "Should never get here: shutting up compiler" );
         }
@@ -1063,7 +1027,7 @@
 
     class ReferralFilter implements SearchResultFilter//, SearchResultEnumerationAppender 
     {
-        public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
+        public boolean accept( Invocation invocation, ServerSearchResult result, SearchControls controls )
             throws NamingException
         {
             return false;
@@ -1071,14 +1035,14 @@
     }
 
 
-    public void doReferralExceptionOnSearchBase( LdapDN base, Attribute refs, int scope ) throws NamingException
+    public void doReferralExceptionOnSearchBase( LdapDN base, ServerAttribute refs, int scope ) throws NamingException
     {
         // handle referral here
         List<String> list = new ArrayList<String>( refs.size() );
         
-        for ( int ii = 0; ii < refs.size(); ii++ )
+        for ( Value<?> 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" ) )
@@ -1137,15 +1101,15 @@
     }
 
 
-    public void doReferralExceptionOnSearchBase( LdapDN farthest, LdapDN targetUpdn, Attribute refs, int scope )
+    public void doReferralExceptionOnSearchBase( LdapDN farthest, LdapDN targetUpdn, ServerAttribute refs, int scope )
         throws NamingException
     {
         // handle referral here
         List<String> list = new ArrayList<String>( refs.size() );
         
-        for ( int ii = 0; ii < refs.size(); ii++ )
+        for ( Value<?> 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" ) )

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java Mon Mar 17 23:12:41 2008
@@ -23,17 +23,18 @@
 import org.apache.directory.server.constants.MetaSchemaConstants;
 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.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaObject;
 
 import javax.naming.NamingException;
-import javax.naming.directory.SearchResult;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -100,27 +101,27 @@
         throws NamingException;
     
     
-    public final void modify( LdapDN name, int modOp, ServerEntry mods, ServerEntry entry, ServerEntry targetEntry, 
+    public final void modify( LdapDN name, ModificationOperation modOp, ServerEntry mods, ServerEntry entry, ServerEntry targetEntry, 
         boolean cascade ) throws NamingException
     {
         modify( name, entry, targetEntry, cascade );
     }
 
 
-    public final void modify( LdapDN name, List<ModificationItemImpl> mods, ServerEntry entry,
+    public final void modify( LdapDN name, List<Modification> mods, ServerEntry entry,
         ServerEntry targetEntry, boolean cascade ) throws NamingException
     {
         modify( name, entry, targetEntry, cascade );
     }
 
     
-    protected Set<String> getOids( Set<SearchResult> results ) throws NamingException
+    protected Set<String> getOids( Set<ServerSearchResult> results ) throws NamingException
     {
         Set<String> oids = new HashSet<String>( results.size() );
         
-        for ( SearchResult result : results )
+        for ( ServerSearchResult result : results )
         {
-            LdapDN dn = new LdapDN( result.getName() );
+            LdapDN dn = result.getDn();
             dn.normalize( this.targetRegistries.getAttributeTypeRegistry().getNormalizerMapping() );
             oids.add( ( String ) dn.getRdn().getValue() );
         }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AttributeClassLoader.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AttributeClassLoader.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AttributeClassLoader.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/schema/AttributeClassLoader.java Mon Mar 17 23:12:41 2008
@@ -27,7 +27,7 @@
 
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerBinaryValue;
-import org.apache.directory.server.core.entry.ServerValue;
+import org.apache.directory.shared.ldap.entry.Value;
 
 
 /**
@@ -49,7 +49,7 @@
     
     public void setAttribute( ServerAttribute attribute ) throws NamingException
     {
-        if ( attribute.getType().getSyntax().isHumanReadable() )
+        if ( attribute.getAttributeType().getSyntax().isHumanReadable() )
         {
             throw new InvalidAttributeValueException( "The attribute must be binary" );
         }
@@ -62,7 +62,7 @@
     {
         byte[] classBytes = null;
         
-        ServerValue<?> value = attribute.get();
+        Value<?> value = attribute.get();
         
         if ( value instanceof ServerBinaryValue )
         {



Mime
View raw message