directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r165308 - in /directory/apacheds/trunk: core/src/main/java/org/apache/ldap/server/jndi/ core/src/main/java/org/apache/ldap/server/prefs/ core/src/test/org/apache/ldap/server/jndi/ main/src/main/java/org/apache/ldap/server/jndi/ main/src/test/org/apache/ldap/server/jndi/
Date Fri, 29 Apr 2005 14:01:24 GMT
Author: akarasulu
Date: Fri Apr 29 07:01:23 2005
New Revision: 165308

URL: http://svn.apache.org/viewcvs?rev=165308&view=rev
Log:
changes ...

 o moved server context factory ICF impl to main project to relieve deps on core
 o removed need for initial load of LDIF file altogether
 o moved SCF tests to main

Note: there really is not much now to SCF.  It's there out of convenience now
and most of what it does can be handled by a main.  However we're leaving it 
in place out of convenience for those that want to be able to start up the
server using JNDI and have all the wire protocols included.


Added:
    directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/
    directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
      - copied, changed from r165307, directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
    directory/apacheds/trunk/main/src/test/org/apache/ldap/server/jndi/
    directory/apacheds/trunk/main/src/test/org/apache/ldap/server/jndi/ServerContextFactoryTest.java
      - copied unchanged from r165307, directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ServerContextFactoryTest.java
Removed:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/system.ldif
    directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ServerContextFactoryTest.java
Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java?rev=165308&r1=165307&r2=165308&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java
Fri Apr 29 07:01:23 2005
@@ -21,7 +21,7 @@
 import org.apache.ldap.common.message.LockableAttributeImpl;
 import org.apache.ldap.common.message.LockableAttributesImpl;
 import org.apache.ldap.common.util.PreferencesDictionary;
-import org.apache.ldap.server.jndi.ServerContextFactory;
+import org.apache.ldap.server.jndi.CoreContextFactory;
 
 import javax.naming.Context;
 import javax.naming.NameClassPair;
@@ -72,7 +72,7 @@
 
         Hashtable env = new Hashtable();
 
-        env.put( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
 
         env.put( Context.PROVIDER_URL, PreferencesUtils.SYSPREF_BASE );
 

Copied: directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
(from r165307, directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java)
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java?p2=directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java&p1=directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java&r1=165307&r2=165308&rev=165308&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
(original)
+++ directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
Fri Apr 29 07:01:23 2005
@@ -135,11 +135,6 @@
             startUpWireProtocol();
         }
 
-        if ( createMode )
-        {
-            importLdif();
-        }
-
         return ctx;
     }
 
@@ -190,60 +185,6 @@
             lce.setRootCause( e );
 
             throw lce;
-        }
-    }
-
-
-    /**
-     * Imports the LDIF entries packaged with the Eve JNDI provider jar into the newly created
system partition to prime
-     * it up for operation.  Note that only ou=system entries will be added - entries for
other partitions cannot be
-     * imported and will blow chunks.
-     *
-     * @throws javax.naming.NamingException if there are problems reading the ldif file and
adding those entries to the system
-     *                         partition
-     */
-    protected void importLdif() throws NamingException
-    {
-        Hashtable env = new Hashtable();
-
-        env.putAll( initialEnv );
-
-        env.put( Context.PROVIDER_URL, "ou=system" );
-
-        LdapContext ctx = provider.getLdapContext( env );
-
-        InputStream in = getClass().getResourceAsStream( "system.ldif" );
-
-        LdifParser parser = new LdifParserImpl();
-
-        try
-        {
-            LdifIterator iterator = new LdifIterator( in );
-
-            while ( iterator.hasNext() )
-            {
-                Attributes attributes = new LockableAttributesImpl();
-
-                String ldif = ( String ) iterator.next();
-
-                parser.parse( attributes, ldif );
-
-                Name dn = new LdapName( ( String ) attributes.remove( "dn" ).get() );
-
-                dn.remove( 0 );
-
-                ctx.createSubcontext( dn, attributes );
-            }
-        }
-        catch ( Exception e )
-        {
-            String msg = "failed while trying to parse system ldif file";
-
-            NamingException ne = new LdapConfigurationException( msg );
-
-            ne.setRootCause( e );
-
-            throw ne;
         }
     }
 }



Mime
View raw message