directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r414018 [5/8] - in /directory/branches/apacheds/1.0: ./ core-plugin/ core-shared/ core-unit/ core-unit/src/main/java/org/apache/directory/server/core/unit/ core-unit/src/test/java/org/apache/directory/server/core/ core-unit/src/test/java/or...
Date Wed, 14 Jun 2006 01:36:47 GMT
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java Tue Jun 13 18:36:40 2006
@@ -20,13 +20,13 @@
 import java.util.Iterator;
 import java.util.Set;
 
-import javax.naming.Name;
+import javax.naming.InvalidNameException;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.core.configuration.DirectoryPartitionConfiguration;
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -42,6 +42,8 @@
 {
     /** the default user principal or DN */
     public final static String ADMIN_PRINCIPAL = "uid=admin,ou=system";
+    /** the normalized user principal or DN */
+    public final static String ADMIN_PRINCIPAL_NORMALIZED = "0.9.2342.19200300.100.1.1=admin,2.5.4.11=system";
     /** the admin super user uid */
     public final static String ADMIN_UID = "admin";
     /** the initial admin passwd set on startup */
@@ -64,18 +66,31 @@
      * Gets the DN for the admin user.
      * @return the admin user DN
      */
-    public static final Name getAdminName()
+    public static final LdapDN getAdminName()
     {
-        Name adminDn = null;
+        LdapDN adminDn = null;
 
         try
         {
-            adminDn = new LdapName( ADMIN_PRINCIPAL );
+            adminDn = new LdapDN( ADMIN_PRINCIPAL );
         }
         catch ( NamingException e )
         {
             throw new InternalError();
         }
+        
+        try
+        {
+            adminDn.normalize();
+        }
+        catch ( InvalidNameException ine )
+        {
+            // Nothing we can do ...
+        }
+        catch ( NamingException ne )
+        {
+            // Nothing we can do ...
+        }
 
         return adminDn;
     }
@@ -86,13 +101,13 @@
      * A new Name instance is created and returned every time.
      * @return the groups base DN
      */
-    public static final Name getGroupsBaseName()
+    public static final LdapDN getGroupsBaseName()
     {
-        Name groupsBaseDn = null;
+        LdapDN groupsBaseDn = null;
 
         try
         {
-            groupsBaseDn = new LdapName( GROUPS_BASE_NAME );
+            groupsBaseDn = new LdapDN( GROUPS_BASE_NAME );
         }
         catch ( NamingException e )
         {
@@ -108,13 +123,13 @@
      * A new Name instance is created and returned every time.
      * @return the users base DN
      */
-    public static final Name getUsersBaseName()
+    public static final LdapDN getUsersBaseName()
     {
-        Name usersBaseDn = null;
+        LdapDN usersBaseDn = null;
 
         try
         {
-            usersBaseDn = new LdapName( USERS_BASE_NAME );
+            usersBaseDn = new LdapDN( USERS_BASE_NAME );
         }
         catch ( NamingException e )
         {
@@ -152,13 +167,13 @@
      * @return true if the entry contains an attribute with the value, false otherwise
      * @throws NamingException if there is a problem accessing the entry and its values
      */
-    public abstract boolean compare( Name name, String oid, Object value ) throws NamingException;
+    public abstract boolean compare( LdapDN name, String oid, Object value ) throws NamingException;
 
 
     public abstract void addContextPartition( DirectoryPartitionConfiguration config ) throws NamingException;
 
 
-    public abstract void removeContextPartition( Name suffix ) throws NamingException;
+    public abstract void removeContextPartition( LdapDN suffix ) throws NamingException;
 
 
     public abstract DirectoryPartition getSystemPartition();
@@ -174,22 +189,19 @@
      * @return the partition containing the entry represented by the dn
      * @throws NamingException if there is no partition for the dn
      */
-    public abstract DirectoryPartition getPartition( Name dn ) throws NamingException;
+    public abstract DirectoryPartition getPartition( LdapDN dn ) throws NamingException;
 
 
     /**
      * Gets the most significant Dn that exists within the server for any Dn.
      *
      * @param name the normalized distinguished name to use for matching.
-     * @param normalized boolean if true cause the return of a normalized Dn,
-     * if false it returns the original user provided distinguished name for 
-     * the matched portion of the Dn as it was provided on entry creation.
      * @return a distinguished name representing the matching portion of dn,
      * as originally provided by the user on creation of the matched entry or 
      * the empty string distinguished name if no match was found.
      * @throws NamingException if there are any problems
      */
-    public abstract Name getMatchedName( Name name, boolean normalized ) throws NamingException;
+    public abstract LdapDN getMatchedName ( LdapDN name ) throws NamingException;
 
 
     /**
@@ -198,27 +210,21 @@
      * fall under a partition suffix then the empty string Dn is returned.
      *
      * @param name the normalized distinguished name to use for finding a suffix.
-     * @param normalized if true causes the return of a normalized Dn, but
-     * if false it returns the original user provided distinguished name for 
-     * the suffix Dn as it was provided on suffix entry creation.
      * @return the suffix portion of dn, or the valid empty string Dn if no
      * naming context was found for dn.
      * @throws NamingException if there are any problems
      */
-    public abstract Name getSuffix( Name name, boolean normalized ) throws NamingException;
+    public abstract LdapDN getSuffix ( LdapDN name ) throws NamingException;
 
 
     /**
      * Gets an iteration over the Name suffixes of the partitions managed by this
      * {@link DirectoryPartitionNexus}.
      *
-     * @param normalized if true the returned Iterator contains normalized Dn
-     * but, if false, it returns the original user provided distinguished names
-     * in the Iterator.
      * @return Iteration over ContextPartition suffix names as Names.
      * @throws NamingException if there are any problems
      */
-    public abstract Iterator listSuffixes( boolean normalized ) throws NamingException;
+    public abstract Iterator listSuffixes () throws NamingException;
 
 
     /**

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java Tue Jun 13 18:36:40 2006
@@ -17,7 +17,7 @@
 package org.apache.directory.server.core.partition;
 
 
-import java.util.*;
+import java.util.*; 
 
 import javax.naming.Context;
 import javax.naming.Name;
@@ -42,7 +42,6 @@
 import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
-import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.shared.ldap.exception.LdapSizeLimitExceededException;
 import org.apache.directory.shared.ldap.exception.LdapTimeLimitExceededException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -143,15 +142,20 @@
     }
 
 
-    public DirectoryPartition getPartition( Name dn ) throws NamingException
+    public DirectoryPartition getPartition( LdapDN dn ) throws NamingException
     {
         return this.configuration.getPartitionNexus().getPartition( dn );
     }
 
 
-    public Name getSuffix( boolean normalized ) throws NamingException
+    public LdapDN getSuffix() throws NamingException
     {
-        return this.configuration.getPartitionNexus().getSuffix( normalized );
+        return this.configuration.getPartitionNexus().getSuffix();
+    }
+
+    public LdapDN getUpSuffix() throws NamingException
+    {
+        return this.configuration.getPartitionNexus().getUpSuffix();
     }
 
 
@@ -173,22 +177,21 @@
     }
 
 
-    public Name getMatchedName( Name dn, boolean normalized ) throws NamingException
+    public LdapDN getMatchedName ( LdapDN dn ) throws NamingException
     {
-        return getMatchedName( dn, normalized, null );
+        return getMatchedName( dn, null );
     }
 
 
-    public Name getMatchedName( Name dn, boolean normalized, Collection bypass ) throws NamingException
+    public LdapDN getMatchedName( LdapDN dn, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[]
-            { dn, normalized ? Boolean.TRUE : Boolean.FALSE };
+        Object[] args = new Object[] { dn };
         stack.push( new Invocation( this, caller, "getMatchedDn", args, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().getMatchedName( dn, normalized );
+            return this.configuration.getInterceptorChain().getMatchedName( dn );
         }
         finally
         {
@@ -197,22 +200,21 @@
     }
 
 
-    public Name getSuffix( Name dn, boolean normalized ) throws NamingException
+    public LdapDN getSuffix ( LdapDN dn ) throws NamingException
     {
-        return getSuffix( dn, normalized, null );
+        return getSuffix( dn, null );
     }
 
 
-    public Name getSuffix( Name dn, boolean normalized, Collection bypass ) throws NamingException
+    public LdapDN getSuffix( LdapDN dn, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[]
-            { dn, normalized ? Boolean.TRUE : Boolean.FALSE };
+        Object[] args = new Object[] { dn };
         stack.push( new Invocation( this, caller, "getSuffix", args, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().getSuffix( dn, normalized );
+            return this.configuration.getInterceptorChain().getSuffix( dn );
         }
         finally
         {
@@ -221,22 +223,21 @@
     }
 
 
-    public Iterator listSuffixes( boolean normalized ) throws NamingException
+    public Iterator listSuffixes () throws NamingException
     {
-        return listSuffixes( normalized, null );
+        return listSuffixes( null );
     }
 
 
-    public Iterator listSuffixes( boolean normalized, Collection bypass ) throws NamingException
+    public Iterator listSuffixes( Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        Object[] args = new Object[]
-            { normalized ? Boolean.TRUE : Boolean.FALSE };
+        Object[] args = new Object[] { };
         stack.push( new Invocation( this, caller, "listSuffixes", args, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().listSuffixes( normalized );
+            return this.configuration.getInterceptorChain().listSuffixes();
         }
         finally
         {
@@ -245,13 +246,13 @@
     }
 
 
-    public boolean compare( Name name, String oid, Object value ) throws NamingException
+    public boolean compare( LdapDN name, String oid, Object value ) throws NamingException
     {
         return compare( name, oid, value, null );
     }
 
 
-    public boolean compare( Name name, String oid, Object value, Collection bypass ) throws NamingException
+    public boolean compare( LdapDN name, String oid, Object value, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -268,13 +269,13 @@
     }
 
 
-    public void delete( Name name ) throws NamingException
+    public void delete( LdapDN name ) throws NamingException
     {
         delete( name, null );
     }
 
 
-    public void delete( Name name, Collection bypass ) throws NamingException
+    public void delete( LdapDN name, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -291,21 +292,21 @@
     }
 
 
-    public void add( String upName, Name normName, Attributes entry ) throws NamingException
+    public void add( LdapDN normName, Attributes entry ) throws NamingException
     {
-        add( upName, normName, entry, null );
+        add( normName, entry, null );
     }
 
 
-    public void add( String upName, Name normName, Attributes entry, Collection bypass ) throws NamingException
+    public void add( LdapDN normName, Attributes entry, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "add", new Object[]
-            { upName, normName, entry }, bypass ) );
+            { normName, entry }, bypass ) );
         try
         {
-            this.configuration.getInterceptorChain().add( upName, normName, entry );
+            this.configuration.getInterceptorChain().add( normName, entry );
         }
         finally
         {
@@ -314,13 +315,13 @@
     }
 
 
-    public void modify( Name name, int modOp, Attributes mods ) throws NamingException
+    public void modify( LdapDN name, int modOp, Attributes mods ) throws NamingException
     {
         modify( name, modOp, mods, null );
     }
 
 
-    public void modify( Name name, int modOp, Attributes mods, Collection bypass ) throws NamingException
+    public void modify( LdapDN name, int modOp, Attributes mods, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -354,13 +355,13 @@
     }
 
 
-    public void modify( Name name, ModificationItem[] mods ) throws NamingException
+    public void modify( LdapDN name, ModificationItem[] mods ) throws NamingException
     {
         modify( name, mods, null );
     }
 
 
-    public void modify( Name name, ModificationItem[] mods, Collection bypass ) throws NamingException
+    public void modify( LdapDN name, ModificationItem[] mods, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -377,13 +378,13 @@
     }
 
 
-    public NamingEnumeration list( Name base ) throws NamingException
+    public NamingEnumeration list( LdapDN base ) throws NamingException
     {
         return list( base, null );
     }
 
 
-    public NamingEnumeration list( Name base, Collection bypass ) throws NamingException
+    public NamingEnumeration list( LdapDN base, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -400,7 +401,7 @@
     }
 
 
-    public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
+    public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
         throws NamingException
     {
         NamingEnumeration ne = search( base, env, filter, searchCtls, null );
@@ -449,7 +450,7 @@
     }
 
 
-    public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls, Collection bypass )
+    public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls, Collection bypass )
         throws NamingException
     {
         ensureStarted();
@@ -467,13 +468,13 @@
     }
 
 
-    public Attributes lookup( Name name ) throws NamingException
+    public Attributes lookup( LdapDN name ) throws NamingException
     {
         return lookup( name, ( Collection ) null );
     }
 
 
-    public Attributes lookup( Name name, Collection bypass ) throws NamingException
+    public Attributes lookup( LdapDN name, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -481,11 +482,6 @@
             { name }, bypass ) );
         try
         {
-            OidRegistry registry = ( OidRegistry ) this.service.getConfiguration().getGlobalRegistries()
-                .getOidRegistry();
-
-            LdapDN.normalize( name, registry.getNameByOid() );
-
             return this.configuration.getInterceptorChain().lookup( name );
         }
         finally
@@ -495,13 +491,13 @@
     }
 
 
-    public Attributes lookup( Name dn, String[] attrIds ) throws NamingException
+    public Attributes lookup( LdapDN dn, String[] attrIds ) throws NamingException
     {
         return lookup( dn, attrIds, null );
     }
 
 
-    public Attributes lookup( Name dn, String[] attrIds, Collection bypass ) throws NamingException
+    public Attributes lookup( LdapDN dn, String[] attrIds, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -518,13 +514,13 @@
     }
 
 
-    public boolean hasEntry( Name name ) throws NamingException
+    public boolean hasEntry( LdapDN name ) throws NamingException
     {
         return hasEntry( name, null );
     }
 
 
-    public boolean hasEntry( Name name, Collection bypass ) throws NamingException
+    public boolean hasEntry( LdapDN name, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -541,13 +537,13 @@
     }
 
 
-    public boolean isSuffix( Name name ) throws NamingException
+    public boolean isSuffix( LdapDN name ) throws NamingException
     {
         return isSuffix( name, null );
     }
 
 
-    public boolean isSuffix( Name name, Collection bypass ) throws NamingException
+    public boolean isSuffix( LdapDN name, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -564,13 +560,13 @@
     }
 
 
-    public void modifyRn( Name name, String newRn, boolean deleteOldRn ) throws NamingException
+    public void modifyRn( LdapDN name, String newRn, boolean deleteOldRn ) throws NamingException
     {
         modifyRn( name, newRn, deleteOldRn, null );
     }
 
 
-    public void modifyRn( Name name, String newRn, boolean deleteOldRn, Collection bypass ) throws NamingException
+    public void modifyRn( LdapDN name, String newRn, boolean deleteOldRn, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -588,13 +584,13 @@
     }
 
 
-    public void move( Name oriChildName, Name newParentName ) throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName ) throws NamingException
     {
         move( oriChildName, newParentName, null );
     }
 
 
-    public void move( Name oriChildName, Name newParentName, Collection bypass ) throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -611,13 +607,13 @@
     }
 
 
-    public void move( Name oriChildName, Name newParentName, String newRn, boolean deleteOldRn ) throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn ) throws NamingException
     {
         move( oriChildName, newParentName, newRn, deleteOldRn, null );
     }
 
 
-    public void move( Name oriChildName, Name newParentName, String newRn, boolean deleteOldRn, Collection bypass )
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Collection bypass )
         throws NamingException
     {
         ensureStarted();
@@ -636,7 +632,7 @@
     }
 
 
-    public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId, Collection bypass )
+    public void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId, Collection bypass )
         throws NamingException
     {
         ensureStarted();
@@ -655,7 +651,7 @@
     }
 
 
-    public void unbind( Name bindDn, Collection bypass ) throws NamingException
+    public void unbind( LdapDN bindDn, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -673,13 +669,13 @@
     }
 
 
-    public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
+    public void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
     {
         bind( bindDn, credentials, mechanisms, saslAuthId, null );
     }
 
 
-    public void unbind( Name bindDn ) throws NamingException
+    public void unbind( LdapDN bindDn ) throws NamingException
     {
         unbind( bindDn, null );
     }
@@ -730,13 +726,13 @@
     }
 
 
-    public void removeContextPartition( Name suffix ) throws NamingException
+    public void removeContextPartition( LdapDN suffix ) throws NamingException
     {
         removeContextPartition( suffix, null );
     }
 
 
-    public void removeContextPartition( Name suffix, Collection bypass ) throws NamingException
+    public void removeContextPartition( LdapDN suffix, Collection bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -780,7 +776,7 @@
      */
 
     public void addNamingListener( EventContext ctx, Name name, ExprNode filter, SearchControls searchControls,
-        NamingListener namingListener ) throws NamingException
+                                   NamingListener namingListener ) throws NamingException
     {
         InterceptorChain chain = this.configuration.getInterceptorChain();
         EventService interceptor = ( EventService ) chain.get( "eventService" );

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java Tue Jun 13 18:36:40 2006
@@ -22,7 +22,6 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
@@ -44,6 +43,7 @@
 import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -181,9 +181,9 @@
         Attributes suffixOnDisk = getSuffixEntry();
         if ( suffixOnDisk == null )
         {
-            add( cfg.getSuffix(),
-                cfg.getNormalizedSuffix( factoryCfg.getGlobalRegistries().getMatchingRuleRegistry() ), cfg
-                    .getContextEntry() );
+            LdapDN suffix = new LdapDN( cfg.getSuffix() );
+            LdapDN normalizedSuffix = LdapDN.normalize( suffix );
+            add( normalizedSuffix, cfg.getContextEntry() );
         }
     }
 
@@ -208,7 +208,7 @@
     // ContextPartition Interface Method Implementations
     // ------------------------------------------------------------------------
 
-    public void delete( Name dn ) throws NamingException
+    public void delete( LdapDN dn ) throws NamingException
     {
         BigInteger id = getEntryId( dn.toString() );
 
@@ -230,16 +230,16 @@
     }
 
 
-    public abstract void add( String updn, Name dn, Attributes entry ) throws NamingException;
+    public abstract void add(LdapDN dn, Attributes entry) throws NamingException;
 
 
-    public abstract void modify( Name dn, int modOp, Attributes mods ) throws NamingException;
+    public abstract void modify( LdapDN dn, int modOp, Attributes mods ) throws NamingException;
 
 
-    public abstract void modify( Name dn, ModificationItem[] mods ) throws NamingException;
+    public abstract void modify( LdapDN dn, ModificationItem[] mods ) throws NamingException;
 
 
-    public NamingEnumeration list( Name base ) throws NamingException
+    public NamingEnumeration list( LdapDN base ) throws NamingException
     {
         SearchResultEnumeration list;
         list = new BTreeSearchResultEnumeration( ArrayUtils.EMPTY_STRING_ARRAY, list( getEntryId( base.toString() ) ),
@@ -248,7 +248,7 @@
     }
 
 
-    public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
+    public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
         throws NamingException
     {
         String[] attrIds = searchCtls.getReturningAttributes();
@@ -260,13 +260,13 @@
     }
 
 
-    public Attributes lookup( Name dn ) throws NamingException
+    public Attributes lookup( LdapDN dn ) throws NamingException
     {
         return lookup( getEntryId( dn.toString() ) );
     }
 
 
-    public Attributes lookup( Name dn, String[] attrIds ) throws NamingException
+    public Attributes lookup( LdapDN dn, String[] attrIds ) throws NamingException
     {
         if ( attrIds == null || attrIds.length == 0 )
         {
@@ -290,19 +290,19 @@
     }
 
 
-    public boolean hasEntry( Name dn ) throws NamingException
+    public boolean hasEntry( LdapDN dn ) throws NamingException
     {
         return null != getEntryId( dn.toString() );
     }
 
 
-    public abstract void modifyRn( Name dn, String newRdn, boolean deleteOldRdn ) throws NamingException;
+    public abstract void modifyRn( LdapDN dn, String newRdn, boolean deleteOldRdn ) throws NamingException;
 
 
-    public abstract void move( Name oldChildDn, Name newParentDn ) throws NamingException;
+    public abstract void move( LdapDN oldChildDn, LdapDN newParentDn ) throws NamingException;
 
 
-    public abstract void move( Name oldChildDn, Name newParentDn, String newRdn, boolean deleteOldRdn )
+    public abstract void move( LdapDN oldChildDn, LdapDN newParentDn, String newRdn, boolean deleteOldRdn )
         throws NamingException;
 
 
@@ -315,9 +315,9 @@
     public abstract boolean isInitialized();
 
 
-    public boolean isSuffix( Name dn ) throws NamingException
+    public boolean isSuffix( LdapDN dn ) throws NamingException
     {
-        return getSuffix( true ).equals( dn );
+        return getSuffix().equals( dn );
     }
 
 
@@ -338,10 +338,10 @@
     public abstract void addIndexOn( AttributeType attribute ) throws NamingException;
 
 
-    public abstract boolean hasUserIndexOn( String attribute );
+    public abstract boolean hasUserIndexOn( String attribute ) throws NamingException;
 
 
-    public abstract boolean hasSystemIndexOn( String attribute );
+    public abstract boolean hasSystemIndexOn( String attribute ) throws NamingException;
 
 
     public abstract Index getExistanceIndex();

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java Tue Jun 13 18:36:40 2006
@@ -30,7 +30,7 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.ScopeNode;
 import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -112,7 +112,7 @@
          */
         else if ( null != aliasedBase ) // mode = FINDING || ALWAYS
         {
-            effectiveBase = new LdapName( aliasedBase );
+            effectiveBase = new LdapDN( aliasedBase );
         }
         /*
          * I the base not an alias the we just set the base to the given base

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java Tue Jun 13 18:36:40 2006
@@ -25,6 +25,7 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.ServerUtils;
 import org.apache.directory.server.core.schema.AttributeTypeRegistry;
 import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.shared.ldap.NotImplementedException;
@@ -248,10 +249,11 @@
             return false;
         }
 
-        return null != attrs.get( attrId );
+        AttributeType type = attributeTypeRegistry.lookup( oidRegistry.getOid( attrId ) );
+        return null != ServerUtils.getAttribute( type, attrs );
     }
 
-
+   
     /**
      * Evaluates a simple equality attribute value assertion on a perspective
      * candidate.
@@ -287,7 +289,9 @@
         }
 
         // get the attribute associated with the node 
-        Attribute attr = rec.getAttributes().get( node.getAttribute() );
+        Attributes attrs = rec.getAttributes();
+        AttributeType type = attributeTypeRegistry.lookup( oidRegistry.getOid( node.getAttribute() ) );
+        Attribute attr = ServerUtils.getAttribute( type, attrs );
 
         // If we do not have the attribute just return false
         if ( null == attr )

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryDialog.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryDialog.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryDialog.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryDialog.java Tue Jun 13 18:36:40 2006
@@ -67,10 +67,9 @@
      * @param a_parent
      * @param a_modal
      */
-    public EntryDialog(Frame a_parent, String a_opMode, boolean a_modal)
+    public EntryDialog( Frame parent, boolean modal )
     {
-        super( a_parent, a_modal );
-        //        m_opMode = a_opMode ;
+        super( parent, modal );
         initGUI();
     }
 

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java Tue Jun 13 18:36:40 2006
@@ -33,7 +33,7 @@
 import org.apache.directory.server.core.partition.impl.btree.IndexRecord;
 import org.apache.directory.server.core.partition.impl.btree.SearchEngine;
 import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -187,7 +187,7 @@
 
         try
         {
-            LdapName dn = new LdapName( partition.getEntryDn( id ) );
+            LdapDN dn = new LdapDN( partition.getEntryDn( id ) );
             buf.append( "(" ).append( id ).append( ") " );
             buf.append( dn.getRdn() );
         }

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java Tue Jun 13 18:36:40 2006
@@ -31,6 +31,7 @@
 import org.apache.directory.server.core.partition.impl.btree.IndexRecord;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -71,12 +72,20 @@
 
 
     /** Creates new form JDialog */
-    public IndexDialog(Frame parent, boolean modal, Index index)
+    public IndexDialog( Frame parent, boolean modal, Index index )
     {
         super( parent, modal );
         this.index = index;
         initGUI();
     }
+    
+    
+    public IndexDialog( Index index )
+    {
+        super();
+        this.index = index;
+        initGUI();
+    }
 
 
     /**
@@ -343,4 +352,11 @@
 
         return true;
     }
-}
\ No newline at end of file
+    
+    
+    public static void show( Index index )
+    {
+        IndexDialog dialog = new IndexDialog( index );
+        dialog.setVisible( true );
+    }
+}

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java Tue Jun 13 18:36:40 2006
@@ -63,14 +63,16 @@
 import org.apache.directory.server.core.partition.impl.btree.Index;
 import org.apache.directory.server.core.partition.impl.btree.IndexRecord;
 import org.apache.directory.server.core.partition.impl.btree.SearchEngine;
+
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.FilterParserImpl;
 import org.apache.directory.shared.ldap.ldif.Entry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -156,7 +158,7 @@
         content.add( mainPnl, java.awt.BorderLayout.NORTH );
         getContentPane().add( content, BorderLayout.CENTER );
         // set title
-        setTitle( "Partition: " + this.partition.getSuffix( false ).toString() );
+        setTitle( "Partition: " + this.partition.getSuffix().toString() );
         // add status bar
         getContentPane().add( statusBar, BorderLayout.SOUTH );
         // add menu bar
@@ -351,7 +353,7 @@
         try
         {
             TreePath path = tree.getSelectionModel().getSelectionPath();
-            String parentDn = partition.getSuffix( false ).toString();
+            String parentDn = partition.getSuffix().toString();
 
             if ( null != path )
             {
@@ -395,7 +397,7 @@
 
         if ( null == path )
         {
-            return partition.getSuffix( false ).toString();
+            return partition.getSuffix().toString();
         }
 
         Object last = path.getLastPathComponent();
@@ -414,7 +416,7 @@
         }
         else
         {
-            base = partition.getSuffix( false ).toString();
+            base = partition.getSuffix().toString();
         }
 
         return base;
@@ -444,11 +446,11 @@
                 String updn = entry.getDn();
                 Attributes attrs = entry.getAttributes();
                 
-                LdapName ndn = new LdapName( StringTools.deepTrimToLower( updn ) );
+                LdapDN ndn = new LdapDN( StringTools.deepTrimToLower( updn ) );
 
                 if ( null == partition.getEntryId( ndn.toString() ) )
                 {
-                    partition.add( updn, ndn, attrs );
+                    partition.add(ndn, attrs );
                     load();
                 }
             }
@@ -548,7 +550,7 @@
         }
         else
         {
-            dialog.setBase( partition.getSuffix( false ).toString() );
+            dialog.setBase( partition.getSuffix().toString() );
         }
 
         dialog.addActionListener( new ActionListener()
@@ -644,7 +646,7 @@
 
         env.put( DerefAliasesEnum.JNDI_PROP, DerefAliasesEnum.DEREFALWAYS_NAME );
 
-        NamingEnumeration cursor = eng.search( new LdapName( base ), env, root, ctls );
+        NamingEnumeration cursor = eng.search( new LdapDN( base ), env, root, ctls );
         String[] cols = new String[2];
         cols[0] = "id";
         cols[1] = "dn";
@@ -865,7 +867,7 @@
         nodes = new HashMap();
 
         Attributes suffix = partition.getSuffixEntry();
-        BigInteger id = partition.getEntryId( partition.getSuffix( false ).toString() );
+        BigInteger id = partition.getEntryId( partition.getSuffix().toString() );
         root = new EntryNode( id, null, partition, suffix, nodes );
 
         /*

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionViewer.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionViewer.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionViewer.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionViewer.java Tue Jun 13 18:36:40 2006
@@ -24,6 +24,7 @@
 
 import org.apache.directory.server.core.partition.impl.btree.BTreeDirectoryPartition;
 import org.apache.directory.server.core.partition.impl.btree.SearchEngine;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -82,7 +83,9 @@
     //        }
     //    }
 
-    public void execute() throws NamingException
+    
+    // added return value so expressions in debugger does not freak with void
+    public int execute() throws NamingException
     {
         PartitionFrame frame = new PartitionFrame( partition, eng );
 
@@ -94,5 +97,6 @@
 
         frame.setVisible( true );
         log.debug( frameSize + "" );
+        return 0;
     }
 }

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java Tue Jun 13 18:36:40 2006
@@ -26,7 +26,6 @@
 import java.util.List;
 import java.util.Map;
 
-import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
@@ -40,6 +39,7 @@
 import jdbm.recman.CacheRecordManager;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
+import org.apache.directory.server.core.ServerUtils;
 import org.apache.directory.server.core.configuration.DirectoryPartitionConfiguration;
 import org.apache.directory.server.core.partition.DirectoryPartition;
 import org.apache.directory.server.core.partition.impl.btree.BTreeDirectoryPartition;
@@ -48,16 +48,19 @@
 import org.apache.directory.server.core.partition.impl.btree.IndexAssertionEnumeration;
 import org.apache.directory.server.core.partition.impl.btree.IndexNotFoundException;
 import org.apache.directory.server.core.partition.impl.btree.IndexRecord;
+import org.apache.directory.server.core.schema.AttributeTypeRegistry;
+import org.apache.directory.server.core.schema.OidRegistry;
+
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationNotSupportedException;
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
 import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.util.NamespaceTools;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -75,10 +78,10 @@
 
     /** the JDBM record manager used by this database */
     private RecordManager recMan;
-    /** the user provided suffix of this backend database */
-    private Name upSuffix;
-    /** the normalized suffix of this backend database */
-    private Name normSuffix;
+    /** the normalized suffix DN of this backend database */
+    private LdapDN normSuffix;
+    /** the user provided suffix DN of this backend database */
+    private LdapDN upSuffix;
     /** the working directory to use for files */
     private File workingDirectory;
     /** the master table storing entries by primary key */
@@ -105,6 +108,9 @@
     private Index subAliasIdx;
     /** a system index on aliasedObjectName attribute */
     private Index aliasIdx;
+    
+    private OidRegistry oidRegistry;
+    private AttributeTypeRegistry attrRegistry;
 
 
     // ------------------------------------------------------------------------
@@ -122,8 +128,12 @@
     public synchronized void init( DirectoryServiceConfiguration factoryCfg, DirectoryPartitionConfiguration cfg )
         throws NamingException
     {
-        this.upSuffix = new LdapName( cfg.getSuffix() );
-        this.normSuffix = cfg.getNormalizedSuffix( factoryCfg.getGlobalRegistries().getMatchingRuleRegistry() );
+        oidRegistry = factoryCfg.getGlobalRegistries().getOidRegistry();
+        attrRegistry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
+        Map oids = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping();
+        LdapDN.setOidsMap( oids );
+        this.upSuffix = new LdapDN( cfg.getSuffix() );
+        this.normSuffix = LdapDN.normalize( upSuffix );
 
         File workingDirectory = new File( factoryCfg.getStartupConfiguration().getWorkingDirectory().getPath()
             + File.separator + cfg.getName() );
@@ -292,7 +302,7 @@
     public void addIndexOn( AttributeType spec ) throws NamingException
     {
         Index idx = new JdbmIndex( spec, workingDirectory );
-        indices.put( spec.getName().toLowerCase(), idx );
+        indices.put( spec.getOid(), idx );
     }
 
 
@@ -311,7 +321,7 @@
         }
 
         existanceIdx = new JdbmIndex( attrType, workingDirectory );
-        sysIndices.put( attrType.getName().toLowerCase(), existanceIdx );
+        sysIndices.put( attrType.getOid(), existanceIdx );
     }
 
 
@@ -330,7 +340,7 @@
         }
 
         hierarchyIdx = new JdbmIndex( attrType, workingDirectory );
-        sysIndices.put( attrType.getName().toLowerCase(), hierarchyIdx );
+        sysIndices.put( attrType.getOid(), hierarchyIdx );
     }
 
 
@@ -349,7 +359,7 @@
         }
 
         aliasIdx = new JdbmIndex( attrType, workingDirectory );
-        sysIndices.put( attrType.getName().toLowerCase(), aliasIdx );
+        sysIndices.put( attrType.getOid(), aliasIdx );
     }
 
 
@@ -368,7 +378,7 @@
         }
 
         oneAliasIdx = new JdbmIndex( attrType, workingDirectory );
