directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r413391 - in /directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core: ./ exception/ partition/ schema/ schema/bootstrap/
Date Sun, 11 Jun 2006 00:51:58 GMT
Author: akarasulu
Date: Sat Jun 10 17:51:57 2006
New Revision: 413391

URL: http://svn.apache.org/viewvc?rev=413391&view=rev
Log:
fixed several integration tests by fixing bugs in normalization

Modified:
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalAttributeTypeRegistry.java
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=413391&r1=413390&r2=413391&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Sat Jun 10 17:51:57 2006
@@ -411,7 +411,7 @@
     private boolean createBootstrapEntries() throws NamingException
     {
         boolean firstStart = false;
-
+        
         // -------------------------------------------------------------------
         // create admin entry
         // -------------------------------------------------------------------

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java?rev=413391&r1=413390&r2=413391&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
Sat Jun 10 17:51:57 2006
@@ -90,7 +90,20 @@
         parentDn.remove( normName.size() - 1 );
 
         // check if we're trying to add to a parent that is an alias
-        Attributes attrs = nextInterceptor.lookup( parentDn );
+        Attributes attrs = null;
+        
+        try
+        {
+            attrs = nextInterceptor.lookup( parentDn );
+        }
+        catch ( Exception e )
+        {
+            LdapNameNotFoundException e2 = new LdapNameNotFoundException( "Parent " + parentDn.toUpName()

+                + " not found" );
+            e2.setResolvedName( new LdapDN( nexus.getMatchedName( parentDn ).toUpName() )
);
+            throw e2;
+        }
+        
         Attribute objectClass = attrs.get( "objectClass" );
         if ( objectClass.contains( "alias" ) )
         {
@@ -127,7 +140,7 @@
         if ( hasChildren )
         {
             LdapContextNotEmptyException e = new LdapContextNotEmptyException();
-            e.setResolvedName( name );
+            e.setResolvedName( new LdapDN( name.toUpName() ) );
             throw e;
         }
 

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java?rev=413391&r1=413390&r2=413391&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
Sat Jun 10 17:51:57 2006
@@ -30,7 +30,6 @@
 import java.util.Set;
 
 import javax.naming.ConfigurationException;
-import javax.naming.Name;
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
@@ -782,9 +781,9 @@
      * @return the backend partition associated with the normalized dn
      * @throws NamingException if the name cannot be resolved to a backend
      */
-    private DirectoryPartition getBackend( Name dn ) throws NamingException
+    private DirectoryPartition getBackend( LdapDN dn ) throws NamingException
     {
-        Name clonedDn = ( Name ) dn.clone();
+        LdapDN clonedDn = ( LdapDN ) dn.clone();
         while ( clonedDn.size() > 0 )
         {
             if ( partitions.containsKey( clonedDn.toString() ) )
@@ -794,11 +793,11 @@
 
             clonedDn.remove( clonedDn.size() - 1 );
         }
-        throw new NameNotFoundException( dn.toString() );
+        throw new LdapNameNotFoundException( dn.toUpName() );
     }
 
 
-    public DirectoryPartition getPartition( Name dn ) throws NamingException
+    public DirectoryPartition getPartition( LdapDN dn ) throws NamingException
     {
         return getBackend( dn );
     }

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java?rev=413391&r1=413390&r2=413391&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java
Sat Jun 10 17:51:57 2006
@@ -21,7 +21,6 @@
 import java.util.Set;
 
 import javax.naming.InvalidNameException;
-import javax.naming.Name;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapContext;
@@ -190,7 +189,7 @@
      * @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;
 
 
     /**

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java?rev=413391&r1=413390&r2=413391&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
Sat Jun 10 17:51:57 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;
@@ -142,7 +142,7 @@
     }
 
 
-    public DirectoryPartition getPartition( Name dn ) throws NamingException
+    public DirectoryPartition getPartition( LdapDN dn ) throws NamingException
     {
         return this.configuration.getPartitionNexus().getPartition( dn );
     }

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalAttributeTypeRegistry.java?rev=413391&r1=413390&r2=413391&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalAttributeTypeRegistry.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/GlobalAttributeTypeRegistry.java
Sat Jun 10 17:51:57 2006
@@ -134,6 +134,7 @@
         for ( int jj = 0; jj < aliases.length; jj++ )
         {
             mapping.put( aliases[jj], oidNormalizer );
+            mapping.put( aliases[jj].toLowerCase(), oidNormalizer );
         }
     }
 
@@ -220,6 +221,7 @@
                 for ( int jj = 0; jj < aliases.length; jj++ )
                 {
                     mapping.put( aliases[jj], oidNormalizer );
+                    mapping.put( aliases[jj].toLowerCase(), oidNormalizer );
                 }
             }
         }

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java?rev=413391&r1=413390&r2=413391&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapAttributeTypeRegistry.java
Sat Jun 10 17:51:57 2006
@@ -177,7 +177,7 @@
                 
                 if ( matchingRule == null )
                 {
-                    log.warn( "Attribute " + type.getName() + " does not have normalize :
using NoopNormalizer" );
+                    log.warn( "Attribute " + type.getName() + " does not have normalizer
: using NoopNormalizer" );
                     oidNormalizer = new OidNormalizer( type.getOid(), new NoOpNormalizer()
);
                 }
                 else
@@ -190,6 +190,7 @@
                 for ( int jj = 0; jj < aliases.length; jj++ )
                 {
                     mapping.put( aliases[jj], oidNormalizer );
+                    mapping.put( aliases[jj].toLowerCase(), oidNormalizer );
                 }
             }
         }



Mime
View raw message