directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r179848 - /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java
Date Fri, 03 Jun 2005 18:26:39 GMT
Author: akarasulu
Date: Fri Jun  3 11:26:38 2005
New Revision: 179848

URL: http://svn.apache.org/viewcvs?rev=179848&view=rev
Log:
fixed bug where added entry names were not being normalized

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java?rev=179848&r1=179847&r2=179848&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java
Fri Jun  3 11:26:38 2005
@@ -23,6 +23,8 @@
 import org.apache.ldap.common.message.LockableAttributesImpl;
 import org.apache.ldap.common.message.ResultCodeEnum;
 import org.apache.ldap.common.name.LdapName;
+import org.apache.ldap.common.name.DnParser;
+import org.apache.ldap.common.name.NameComponentNormalizer;
 import org.apache.ldap.common.schema.AttributeType;
 import org.apache.ldap.common.schema.Normalizer;
 import org.apache.ldap.common.util.DateUtils;
@@ -33,10 +35,7 @@
 import org.apache.ldap.server.interceptor.InterceptorChain;
 import org.apache.ldap.server.interceptor.InterceptorConfigBuilder;
 import org.apache.ldap.server.interceptor.InterceptorContext;
-import org.apache.ldap.server.schema.AttributeTypeRegistry;
-import org.apache.ldap.server.schema.GlobalRegistries;
-import org.apache.ldap.server.schema.MatchingRuleRegistry;
-import org.apache.ldap.server.schema.OidRegistry;
+import org.apache.ldap.server.schema.*;
 import org.apache.ldap.server.schema.bootstrap.BootstrapRegistries;
 import org.apache.ldap.server.schema.bootstrap.BootstrapSchemaLoader;
 
@@ -236,7 +235,15 @@
 
                         Attribute dn = attributes.remove( "dn" );
 
-                        nexus.add( ( String ) dn.get(), new LdapName( ( String ) dn.get()
), attributes );
+                        AttributeTypeRegistry registry = globalRegistries.getAttributeTypeRegistry();
+
+                        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer(
registry );
+
+                        DnParser parser = new DnParser( ncn );
+
+                        Name ndn = parser.parse( ( String ) dn.get() );
+                        
+                        nexus.add( ( String ) dn.get(), ndn, attributes );
                     }
                 }
             }



Mime
View raw message