-        sysIndices.put( attrType.getName().toLowerCase(), oneAliasIdx );
+        sysIndices.put( attrType.getOid(), oneAliasIdx );
     }
 
 
@@ -387,7 +397,7 @@
         }
 
         subAliasIdx = new JdbmIndex( attrType, workingDirectory );
-        sysIndices.put( attrType.getName().toLowerCase(), subAliasIdx );
+        sysIndices.put( attrType.getOid(), subAliasIdx );
     }
 
 
@@ -406,7 +416,7 @@
         }
 
         updnIdx = new JdbmIndex( attrType, workingDirectory );
-        sysIndices.put( attrType.getName().toLowerCase(), updnIdx );
+        sysIndices.put( attrType.getOid(), updnIdx );
     }
 
 
@@ -425,7 +435,7 @@
         }
 
         ndnIdx = new JdbmIndex( attrType, workingDirectory );
-        sysIndices.put( attrType.getName().toLowerCase(), ndnIdx );
+        sysIndices.put( attrType.getOid(), ndnIdx );
     }
 
 
@@ -441,64 +451,93 @@
     }
 
 
-    public boolean hasUserIndexOn( String attribute )
+    public boolean hasUserIndexOn( String id ) throws NamingException
     {
-        return indices.containsKey( attribute ) || indices.containsKey( attribute.toLowerCase() );
+        return indices.containsKey( oidRegistry.getOid( id ) );
     }
 
 
