directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1579889 - /directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Date Fri, 21 Mar 2014 06:31:34 GMT
Author: elecharny
Date: Fri Mar 21 06:31:33 2014
New Revision: 1579889

URL: http://svn.apache.org/r1579889
Log:
Applied patch for DIRAPI-156

Modified:
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1579889&r1=1579888&r2=1579889&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Fri Mar 21 06:31:33 2014
@@ -135,6 +135,7 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.schema.parsers.OpenLdapSchemaParser;
 import org.apache.directory.api.ldap.model.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.api.ldap.model.schema.registries.ObjectClassRegistry;
+import org.apache.directory.api.ldap.model.schema.registries.Registries;
 import org.apache.directory.api.ldap.model.schema.registries.SchemaLoader;
 import org.apache.directory.api.ldap.schemamanager.impl.DefaultSchemaManager;
 import org.apache.directory.api.util.StringConstants;
@@ -3463,21 +3464,19 @@ public class LdapNetworkConnection exten
             olsp.setQuirksMode( true );
             olsp.parse( schemaFile );
 
-            List<MutableAttributeType> atList = olsp.getAttributeTypes();
-            AttributeTypeRegistry atRegistry = schemaManager.getRegistries().getAttributeTypeRegistry();
-
-            for ( AttributeType atType : atList )
+            Registries registries = schemaManager.getRegistries();
+            List<Throwable> errors = new ArrayList<Throwable>();
+            
+            for ( AttributeType atType : olsp.getAttributeTypes() )
             {
-                atRegistry.addMappingFor( atType );
-                atRegistry.register( atType );
+                registries.buildReference( errors, atType );
+                registries.getAttributeTypeRegistry().register(atType);
             }
 
-            List<ObjectClass> ocList = olsp.getObjectClassTypes();
-            ObjectClassRegistry ocRegistry = schemaManager.getRegistries().getObjectClassRegistry();
-
-            for ( ObjectClass oc : ocList )
+            for ( ObjectClass oc : olsp.getObjectClassTypes() )
             {
-                ocRegistry.register( oc );
+                registries.buildReference(errors, oc);
+                registries.getObjectClassRegistry().register( oc );
             }
 
             LOG.info( "successfully loaded the schema from file {}", schemaFile.getAbsolutePath()
);



Mime
View raw message