directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1243572 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/ apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/ apacheds/trunk/ldap-client-test/src/test/java/org/ap...
Date Mon, 13 Feb 2012 16:03:42 GMT
Author: elecharny
Date: Mon Feb 13 16:03:41 2012
New Revision: 1243572

URL: http://svn.apache.org/viewvc?rev=1243572&view=rev
Log:
o Removed the LdapConnection.loadDefaultSchema() method

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/ClientSearchRequestTest.java
    directory/apacheds/trunk/service/src/test/java/org/apache/directory/server/UberJarMainTest.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java?rev=1243572&r1=1243571&r2=1243572&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
Mon Feb 13 16:03:41 2012
@@ -471,7 +471,7 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    public void loadDefaultSchema() throws LdapException
+    public void loadSchema() throws LdapException
     {
         // do nothing, cause we already have SchemaManager in the session's DirectoryService
     }

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java?rev=1243572&r1=1243571&r2=1243572&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
Mon Feb 13 16:03:41 2012
@@ -201,11 +201,11 @@ public class LdapConnectionTest extends 
     @Test
     public void testLoadSchema() throws Exception
     {
-        connection.loadDefaultSchema();
+        connection.loadSchema();
         SchemaManager manager = connection.getSchemaManager();
         assertNotNull( manager );
         assertTrue( manager.isEnabled( "system" ) );
-        assertTrue( manager.isEnabled( "nis" ) );
+        assertFalse( manager.isEnabled( "nis" ) );
         assertEquals( manager.getLoader().getAllSchemas().size(), manager.getEnabled().size()
);
     }
 

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/ClientSearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/ClientSearchRequestTest.java?rev=1243572&r1=1243571&r2=1243572&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/ClientSearchRequestTest.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/ClientSearchRequestTest.java
Mon Feb 13 16:03:41 2012
@@ -299,7 +299,7 @@ public class ClientSearchRequestTest ext
     @Test
     public void testSearchBinary() throws Exception
     {
-        connection.loadDefaultSchema();
+        connection.loadSchema();
         EntryCursor cursor = connection.search( "ou=system", "(publicKey=\\30\\5C\\30\\0D\\06\\09\\2A\\86\\48\\86\\F7\\0D\\01\\01\\01\\05\\00\\03\\4B\\00\\30\\48\\02\\41\\00\\A6\\C7\\9C\\B1\\6C\\E4\\DD\\8F\\1E\\4D\\20\\93\\22\\3F\\83\\75\\DE\\21\\D8\\F1\\9D\\63\\80\\5B\\94\\55\\6A\\9E\\33\\59\\9B\\8D\\63\\88\\0D\\18\\7D\\4C\\85\\F1\\CF\\54\\77\\32\\E9\\61\\0C\\A2\\8F\\B3\\6B\\15\\34\\5E\\1F\\88\\BF\\A0\\73\\AC\\86\\BB\\D0\\85\\02\\03\\01\\00\\01)",
SearchScope.SUBTREE, "publicKey" );
         
         assertTrue( cursor.next() );

Modified: directory/apacheds/trunk/service/src/test/java/org/apache/directory/server/UberJarMainTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/src/test/java/org/apache/directory/server/UberJarMainTest.java?rev=1243572&r1=1243571&r2=1243572&view=diff
==============================================================================
--- directory/apacheds/trunk/service/src/test/java/org/apache/directory/server/UberJarMainTest.java
(original)
+++ directory/apacheds/trunk/service/src/test/java/org/apache/directory/server/UberJarMainTest.java
Mon Feb 13 16:03:41 2012
@@ -83,7 +83,7 @@ public class UberJarMainTest
                     configuration.setCredentials( PartitionNexus.ADMIN_PASSWORD_STRING );
                     configuration.setBinaryAttributeDetector( new SchemaBinaryAttributeDetector(
null ) );
                     LdapNetworkConnection connection = new LdapNetworkConnection( configuration
);
-                    connection.loadDefaultSchema();
+                    connection.loadSchema();
 
                     // Binding on the connection
                     connection.bind();

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java?rev=1243572&r1=1243571&r2=1243572&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
Mon Feb 13 16:03:41 2012
@@ -789,7 +789,7 @@ public interface LdapConnection
      * <b>Note:</b> This method enables <b>all</b> schemas prior
to loading
      * @throws LdapException in case of problems while loading the schema
      */
-    void loadDefaultSchema() throws LdapException;
+    void loadSchema() throws LdapException;
 
 
     /**

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=1243572&r1=1243571&r2=1243572&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
Mon Feb 13 16:03:41 2012
@@ -30,7 +30,6 @@ import java.net.SocketAddress;
 import java.nio.channels.UnresolvedAddressException;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -144,9 +143,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.parsers.OpenLdapSchemaParser;
 import org.apache.directory.shared.ldap.model.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.model.schema.registries.ObjectClassRegistry;
-import org.apache.directory.shared.ldap.model.schema.registries.Schema;
 import org.apache.directory.shared.ldap.model.schema.registries.SchemaLoader;
-import org.apache.directory.shared.ldap.schemaloader.JarLdifSchemaLoader;
 import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
 import org.apache.directory.shared.util.StringConstants;
 import org.apache.directory.shared.util.Strings;
@@ -3367,75 +3364,6 @@ public class LdapNetworkConnection exten
     {
         loadSchema( new DefaultSchemaLoader( this ) );
     }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void loadDefaultSchema() throws LdapException
-    {
-        if ( !isConnected() )
-        {
-            try
-            {
-                connect();
-            }
-            catch ( IOException ioe )
-            {
-                throw new InvalidConnectionException( "Cannot connect on the server" );
-            }
-        }
-        
-        try
-        {
-            JarLdifSchemaLoader jarSchemaLoader = new JarLdifSchemaLoader();
-
-            // we enable all the schemas so that need not check with server for enabled schemas
-            Collection<Schema> schemas = jarSchemaLoader.getAllSchemas();
-            
-            for ( Schema s : schemas )
-            {
-                s.enable();
-            }
-
-            loadSchema( jarSchemaLoader );
-            
-            // Update the BinaryAttributeDetector
-            BinaryAttributeDetector binaryAttributeDetector = getBinaryAttributeDetector();
-            
-            if ( binaryAttributeDetector == null )
-            {
-                // We don't have any BAD : create a SchemaBad
-                binaryAttributeDetector = new SchemaBinaryAttributeDetector( schemaManager
);
-            }
-            else
-            {
-                if ( binaryAttributeDetector instanceof SchemaBinaryAttributeDetector )
-                {
-                    // Inject the Schema in the existing SchemaBAD (it may replace a previous
one)
-                    ((SchemaBinaryAttributeDetector)binaryAttributeDetector).setSchemaManager(
schemaManager );
-                }
-                else
-                {
-                    // Replace the old BAD by a SchemaBAD
-                    binaryAttributeDetector = new SchemaBinaryAttributeDetector( schemaManager
);
-                }
-            }
-            
-            setBinaryAttributeDetector( binaryAttributeDetector );
-        }
-        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
      *
@@ -3490,7 +3418,7 @@ public class LdapNetworkConnection exten
         {
             if ( schemaManager == null )
             {
-                loadDefaultSchema();
+                loadSchema();
             }
 
             OpenLdapSchemaParser olsp = new OpenLdapSchemaParser();



Mime
View raw message