-    public boolean hasSystemIndexOn( String attribute )
+    public boolean hasSystemIndexOn( String id ) throws NamingException
     {
-        return sysIndices.containsKey( attribute ) || sysIndices.containsKey( attribute.toLowerCase() );
+        return sysIndices.containsKey( oidRegistry.getOid( id ) );
     }
 
 
     /**
-     * @todo replace lookups to use the OID instead of the name.  Also note
-     * that the OID registry can be used to go between names and oids.
-     * 
      * @see org.apache.directory.server.core.partition.impl.btree.BTreeDirectoryPartition#getUserIndex(String)
      */
-    public Index getUserIndex( String attribute ) throws IndexNotFoundException
+    public Index getUserIndex( String id ) throws IndexNotFoundException
     {
-        String lowerCased = attribute.toLowerCase();
-
-        if ( indices.containsKey( attribute ) )
+        try
         {
-            return ( Index ) indices.get( attribute );
+            id = oidRegistry.getOid( id );
         }
-        else if ( indices.containsKey( lowerCased ) )
+        catch ( NamingException e )
         {
-            return ( Index ) indices.get( lowerCased );
+            log.error( "Failed to identify OID for: " + id, e );
+            throw new IndexNotFoundException( "Failed to identify OID for: " + id, id, e );
+        }
+
+        if ( indices.containsKey( id ) )
+        {
+            return ( Index ) indices.get( id );
         }
         else
         {
-            throw new IndexNotFoundException( "An index on attribute " + attribute + " does not exist!" );
+            String name = "unknown";
+            try
+            {
+                name = oidRegistry.getPrimaryName( id );
+            }
+            catch ( NamingException e )
+            {
+                String msg = "Failed to resolve primary name for " + id + " in user index lookup";
+                log.error( msg, e );
+                throw new IndexNotFoundException( msg, id, e );
+            }
+            
+            throw new IndexNotFoundException( "A user index on attribute " + id + " (" 
+                + name + ") does not exist!" );
         }
     }
 
 
     /**
-     * @todo replace lookups to use the OID instead of the name.  Also note
-     * that the OID registry can be used to go between names and oids.
-     * 
      * @see BTreeDirectoryPartition#getEntryId(String)
      */
