directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1022192 - /directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Date Wed, 13 Oct 2010 17:07:35 GMT
Author: kayyagari
Date: Wed Oct 13 17:07:32 2010
New Revision: 1022192

URL: http://svn.apache.org/viewvc?rev=1022192&view=rev
Log:
o overloaded the loadSchema() to take a SchemaLoader object

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=1022192&r1=1022191&r2=1022192&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
Wed Oct 13 17:07:32 2010
@@ -134,6 +134,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.schema.registries.SchemaLoader;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.mina.core.filterchain.IoFilter;
 import org.apache.mina.core.future.CloseFuture;
@@ -3125,8 +3126,31 @@ public class LdapNetworkConnection exten
         try
         {
             JarLdifSchemaLoader jarSchemaLoader = new JarLdifSchemaLoader();
-
-            schemaManager = new DefaultSchemaManager( jarSchemaLoader );
+            loadSchema( jarSchemaLoader );
+        }
+        catch( LdapException e )
+        {
+            throw e;
+        }
+        catch( Exception e )
+        {
+            LOG.error( "failed to load the schema using JarLdifSchemaLoader", e );
+            throw new LdapException( e );
+        }
+    }
+    
+    
+    /**
+     * loads schema using the specified schema loader
+     * 
+     * @param loader the {@link SchemaLoader} to be used to load schema
+     * @throws LdapException 
+     */
+    public void loadSchema( SchemaLoader loader ) throws LdapException
+    {
+        try
+        {
+            schemaManager = new DefaultSchemaManager( loader );
 
             // we enable all the schemas so that need not check with server for enabled schemas
             Collection<Schema> schemas = schemaManager.getLoader().getAllSchemas();



Mime
View raw message