-    public Index getSystemIndex( String indexName ) throws IndexNotFoundException
+    public Index getSystemIndex( String id ) throws IndexNotFoundException
     {
-        String lowerCased = indexName.toLowerCase();
-
-        if ( sysIndices.containsKey( indexName ) )
+        try
+        {
+            id = oidRegistry.getOid( id );
+        }
+        catch ( NamingException e )
         {
-            return ( Index ) sysIndices.get( indexName );
+            log.error( "Failed to identify OID for: " + id, e );
+            throw new IndexNotFoundException( "Failed to identify OID for: " + id, id, e );
         }
-        else if ( sysIndices.containsKey( lowerCased ) )
+
+
+        if ( sysIndices.containsKey( id ) )
         {
-            return ( Index ) sysIndices.get( lowerCased );
+            return ( Index ) sysIndices.get( id );
         }
         else
         {
-            throw new IndexNotFoundException( "A system index by the name of " + indexName + " does not exist!" );
+            String name = "unknown";
+            try
+            {
+                name = oidRegistry.getPrimaryName( id );
+            }
+            catch ( NamingException e )
+            {
+                String msg = "Failed to resolve primary name for " + id + " in user index lookup";
+                log.error( msg, e );
+                throw new IndexNotFoundException( msg, id, e );
+            }
+            
+            throw new IndexNotFoundException( "A system index on attribute " + id + " (" 
+                + name + ") does not exist!" );
         }
     }
 
@@ -560,7 +599,7 @@
         String targetDn = ( String ) aliasIdx.reverseLookup( aliasId );
         BigInteger targetId = getEntryId( targetDn );
         String aliasDn = getEntryDn( aliasId );
-        Name ancestorDn = new LdapName( aliasDn ).getPrefix( 1 );
+        LdapDN ancestorDn = ( LdapDN ) new LdapDN( aliasDn ).getPrefix( 1 );
         BigInteger ancestorId = getEntryId( ancestorDn.toString() );
 
         /*
@@ -579,7 +618,7 @@
 
         while ( !ancestorDn.equals( upSuffix ) )
         {
-            ancestorDn = ancestorDn.getPrefix( 1 );
+            ancestorDn = ( LdapDN ) ancestorDn.getPrefix( 1 );
             ancestorId = getEntryId( ancestorDn.toString() );
 
             subAliasIdx.drop( ancestorId, targetId );
@@ -600,17 +639,16 @@
      * @throws NamingException if index addition fails, of the alias is not 
      * allowed due to chaining or cycle formation.
      */
-    private void addAliasIndices( BigInteger aliasId, Name aliasDn, String aliasTarget ) throws NamingException
+    private void addAliasIndices( BigInteger aliasId, LdapDN aliasDn, String aliasTarget ) throws NamingException
     {
-        Name targetDn = null; // Name value of aliasedObjectName
+        LdapDN normalizedAliasTargetDn = null; // Name value of aliasedObjectName
         BigInteger targetId = null; // Id of the aliasedObjectName
-        Normalizer normalizer = null; // Temporary handle for Dn's
-        Name ancestorDn = null; // Name of an alias entry relative
+        LdapDN ancestorDn = null; // Name of an alias entry relative
         BigInteger ancestorId = null; // Id of an alias entry relative
 
         // Access aliasedObjectName, normalize it and generate the Name 
-        normalizer = oneAliasIdx.getAttribute().getEquality().getNormalizer();
-        targetDn = new LdapName( ( String ) normalizer.normalize( aliasTarget ) );
+        normalizedAliasTargetDn = new LdapDN( aliasTarget );
+        normalizedAliasTargetDn.normalize();
 
         /*
          * Check For Cycles
@@ -622,9 +660,9 @@
          * entry Dn starts with the target Dn.  If it does then we know the 
          * aliased target is a relative and we have a perspecitive cycle.
          */
-        if ( aliasDn.startsWith( targetDn ) )
+        if ( aliasDn.startsWith( normalizedAliasTargetDn ) )
         {
-            if ( aliasDn.equals( targetDn ) )
+            if ( aliasDn.equals( normalizedAliasTargetDn ) )
             {
                 throw new NamingException( "[36] aliasDereferencingProblem - " + "attempt to create alias to itself." );
             }
@@ -642,16 +680,16 @@
          * need to point it out to the user instead of saying the target
          * does not exist when it potentially could outside of this upSuffix.
          */
-        if ( !targetDn.startsWith( upSuffix ) )
+        if ( !normalizedAliasTargetDn.startsWith( normSuffix ) )
         {
             // Complain specifically about aliases to outside naming contexts
             throw new NamingException( "[36] aliasDereferencingProblem -"
-                + " the alias points to an entry outside of the " + upSuffix
+                + " the alias points to an entry outside of the " + upSuffix.toUpName()
                 + " namingContext to an object whose existance cannot be" + " determined." );
         }
 
         // L O O K U P   T A R G E T   I D
-        targetId = ndnIdx.forwardLookup( targetDn.toString() );
+        targetId = ndnIdx.forwardLookup( normalizedAliasTargetDn.toNormName() );
 
         /*
          * Check For Target Existance
@@ -685,6 +723,8 @@
         }
 
         // Add the alias to the simple alias index
+        // TODO should we be adding aliasTarget which is not normalized or 
+        //      should we be adding targetDn.toNormName()
         aliasIdx.add( aliasTarget, aliasId );
 
         /*
@@ -694,10 +734,11 @@
          * index.  If the target is not a sibling of the alias then we add the
          * index entry maping the parent's id to the aliased target id.
          */
-        ancestorDn = aliasDn.getPrefix( 1 );
-        ancestorId = getEntryId( ancestorDn.toString() );
+        ancestorDn = ( LdapDN ) aliasDn.clone();
+        ancestorDn.remove( aliasDn.size() - 1 );
+        ancestorId = getEntryId( ancestorDn.toNormName() );
 
-        if ( !NamespaceTools.isSibling( targetDn, aliasDn ) )
+        if ( !NamespaceTools.isSibling( normalizedAliasTargetDn, aliasDn ) )
         {
             oneAliasIdx.add( ancestorId, targetId );
         }
@@ -712,20 +753,20 @@
          * ignored since everything is under its scope.  The first loop 
          * iteration shall handle the parents.
          */
-        while ( !ancestorDn.equals( upSuffix ) && null != ancestorId )
+        while ( !ancestorDn.equals( normSuffix ) && null != ancestorId )
         {
-            if ( !NamespaceTools.isDescendant( ancestorDn, targetDn ) )
+            if ( !NamespaceTools.isDescendant( ancestorDn, normalizedAliasTargetDn ) )
             {
                 subAliasIdx.add( ancestorId, targetId );
             }
 
-            ancestorDn = ancestorDn.getPrefix( 1 );
-            ancestorId = getEntryId( ancestorDn.toString() );
+            ancestorDn = ( LdapDN ) ancestorDn.remove( ancestorDn.size() - 1 );
+            ancestorId = getEntryId( ancestorDn.toNormName() );
         }
     }
 
-
-    public void add( String updn, Name dn, Attributes entry ) throws NamingException
+    
+    public void add( LdapDN normName, Attributes entry ) throws NamingException
     {
         BigInteger id;
         BigInteger parentId = null;
@@ -738,52 +779,61 @@
         // entry sequences start at 1.
         //
 
-        if ( dn.equals( normSuffix ) )
+        LdapDN parentDn = null;
+        if ( normName.equals( normSuffix ) )
         {
             parentId = BigInteger.ZERO;
         }
         else
         {
-            parentId = getEntryId( dn.getPrefix( 1 ).toString() );
+            parentDn = ( LdapDN ) normName.clone();
+            parentDn.remove( parentDn.size() - 1 );
+            parentId = getEntryId( parentDn.toString() );
         }
 
         // don't keep going if we cannot find the parent Id
         if ( parentId == null )
         {
-            throw new LdapNameNotFoundException( "Id for parent '" + dn.getPrefix( 1 ).toString() + "' not found!" );
+            throw new LdapNameNotFoundException( "Id for parent '" + parentDn + "' not found!" );
         }
 
-        Attribute objectClass = entry.get( "objectClass" );
+        AttributeType octype = attrRegistry.lookup( "objectClass" );
+        Attribute objectClass = ServerUtils.getAttribute( octype, entry );
 
         if ( objectClass == null )
         {
-            String msg = "Entry " + updn + " contains no objectClass attribute: " + entry;
-
+            String msg = "Entry " + normName.toUpName() + " contains no objectClass attribute: " + entry;
             throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECTCLASSVIOLATION );
         }
 
         // Start adding the system indices
         // Why bother doing a lookup if this is not an alias.
 
-        if ( entry.get( "objectClass" ).contains( DirectoryPartition.ALIAS_OBJECT ) )
+        if ( objectClass.contains( DirectoryPartition.ALIAS_OBJECT ) )
         {
-            addAliasIndices( id, dn, ( String ) entry.get( DirectoryPartition.ALIAS_ATTRIBUTE ).get() );
+            AttributeType aliasType = attrRegistry.lookup( DirectoryPartition.ALIAS_ATTRIBUTE );
+            Attribute aliasAttr = ServerUtils.getAttribute( aliasType, entry );
+            addAliasIndices( id, normName, ( String ) aliasAttr.get() );
         }
 
-        ndnIdx.add( dn.toString(), id );
-        updnIdx.add( updn, id );
+        ndnIdx.add( normName.toNormName(), id );
+        updnIdx.add( normName.toUpName(), id );
         hierarchyIdx.add( parentId, id );
 
         // Now work on the user defined indices
         NamingEnumeration list = entry.getIDs();
         while ( list.hasMore() )
         {
-            String attribute = ( String ) list.next();
+            String attributeId = ( String ) list.next();
+            String attributeOid = oidRegistry.getOid( attributeId );
 
-            if ( hasUserIndexOn( attribute ) )
+            if ( hasUserIndexOn( attributeOid ) )
             {
-                Index idx = getUserIndex( attribute );
-                NamingEnumeration values = entry.get( attribute ).getAll();
+                Index idx = getUserIndex( attributeOid );
+                
+                // here lookup by attributeId is ok since we got attributeId from 
+                // the entry via the enumeration - it's in there as is for sure
+                NamingEnumeration values = entry.get( attributeId ).getAll();
 
                 while ( values.hasMore() )
                 {
@@ -791,7 +841,7 @@
                 }
 
                 // Adds only those attributes that are indexed
-                existanceIdx.add( attribute.toLowerCase(), id );
+                existanceIdx.add( attributeOid, id );
             }
         }
 
@@ -811,7 +861,9 @@
         BigInteger parentId = getParentId( id );
         NamingEnumeration attrs = entry.getIDs();
 
-        if ( entry.get( "objectClass" ).contains( DirectoryPartition.ALIAS_OBJECT ) )
+        AttributeType octype = attrRegistry.lookup( "objectClass" );
+        Attribute objectClass = ServerUtils.getAttribute( octype, entry );
+        if ( objectClass.contains( DirectoryPartition.ALIAS_OBJECT ) )
         {
             dropAliasIndices( id );
         }
@@ -828,19 +880,23 @@
 
         while ( attrs.hasMore() )
         {
-            String attr = ( ( String ) attrs.next() );
+            String attributeId = ( ( String ) attrs.next() );
+            String attributeOid = oidRegistry.getOid( attributeId );
 
-            if ( hasUserIndexOn( attr ) )
+            if ( hasUserIndexOn( attributeOid ) )
             {
-                Index index = getUserIndex( attr );
-                NamingEnumeration values = entry.get( attr ).getAll();
+                Index index = getUserIndex( attributeOid );
+
+                // here lookup by attributeId is ok since we got attributeId from 
+                // the entry via the enumeration - it's in there as is for sure
+                NamingEnumeration values = entry.get( attributeId ).getAll();
 
                 while ( values.hasMore() )
                 {
                     index.drop( values.next(), id );
                 }
 
-                existanceIdx.drop( attr.toLowerCase(), id );
+                existanceIdx.drop( attributeOid, id );
             }
         }
 
@@ -860,20 +916,20 @@
     }
 
 
-    public Name getSuffix( boolean normalized )
+    public LdapDN getSuffix()
     {
-        if ( normalized )
-        {
-            return normSuffix;
-        }
+        return normSuffix;
+    }
 
+    public LdapDN getUpSuffix()
+    {
         return upSuffix;
     }
 
 
     public Attributes getSuffixEntry() throws NamingException
     {
-        BigInteger id = getEntryId( upSuffix.toString() );
+        BigInteger id = getEntryId( normSuffix.toNormName() );
 
         if ( null == id )
         {
@@ -976,20 +1032,23 @@
      */
     private void add( BigInteger id, Attributes entry, Attribute mods ) throws NamingException
     {
-        if ( hasUserIndexOn( mods.getID() ) )
+        String modsOid = oidRegistry.getOid( mods.getID() );
+        
+        if ( hasUserIndexOn( modsOid ) )
         {
-            Index idx = getUserIndex( mods.getID() );
+            Index idx = getUserIndex( modsOid );
             idx.add( mods, id );
 
             // If the attr didn't exist for this id add it to existance index
-            if ( !existanceIdx.hasValue( mods.getID().toLowerCase(), id ) )
+            if ( !existanceIdx.hasValue( modsOid, id ) )
             {
-                existanceIdx.add( mods.getID().toLowerCase(), id );
+                existanceIdx.add( modsOid, id );
             }
         }
 
         // add all the values in mods to the same attribute in the entry
-        Attribute entryAttrToAddTo = entry.get( mods.getID() );
+        AttributeType type = attrRegistry.lookup( modsOid );
+        Attribute entryAttrToAddTo = ServerUtils.getAttribute( type, entry );
 
         if ( entryAttrToAddTo == null )
         {
@@ -1002,10 +1061,10 @@
             entryAttrToAddTo.add( mods.get( ii ) );
         }
 
-        if ( mods.getID().equals( DirectoryPartition.ALIAS_ATTRIBUTE ) )
+        if ( modsOid.equals( oidRegistry.getOid( DirectoryPartition.ALIAS_ATTRIBUTE ) ) )
         {
             String ndnStr = ( String ) ndnIdx.reverseLookup( id );
-            addAliasIndices( id, new LdapName( ndnStr ), ( String ) mods.get() );
+            addAliasIndices( id, new LdapDN( ndnStr ), ( String ) mods.get() );
         }
     }
 
@@ -1026,9 +1085,11 @@
      */
     private void remove( BigInteger id, Attributes entry, Attribute mods ) throws NamingException
     {
-        if ( hasUserIndexOn( mods.getID() ) )
+        String modsOid = oidRegistry.getOid( mods.getID() );
+        
+        if ( hasUserIndexOn( modsOid ) )
         {
-            Index idx = getUserIndex( mods.getID() );
+            Index idx = getUserIndex( modsOid );
             idx.drop( mods, id );
 
             /* 
@@ -1037,10 +1098,11 @@
              */
             if ( null == idx.reverseLookup( id ) )
             {
-                existanceIdx.drop( mods.getID(), id );
+                existanceIdx.drop( modsOid, id );
             }
         }
 
+        AttributeType attrType = attrRegistry.lookup( modsOid );
         /*
          * If there are no attribute values in the modifications then this 
          * implies the compelete removal of the attribute from the entry. Else
@@ -1049,11 +1111,11 @@
          */
         if ( mods.size() == 0 )
         {
-            entry.remove( mods.getID() );
+            ServerUtils.removeAttribute( attrType, entry );
         }
         else
         {
-            Attribute entryAttr = entry.get( mods.getID() );
+            Attribute entryAttr = ServerUtils.getAttribute( attrType, entry );
             NamingEnumeration values = mods.getAll();
             while ( values.hasMore() )
             {
@@ -1068,7 +1130,7 @@
         }
 
         // Aliases->single valued comp/partial attr removal is not relevant here
-        if ( mods.getID().equals( DirectoryPartition.ALIAS_ATTRIBUTE ) )
+        if ( modsOid.equals( oidRegistry.getOid( DirectoryPartition.ALIAS_ATTRIBUTE ) ) )
         {
             dropAliasIndices( id );
         }
@@ -1089,9 +1151,11 @@
      */
     private void replace( BigInteger id, Attributes entry, Attribute mods ) throws NamingException
     {
-        if ( hasUserIndexOn( mods.getID() ) )
+        String modsOid = oidRegistry.getOid( mods.getID() );
+        
+        if ( hasUserIndexOn( modsOid ) )
         {
-            Index idx = getUserIndex( mods.getID() );
+            Index idx = getUserIndex( modsOid );
 
             // Drop all existing attribute value index entries and add new ones
             idx.drop( id );
@@ -1103,11 +1167,12 @@
              */
             if ( null == idx.reverseLookup( id ) )
             {
-                existanceIdx.drop( mods.getID(), id );
+                existanceIdx.drop( modsOid, id );
             }
         }
 
-        if ( mods.getID().equals( DirectoryPartition.ALIAS_ATTRIBUTE ) )
+        String aliasAttributeOid = oidRegistry.getOid( DirectoryPartition.ALIAS_ATTRIBUTE );
+        if ( modsOid.equals( aliasAttributeOid ) )
         {
             dropAliasIndices( id );
         }
@@ -1115,15 +1180,15 @@
         // Automatically replaces old attributes with new modified ones
         entry.put( mods );
 
-        if ( mods.getID().equals( DirectoryPartition.ALIAS_ATTRIBUTE ) )
+        if ( modsOid.equals( aliasAttributeOid ) )
         {
             String ndnStr = ( String ) ndnIdx.reverseLookup( id );
-            addAliasIndices( id, new LdapName( ndnStr ), ( String ) mods.get() );
+            addAliasIndices( id, new LdapDN( ndnStr ), ( String ) mods.get() );
         }
     }
 
 
-    public void modify( Name dn, int modOp, Attributes mods ) throws NamingException
+    public void modify( LdapDN dn, int modOp, Attributes mods ) throws NamingException
     {
         NamingEnumeration attrs = null;
         BigInteger id = getEntryId( dn.toString() );
@@ -1172,7 +1237,7 @@
     }
 
 
-    public void modify( Name dn, ModificationItem[] mods ) throws NamingException
+    public void modify( LdapDN dn, ModificationItem[] mods ) throws NamingException
     {
         BigInteger id = getEntryId( dn.toString() );
         Attributes entry = master.get( id );
@@ -1215,16 +1280,16 @@
      * @param dn the normalized distinguished name of the entry to alter
      * @param newRdn the new Rdn to set
      * @param deleteOldRdn whether or not to remove the old Rdn attr/val
-     * @throws NamingException if there are any errors propagating the name 
+     * @throws NamingException if there are any errors propagating the name
      *        changes.
      */
-    public void modifyRn( Name dn, String newRdn, boolean deleteOldRdn ) throws NamingException
+    public void modifyRn( LdapDN dn, String newRdn, boolean deleteOldRdn ) throws NamingException
     {
         String newRdnAttr = NamespaceTools.getRdnAttribute( newRdn );
         String newRdnValue = NamespaceTools.getRdnValue( newRdn );
         BigInteger id = getEntryId( dn.toString() );
         Attributes entry = lookup( id );
-        Name updn = new LdapName( getEntryUpdn( id ) );
+        LdapDN updn = new LdapDN( getEntryUpdn( id ) );
 
         /* 
          * H A N D L E   N E W   R D N
@@ -1235,7 +1300,9 @@
          * new Rdn attribute within this entry.
          */
 
-        Attribute rdnAttr = entry.get( newRdnAttr );
+        String newRdnAttrOid = oidRegistry.getOid( newRdnAttr );
+        AttributeType newRdnAttrType = attrRegistry.lookup( newRdnAttrOid );
+        Attribute rdnAttr = ServerUtils.getAttribute( newRdnAttrType, entry );
         if ( rdnAttr == null )
         {
             rdnAttr = new LockableAttributeImpl( newRdnAttr );
@@ -1249,15 +1316,15 @@
 
         entry.put( rdnAttr );
 
-        if ( hasUserIndexOn( newRdnAttr ) )
+        if ( hasUserIndexOn( newRdnAttrOid ) )
         {
-            Index idx = getUserIndex( newRdnAttr );
+            Index idx = getUserIndex( newRdnAttrOid );
             idx.add( newRdnValue, id );
 
             // Make sure the altered entry shows the existance of the new attrib
-            if ( !existanceIdx.hasValue( newRdnAttr.toLowerCase(), id ) )
+            if ( !existanceIdx.hasValue( newRdnAttrOid, id ) )
             {
-                existanceIdx.add( newRdnAttr.toLowerCase(), id );
+                existanceIdx.add( newRdnAttrOid, id );
             }
         }
 
@@ -1279,13 +1346,15 @@
         {
             String oldRdn = updn.get( updn.size() - 1 );
             String oldRdnAttr = NamespaceTools.getRdnAttribute( oldRdn );
+            String oldRdnAttrOid = oidRegistry.getOid( oldRdnAttr );
             String oldRdnValue = NamespaceTools.getRdnValue( oldRdn );
+            AttributeType oldRdnAttrType = attrRegistry.lookup( oldRdnAttrOid );
+            
+            ServerUtils.getAttribute( oldRdnAttrType, entry ).remove( oldRdnValue );
 
-            entry.get( oldRdnAttr ).remove( oldRdnValue );
-
-            if ( hasUserIndexOn( oldRdnAttr ) )
+            if ( hasUserIndexOn( oldRdnAttrOid ) )
             {
-                Index idx = getUserIndex( oldRdnAttr );
+                Index idx = getUserIndex( oldRdnAttrOid );
                 idx.drop( oldRdnValue, id );
 
                 /*
@@ -1294,7 +1363,7 @@
                  */
                 if ( null == idx.reverseLookup( id ) )
                 {
-                    existanceIdx.drop( oldRdnAttr, id );
+                    existanceIdx.drop( oldRdnAttrOid, id );
                 }
             }
         }
@@ -1310,7 +1379,7 @@
          *    entry and its descendants
          */
 
-        Name newUpdn = ( Name ) updn.clone(); // copy da old updn
+        LdapDN newUpdn = ( LdapDN ) updn.clone(); // copy da old updn
         newUpdn.remove( newUpdn.size() - 1 ); // remove old upRdn
         newUpdn.add( newUpdn.size(), newRdn ); // add da new upRdn
         modifyDn( id, newUpdn, false ); // propagate dn changes
@@ -1334,16 +1403,18 @@
      * which affects alias indices.
      * @throws NamingException if something goes wrong
      */
-    private void modifyDn( BigInteger id, Name updn, boolean isMove ) throws NamingException
+    private void modifyDn( BigInteger id, LdapDN updn, boolean isMove ) throws NamingException
     {
         String aliasTarget = null;
 
         // Now we can handle the appropriate name indices for all cases
         ndnIdx.drop( id );
-        ndnIdx.add( ndnIdx.getNormalized( updn.toString() ), id );
+        
+        LdapDN normalizedDn = LdapDN.normalize( updn );
+        ndnIdx.add( ndnIdx.getNormalized( normalizedDn.toNormName() ), id );
 
         updnIdx.drop( id );
-        updnIdx.add( updn.toString(), id );
+        updnIdx.add( updn.toUpName(), id );
 
         /* 
          * Read Alias Index Tuples
@@ -1361,7 +1432,7 @@
 
             if ( null != aliasTarget )
             {
-                addAliasIndices( id, new LdapName( getEntryDn( id ) ), aliasTarget );
+                addAliasIndices( id, new LdapDN( getEntryDn( id ) ), aliasTarget );
             }
         }
 
@@ -1376,9 +1447,9 @@
              * Calculate the Dn for the child's new name by copying the parents
              * new name and adding the child's old upRdn to new name as its Rdn
              */
-            Name childUpdn = ( Name ) updn.clone();
-            Name oldUpdn = new LdapName( getEntryUpdn( childId ) );
-            String rdn = LdapName.getRdn( oldUpdn );
+            LdapDN childUpdn = ( LdapDN ) updn.clone();
+            LdapDN oldUpdn = new LdapDN( getEntryUpdn( childId ) );
+            String rdn = oldUpdn.get( oldUpdn.size() - 1 );
             childUpdn.add( childUpdn.size(), rdn );
 
             // Recursively change the names of the children below
@@ -1387,7 +1458,7 @@
     }
 
 
-    public void move( Name oldChildDn, Name newParentDn, String newRdn, boolean deleteOldRdn ) throws NamingException
+    public void move( LdapDN oldChildDn, LdapDN newParentDn, String newRdn, boolean deleteOldRdn ) throws NamingException
     {
         BigInteger childId = getEntryId( oldChildDn.toString() );
         modifyRn( oldChildDn, newRdn, deleteOldRdn );
@@ -1395,7 +1466,7 @@
     }
 
 
-    public void move( Name oldChildDn, Name newParentDn ) throws NamingException
+    public void move( LdapDN oldChildDn, LdapDN newParentDn ) throws NamingException
     {
         BigInteger childId = getEntryId( oldChildDn.toString() );
         move( oldChildDn, childId, newParentDn );
@@ -1415,7 +1486,7 @@
      * @param newParentDn the normalized dn of the new parent for the child
      * @throws NamingException if something goes wrong
      */
-    private void move( Name oldChildDn, BigInteger childId, Name newParentDn ) throws NamingException
+    private void move( LdapDN oldChildDn, BigInteger childId, LdapDN newParentDn ) throws NamingException
     {
         // Get the child and the new parent to be entries and Ids
         BigInteger newParentId = getEntryId( newParentDn.toString() );
@@ -1443,9 +1514,9 @@
          * user provided RDN & the new parent's UPDN.  Basically add the child's
          * UpRdn String to the tail of the new parent's Updn Name.
          */
-        Name childUpdn = new LdapName( getEntryUpdn( childId ) );
+        LdapDN childUpdn = new LdapDN( getEntryUpdn( childId ) );
         String childRdn = childUpdn.get( childUpdn.size() - 1 );
-        Name newUpdn = new LdapName( getEntryUpdn( newParentId ) );
+        LdapDN newUpdn = new LdapDN( getEntryUpdn( newParentId ) );
         newUpdn.add( newUpdn.size(), childRdn );
 
         // Call the modifyDn operation with the new updn
@@ -1461,7 +1532,7 @@
      * @param movedBase the base at which the move occured - the moved node
      * @throws NamingException if system indices fail
      */
-    private void dropMovedAliasIndices( final Name movedBase ) throws NamingException
+    private void dropMovedAliasIndices( final LdapDN movedBase ) throws NamingException
     {
         // Find all the aliases from movedBase down
         IndexAssertion isBaseDescendant = new IndexAssertion()
@@ -1502,7 +1573,7 @@
      * @param movedBase the base where the move occured
      * @throws NamingException if indices fail
      */
-    private void dropAliasIndices( BigInteger aliasId, Name movedBase ) throws NamingException
+    private void dropAliasIndices( BigInteger aliasId, LdapDN movedBase ) throws NamingException
     {
         String targetDn = ( String ) aliasIdx.reverseLookup( aliasId );
         BigInteger targetId = getEntryId( targetDn );
@@ -1512,7 +1583,7 @@
          * Start droping index tuples with the first ancestor right above the 
          * moved base.  This is the first ancestor effected by the move.
          */
-        Name ancestorDn = movedBase.getPrefix( 1 );
+        LdapDN ancestorDn = ( LdapDN ) movedBase.getPrefix( 1 );
         BigInteger ancestorId = getEntryId( ancestorDn.toString() );
 
         /*
@@ -1536,7 +1607,7 @@
 
         while ( !ancestorDn.equals( upSuffix ) )
         {
-            ancestorDn = ancestorDn.getPrefix( 1 );
+            ancestorDn = ( LdapDN ) ancestorDn.getPrefix( 1 );
             ancestorId = getEntryId( ancestorDn.toString() );
 
             subAliasIdx.drop( ancestorId, targetId );
@@ -1544,7 +1615,7 @@
     }
 
 
-    public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
+    public void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
     {
         // does nothing
         throw new LdapAuthenticationNotSupportedException(
@@ -1554,7 +1625,7 @@
     }
 
 
-    public void unbind( Name bindDn ) throws NamingException
+    public void unbind( LdapDN bindDn ) throws NamingException
     {
         // does nothing
     }

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java Tue Jun 13 18:36:40 2006
@@ -32,6 +32,7 @@
 import jdbm.recman.BaseRecordManager;
 import jdbm.recman.CacheRecordManager;
 
+import org.apache.directory.server.core.ServerUtils;
 import org.apache.directory.server.core.partition.impl.btree.Index;
 import org.apache.directory.server.core.partition.impl.btree.IndexComparator;
 import org.apache.directory.server.core.partition.impl.btree.IndexEnumeration;
@@ -40,7 +41,7 @@
 import org.apache.directory.shared.ldap.util.SynchronizedLRUMap;
 
 
-/**
+/** 
  * A Jdbm based index implementation.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -81,7 +82,7 @@
      * @param recMan the record manager
      * @throws NamingException if we fail to create B+Trees using recMan
      */
-    public JdbmIndex(AttributeType attribute, RecordManager recMan) throws NamingException
+    public JdbmIndex( AttributeType attribute, RecordManager recMan ) throws NamingException
     {
         this.attribute = attribute;
         keyCache = new SynchronizedLRUMap( 1000 );
@@ -90,7 +91,7 @@
     }
 
 
-    public JdbmIndex(AttributeType attribute, File wkDirPath) throws NamingException
+    public JdbmIndex( AttributeType attribute, File wkDirPath ) throws NamingException
     {
         File file = new File( wkDirPath.getPath() + File.separator + attribute.getName() );
         this.attribute = attribute;
@@ -245,7 +246,7 @@
      */
     public synchronized void add( Attributes attrs, BigInteger id ) throws NamingException
     {
-        add( attrs.get( attribute.getName() ), id );
+        add( ServerUtils.getAttribute( attribute, attrs ), id );
     }
 
 
@@ -309,7 +310,7 @@
      */
     public void drop( Attributes attrs, BigInteger id ) throws NamingException
     {
-        drop( attrs.get( attribute.getName() ), id );
+        drop( ServerUtils.getAttribute( attribute, attrs ), id );
     }
 
 

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java Tue Jun 13 18:36:40 2006
@@ -40,6 +40,7 @@
 import org.apache.directory.server.core.partition.impl.btree.TupleEnumeration;
 import org.apache.directory.server.core.partition.impl.btree.TupleRenderer;
 import org.apache.directory.server.core.schema.SerializableComparator;
+
 import org.apache.directory.shared.ldap.util.EmptyEnumeration;
 import org.apache.directory.shared.ldap.util.SingletonEnumeration;
 

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java Tue Jun 13 18:36:40 2006
@@ -16,11 +16,11 @@
  */
 package org.apache.directory.server.core.prefs;
 
-
+ 
 import javax.naming.Name;
 import javax.naming.NamingException;
 
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -45,7 +45,7 @@
      */
     public static Name toSysDn( String absPrefPath ) throws NamingException
     {
-        LdapName dn = new LdapName( SYSPREF_BASE );
+        LdapDN dn = new LdapDN( SYSPREF_BASE );
 
         String[] comps = absPrefPath.split( "/" );
 

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java Tue Jun 13 18:36:40 2006
@@ -41,6 +41,7 @@
 import org.apache.directory.server.core.configuration.MutableStartupConfiguration;
 import org.apache.directory.server.core.configuration.ShutdownConfiguration;
 import org.apache.directory.server.core.jndi.CoreContextFactory;
+
 import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
 import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
 import org.apache.directory.shared.ldap.util.PreferencesDictionary;

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/referral/ReferralLut.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/referral/ReferralLut.java?rev=414018&r1=414017&r2=414018&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/referral/ReferralLut.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/referral/ReferralLut.java Tue Jun 13 18:36:40 2006
@@ -21,9 +21,8 @@
 import java.util.Set;
 
 import javax.naming.InvalidNameException;
-import javax.naming.Name;
 
-import org.apache.directory.shared.ldap.name.LdapName;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -51,7 +50,7 @@
      * 
      * @param dn the normalized name of the referral
      */
-    public boolean isReferral( Name dn )
+    public boolean isReferral( LdapDN dn )
     {
         if ( dn == null )
             throw new IllegalArgumentException( "dn cannot be null" );
@@ -79,11 +78,11 @@
      * @param dn the name to get the farthest ancestor referral name for
      * @return the farthest referral ancestor
      */
-    public Name getFarthestReferralAncestor( Name dn )
+    public LdapDN getFarthestReferralAncestor( LdapDN dn )
     {
         if ( dn == null )
             throw new IllegalArgumentException( "dn cannot be null" );
-        Name farthest = new LdapName();
+        LdapDN farthest = new LdapDN();
         for ( int ii = 0; ii < dn.size(); ii++ )
         {
             try
@@ -111,11 +110,11 @@
      * @param dn the name to get the nearest ancestor referral name for
      * @return the nearest referral ancestor or null if one does not exist
      */
-    public Name getNearestReferralAncestor( Name dn )
+    public LdapDN getNearestReferralAncestor( LdapDN dn )
     {
         if ( dn == null )
             throw new IllegalArgumentException( "dn cannot be null" );
-        Name cloned = ( Name ) dn.clone();
+        LdapDN cloned = ( LdapDN ) dn.clone();
 
         // do not return the argument dn if it is a referral (skip it)
         if ( cloned.size() > 0 )
@@ -158,7 +157,7 @@
      * 
      * @param dn the normalized name of the added referral
      */
-    public void referralAdded( Name dn )
+    public void referralAdded( LdapDN dn )
     {
         if ( dn == null )
             throw new IllegalArgumentException( "dn cannot be null" );
@@ -190,7 +189,7 @@
      * 
      * @param dn the normalized name of the deleted referral
      */
-    public void referralDeleted( Name dn )
+    public void referralDeleted( LdapDN dn )
     {
         if ( dn == null )
             throw new IllegalArgumentException( "dn cannot be null" );
@@ -224,7 +223,7 @@
      * @param oldDn the normalized old name for the referral
      * @param newDn the normalized new name for the referral
      */
-    public void referralChanged( Name oldDn, Name newDn )
+    public void referralChanged( LdapDN oldDn, LdapDN newDn )
     {
         if ( oldDn == null || newDn == null )
             throw new IllegalArgumentException( "old or new dn cannot be null" );
@@ -268,7 +267,7 @@
      * @param oldDn the normalized old name for the referral
      * @param newDn the normalized new name for the referral
      */
-    public void referralChanged( Name oldDn, String newDn )
+    public void referralChanged( LdapDN oldDn, String newDn )
     {
         if ( oldDn == null || newDn == null )
             throw new IllegalArgumentException( "old or new dn cannot be null" );
@@ -290,7 +289,7 @@
      * @param oldDn the normalized old name for the referral
      * @param newDn the normalized new name for the referral
      */
-    public void referralChanged( String oldDn, Name newDn )
+    public void referralChanged( String oldDn, LdapDN newDn )
     {
         if ( oldDn == null || newDn == null )
             throw new IllegalArgumentException( "old or new dn cannot be null" );



Mime
View raw message