directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r613608 [4/15] - in /directory/sandbox/akarasulu/bigbang/apacheds: ./ bootstrap-plugin/ bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/ core-entry/ core-entry/src/main/java/org/apache/directory/server/core/...
Date Sun, 20 Jan 2008 16:59:36 GMT
Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java Sun Jan 20 08:59:10 2008
@@ -35,8 +35,16 @@
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.*;
-import static org.junit.Assert.*;
+import org.apache.directory.shared.ldap.schema.DeepTrimNormalizer;
+import org.apache.directory.shared.ldap.schema.MatchingRule;
+import org.apache.directory.shared.ldap.schema.NoOpNormalizer;
+import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.schema.Syntax;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -120,7 +128,7 @@
         
         assertTrue( getNormalizerRegistry().hasNormalizer( OID ) );
         assertEquals( getNormalizerRegistry().getSchemaName( OID ), "apachemeta" );
-        Class clazz = getNormalizerRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getNormalizerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, NoOpNormalizer.class );
     }
     
@@ -151,7 +159,7 @@
         
         assertTrue( getNormalizerRegistry().hasNormalizer( OID ) );
         assertEquals( getNormalizerRegistry().getSchemaName( OID ), "apachemeta" );
-        Class clazz = getNormalizerRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getNormalizerRegistry().lookup( OID ).getClass();
         assertEquals( clazz.getName(), "DummyNormalizer" );
     }
     
@@ -205,7 +213,7 @@
         }
 
         assertTrue( getNormalizerRegistry().hasNormalizer( NEW_OID ) );
-        Class clazz = getNormalizerRegistry().lookup( NEW_OID ).getClass();
+        Class<?> clazz = getNormalizerRegistry().lookup( NEW_OID ).getClass();
         assertEquals( clazz, NoOpNormalizer.class );
     }
 
@@ -229,7 +237,7 @@
         assertEquals( "normalizer schema should be set to apache not apachemeta", 
             getNormalizerRegistry().getSchemaName( OID ), "apache" );
 
-        Class clazz = getNormalizerRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getNormalizerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, NoOpNormalizer.class );
     }
 
@@ -256,7 +264,7 @@
         assertEquals( "normalizer with new oid should have schema set to apache NOT apachemeta", 
             getNormalizerRegistry().getSchemaName( NEW_OID ), "apache" );
 
-        Class clazz = getNormalizerRegistry().lookup( NEW_OID ).getClass();
+        Class<?> clazz = getNormalizerRegistry().lookup( NEW_OID ).getClass();
         assertEquals( clazz, NoOpNormalizer.class );
     }
 
@@ -280,7 +288,7 @@
         assertEquals( "normalizer schema should be set to apachemeta", 
             getNormalizerRegistry().getSchemaName( OID ), "apachemeta" );
 
-        Class clazz = getNormalizerRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getNormalizerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, DeepTrimNormalizer.class );
     }
 
@@ -303,7 +311,7 @@
         assertEquals( "normalizer schema should be set to apachemeta", 
             getNormalizerRegistry().getSchemaName( OID ), "apachemeta" );
 
-        Class clazz = getNormalizerRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getNormalizerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, DeepTrimNormalizer.class );
     }
     

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java Sun Jan 20 08:59:10 2008
@@ -23,8 +23,6 @@
 import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
-import org.apache.directory.server.core.integ.SetupMode;
-import org.apache.directory.server.core.integ.annotations.Mode;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
 import org.apache.directory.server.schema.registries.ObjectClassRegistry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -37,7 +35,10 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.junit.Test;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingException;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java Sun Jan 20 08:59:10 2008
@@ -33,7 +33,12 @@
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java Sun Jan 20 08:59:10 2008
@@ -38,7 +38,10 @@
 import org.apache.directory.shared.ldap.schema.Syntax;
 import org.apache.directory.shared.ldap.schema.syntax.AcceptAllSyntaxChecker;
 import org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -121,7 +124,7 @@
         
         assertTrue( getSyntaxCheckerRegistry().hasSyntaxChecker( OID ) );
         assertEquals( getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
-        Class clazz = getSyntaxCheckerRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getSyntaxCheckerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, AcceptAllSyntaxChecker.class );
     }
     
@@ -152,7 +155,7 @@
         
         assertTrue( getSyntaxCheckerRegistry().hasSyntaxChecker( OID ) );
         assertEquals( getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
-        Class clazz = getSyntaxCheckerRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getSyntaxCheckerRegistry().lookup( OID ).getClass();
         assertEquals( clazz.getName(), "DummySyntaxChecker" );
     }
     
@@ -206,7 +209,7 @@
         }
 
         assertTrue( getSyntaxCheckerRegistry().hasSyntaxChecker( NEW_OID ) );
-        Class clazz = getSyntaxCheckerRegistry().lookup( NEW_OID ).getClass();
+        Class<?> clazz = getSyntaxCheckerRegistry().lookup( NEW_OID ).getClass();
         assertEquals( clazz, AcceptAllSyntaxChecker.class );
     }
 
@@ -230,7 +233,7 @@
         assertEquals( "syntaxChecker schema should be set to apache not apachemeta", 
             getSyntaxCheckerRegistry().getSchemaName( OID ), "apache" );
 
-        Class clazz = getSyntaxCheckerRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getSyntaxCheckerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, AcceptAllSyntaxChecker.class );
     }
 
@@ -257,7 +260,7 @@
         assertEquals( "syntaxChecker with new oid should have schema set to apache NOT apachemeta", 
             getSyntaxCheckerRegistry().getSchemaName( NEW_OID ), "apache" );
 
-        Class clazz = getSyntaxCheckerRegistry().lookup( NEW_OID ).getClass();
+        Class<?> clazz = getSyntaxCheckerRegistry().lookup( NEW_OID ).getClass();
         assertEquals( clazz, AcceptAllSyntaxChecker.class );
     }
 
@@ -281,7 +284,7 @@
         assertEquals( "syntaxChecker schema should be set to apachemeta", 
             getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
 
-        Class clazz = getSyntaxCheckerRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getSyntaxCheckerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, BogusSyntaxChecker.class );
     }
 
@@ -304,7 +307,7 @@
         assertEquals( "syntaxChecker schema should be set to apachemeta", 
             getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
 
-        Class clazz = getSyntaxCheckerRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getSyntaxCheckerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, BogusSyntaxChecker.class );
     }
     

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java Sun Jan 20 08:59:10 2008
@@ -26,7 +26,6 @@
 import static org.apache.directory.server.core.integ.IntegrationUtils.getRootContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
 import org.apache.directory.server.schema.registries.MatchingRuleRegistry;
-import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.server.schema.registries.SyntaxRegistry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
@@ -38,13 +37,21 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.Syntax;
 import org.apache.directory.shared.ldap.schema.syntax.AcceptAllSyntaxChecker;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+
 import java.util.ArrayList;
 import java.util.List;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java Sun Jan 20 08:59:10 2008
@@ -23,9 +23,7 @@
 import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
-import org.apache.directory.server.core.integ.SetupMode;
-import org.apache.directory.server.core.integ.annotations.Mode;
-import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
+import static org.apache.directory.server.core.integ.IntegrationUtils.*;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaISuite.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaISuite.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaISuite.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaISuite.java Sun Jan 20 08:59:10 2008
@@ -18,9 +18,10 @@
  */
 package org.apache.directory.server.core.schema;
 
+
 import org.apache.directory.server.core.integ.CiSuite;
 import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
+import org.apache.directory.server.core.integ.annotations.*;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaPersistenceIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaPersistenceIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaPersistenceIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaPersistenceIT.java Sun Jan 20 08:59:10 2008
@@ -30,14 +30,23 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription;
 import org.apache.directory.shared.ldap.schema.syntax.parser.AttributeTypeDescriptionSchemaParser;
-import static org.junit.Assert.*;
-import org.junit.Before;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+
 import java.util.ArrayList;
 import java.util.List;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java Sun Jan 20 08:59:10 2008
@@ -30,7 +30,12 @@
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java Sun Jan 20 08:59:10 2008
@@ -22,6 +22,8 @@
 
 import jdbm.helper.IntegerComparator;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.integ.CiRunner;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getRootContext;
@@ -265,7 +267,10 @@
             attrs = getSchemaContext( service ).getAttributes( "m-oid=" + oid + ",ou=syntaxCheckers,cn=" + schemaName );
             assertNotNull( attrs );
             SchemaEntityFactory factory = new SchemaEntityFactory( service.getRegistries() );
-            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( attrs, service.getRegistries() );
+            
+            ServerEntry serverEntry = ServerEntryUtils.toServerEntry( attrs, LdapDN.EMPTY_LDAPDN, service.getRegistries() );
+
+            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( serverEntry, service.getRegistries() );
             assertEquals( oid, syntaxChecker.getSyntaxOid() );
         }
         else
@@ -1394,10 +1399,12 @@
         
         Attributes attrs = getSubschemaSubentryAttributes();
         Attribute attrTypes = attrs.get( "attributeTypes" );
-        AttributeTypeDescription attributeTypeDescription = null; 
+        AttributeTypeDescription attributeTypeDescription = null;
+        
         for ( int ii = 0; ii < attrTypes.size(); ii++ )
         {
             String desc = ( String ) attrTypes.get( ii );
+            
             if ( desc.indexOf( "1.3.6.1.4.1.18060.0.4.0.2.10000" ) != -1 )
             {
                 attributeTypeDescription = ATTRIBUTE_TYPE_DESCRIPTION_SCHEMA_PARSER.parseAttributeTypeDescription( desc );
@@ -1410,7 +1417,10 @@
         attrs = getSchemaContext( service ).getAttributes( "m-oid=1.3.6.1.4.1.18060.0.4.0.2.10000,ou=attributeTypes,cn=nis" );
         assertNotNull( attrs );
         SchemaEntityFactory factory = new SchemaEntityFactory( service.getRegistries() );
-        AttributeType at = factory.getAttributeType( attrs, service.getRegistries(), "nis" );
+        
+        ServerEntry serverEntry = ServerEntryUtils.toServerEntry( attrs, LdapDN.EMPTY_LDAPDN, service.getRegistries() );
+        
+        AttributeType at = factory.getAttributeType( serverEntry, service.getRegistries(), "nis" );
         assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", at.getOid() );
         assertEquals( "name", at.getSuperior().getName() );
         assertEquals( "bogus description", at.getDescription() );
@@ -1444,6 +1454,7 @@
         Attributes attrs = getSubschemaSubentryAttributes();
         Attribute attrTypes = attrs.get( "attributeTypes" );
         AttributeTypeDescription attributeTypeDescription = null; 
+        
         for ( int ii = 0; ii < attrTypes.size(); ii++ )
         {
             String desc = ( String ) attrTypes.get( ii );
@@ -1468,7 +1479,10 @@
                 "m-oid=1.3.6.1.4.1.18060.0.4.0.2.10000,ou=attributeTypes,cn=nis" );
         assertNotNull( attrs );
         SchemaEntityFactory factory = new SchemaEntityFactory( service.getRegistries() );
-        AttributeType at = factory.getAttributeType( attrs, service.getRegistries(), "nis" );
+        
+        ServerEntry serverEntry = ServerEntryUtils.toServerEntry( attrs, LdapDN.EMPTY_LDAPDN, service.getRegistries() );
+
+        AttributeType at = factory.getAttributeType( serverEntry, service.getRegistries(), "nis" );
         assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", at.getOid() );
         assertEquals( "name", at.getSuperior().getName() );
         assertEquals( "bogus description", at.getDescription() );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/sp/LdapClassLoaderIT.java Sun Jan 20 08:59:10 2008
@@ -82,7 +82,7 @@
 
         // load the class
         LdapClassLoader loader = new LdapClassLoader( ( ServerLdapContext ) ( root.lookup( "" ) ) );
-        Class clazz = loader.loadClass( "HelloWorld" );
+        Class<?> clazz = loader.loadClass( "HelloWorld" );
 
         // assert class loaded successfully
         assertEquals( clazz.getName(), "HelloWorld" );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/BadSubentryServiceIT.java Sun Jan 20 08:59:10 2008
@@ -28,13 +28,19 @@
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.HashMap;
 import java.util.Map;
@@ -143,12 +149,14 @@
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         controls.setReturningAttributes( new String[] { "+", "*" } );
-        NamingEnumeration results = sysRoot.search( "", "(objectClass=*)", controls );
+        NamingEnumeration<SearchResult> results = sysRoot.search( "", "(objectClass=*)", controls );
+        
         while ( results.hasMore() )
         {
-            SearchResult result = ( SearchResult ) results.next();
+            SearchResult result = results.next();
             resultMap.put( result.getName(), result.getAttributes() );
         }
+        
         return resultMap;
     }
     

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceEntryModificationHandlingIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceEntryModificationHandlingIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceEntryModificationHandlingIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceEntryModificationHandlingIT.java Sun Jan 20 08:59:10 2008
@@ -35,7 +35,11 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.HashMap;
 import java.util.Map;
@@ -104,12 +108,14 @@
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         controls.setReturningAttributes( new String[]
             { "+", "*" } );
-        NamingEnumeration results = sysRoot.search( "", "(objectClass=*)", controls );
+        NamingEnumeration<SearchResult> results = sysRoot.search( "", "(objectClass=*)", controls );
+        
         while ( results.hasMore() )
         {
-            SearchResult result = ( SearchResult ) results.next();
+            SearchResult result = results.next();
             resultMap.put( result.getName(), result.getAttributes() );
         }
+        
         return resultMap;
     }
     
@@ -125,8 +131,8 @@
 
         //----------------------------------------------------------------------
 
-        Map results = getAllEntries();
-        Attributes testEntry = ( Attributes ) results.get( "cn=testEntry,ou=system" );
+        Map<String, Attributes> results = getAllEntries();
+        Attributes testEntry = results.get( "cn=testEntry,ou=system" );
 
         Attribute collectiveAttributeSubentries = testEntry.get( "collectiveAttributeSubentries" );
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java Sun Jan 20 08:59:10 2008
@@ -28,14 +28,23 @@
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.SubentriesControl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.Control;
 import javax.naming.ldap.LdapContext;
 import java.util.HashMap;
@@ -118,12 +127,14 @@
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         controls.setReturningAttributes( new String[]
             { "+", "*" } );
-        NamingEnumeration results = sysRoot.search( "", "(objectClass=*)", controls );
+        NamingEnumeration<SearchResult> results = sysRoot.search( "", "(objectClass=*)", controls );
+        
         while ( results.hasMore() )
         {
-            SearchResult result = ( SearchResult ) results.next();
+            SearchResult result = results.next();
             resultMap.put( result.getName(), result.getAttributes() );
         }
+        
         return resultMap;
     }
 
@@ -874,12 +885,14 @@
 
         // perform the search without the control
         Map<String, SearchResult> entries = new HashMap<String, SearchResult>();
-        NamingEnumeration list = sysRoot.search( "", "(objectClass=*)", searchControls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(objectClass=*)", searchControls );
+        
         while ( list.hasMore() )
         {
             SearchResult result = ( SearchResult ) list.next();
             entries.put( result.getName(), result );
         }
+        
         assertTrue( entries.size() > 1 );
         assertNull( entries.get( "cn=testsubentry,ou=system" ) );
 
@@ -905,12 +918,14 @@
         searchControls.setSearchScope( SearchControls.OBJECT_SCOPE );
 
         Map<String, SearchResult> entries = new HashMap<String, SearchResult>();
-        NamingEnumeration list = sysRoot.search( "cn=testsubentry", "(objectClass=subentry)", searchControls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "cn=testsubentry", "(objectClass=subentry)", searchControls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             entries.put( result.getName(), result );
         }
+        
         assertEquals( 1, entries.size() );
         assertNotNull( entries.get( "cn=testsubentry,ou=system" ) );
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceObjectClassChangeHandlingIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceObjectClassChangeHandlingIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceObjectClassChangeHandlingIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceObjectClassChangeHandlingIT.java Sun Jan 20 08:59:10 2008
@@ -30,13 +30,16 @@
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.HashMap;
 import java.util.Map;
@@ -114,10 +117,11 @@
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         controls.setReturningAttributes( new String[]
             { "+", "*" } );
-        NamingEnumeration results = sysRoot.search( "", "(objectClass=*)", controls );
+        NamingEnumeration<SearchResult> results = sysRoot.search( "", "(objectClass=*)", controls );
+        
         while ( results.hasMore() )
         {
-            SearchResult result = ( SearchResult ) results.next();
+            SearchResult result = results.next();
             resultMap.put( result.getName(), result.getAttributes() );
         }
         return resultMap;
@@ -135,8 +139,8 @@
 
         //----------------------------------------------------------------------
 
-        Map results = getAllEntries();
-        Attributes testEntry = ( Attributes ) results.get( "cn=testEntry,ou=system" );
+        Map<String, Attributes> results = getAllEntries();
+        Attributes testEntry = results.get( "cn=testEntry,ou=system" );
 
         Attribute collectiveAttributeSubentries = testEntry.get( "collectiveAttributeSubentries" );
         

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java Sun Jan 20 08:59:10 2008
@@ -19,11 +19,12 @@
  */
 package org.apache.directory.server.core.trigger;
 
-import javax.naming.Name;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapContext;
 
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -33,14 +34,14 @@
     private static final Logger LOG = LoggerFactory.getLogger( BackupUtilitiesSP.class );
 
 
-    public static void backupDeleted( LdapContext ctx, Name deletedEntryName,
-                                      Name operationPrincipal, Attributes deletedEntry ) throws NamingException
+    public static void backupDeleted( LdapContext ctx, LdapDN deletedEntryName,
+                                      LdapDN operationPrincipal, ServerEntry deletedEntry ) throws NamingException
     {
         LOG.info( "User \"" + operationPrincipal + "\" has deleted entry \"" + deletedEntryName + "\"" );
         LOG.info( "Entry content was: " + deletedEntry );
         LdapContext backupCtx = ( LdapContext ) ctx.lookup( "ou=backupContext,ou=system" );
         String deletedEntryRdn = deletedEntryName.get( deletedEntryName.size() - 1 );
-        backupCtx.createSubcontext( deletedEntryRdn, deletedEntry );
+        backupCtx.createSubcontext( deletedEntryRdn, ServerEntryUtils.toAttributesImpl( deletedEntry ) );
         LOG.info( "Backed up deleted entry to \"" +
                 ( ( LdapContext ) backupCtx.lookup( deletedEntryRdn ) ).getNameInNamespace() + "\"" );
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/ListUtilsSP.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/ListUtilsSP.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/ListUtilsSP.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/ListUtilsSP.java Sun Jan 20 08:59:10 2008
@@ -19,13 +19,13 @@
  */
 package org.apache.directory.server.core.trigger;
 
-import javax.naming.Name;
 import javax.naming.NamingException;
 import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -35,7 +35,7 @@
     private static final Logger LOG = LoggerFactory.getLogger( ListUtilsSP.class );
 
 
-    public static void subscribeToGroup( Name addedEntryName, LdapContext groupCtx ) throws NamingException
+    public static void subscribeToGroup( LdapDN addedEntryName, LdapContext groupCtx ) throws NamingException
     {
         LOG.info( "User \"" + addedEntryName + "\" will be subscribed to \"" + groupCtx + "\"" );
         groupCtx.modifyAttributes("", DirContext.ADD_ATTRIBUTE,

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/trigger/SubentryServiceForTriggersIT.java Sun Jan 20 08:59:10 2008
@@ -29,14 +29,21 @@
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.HashMap;
 import java.util.Map;
@@ -118,10 +125,11 @@
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         controls.setReturningAttributes( new String[]
             { "+", "*" } );
-        NamingEnumeration results = sysRoot.search( "", "(objectClass=*)", controls );
+        NamingEnumeration<SearchResult> results = sysRoot.search( "", "(objectClass=*)", controls );
+        
         while ( results.hasMore() )
         {
-            SearchResult result = ( SearchResult ) results.next();
+            SearchResult result = results.next();
             resultMap.put( result.getName(), result.getAttributes() );
         }
         return resultMap;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/main/antlr/openldap.g
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/main/antlr/openldap.g?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/main/antlr/openldap.g (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/main/antlr/openldap.g Sun Jan 20 08:59:10 2008
@@ -35,8 +35,12 @@
  */
 package org.apache.directory.server.core.tools.schema;
 
-import java.util.* ;
-import org.apache.directory.shared.ldap.schema.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
+import org.apache.directory.shared.ldap.schema.UsageEnum;
 
 }
 
@@ -98,7 +102,7 @@
 
 DESC
     :
-        "desc" WS QUOTE ( ~'\'' )+ QUOTE
+        "desc" WS QUOTE ( ~'\'' )* QUOTE
     ;
 
 SYNTAX
@@ -117,8 +121,8 @@
 {
     public static final String[] EMPTY = new String[0];
 
-    private List attributeTypes = new ArrayList();
-    private List objectClasses = new ArrayList();
+    private List<AttributeTypeLiteral> attributeTypes = new ArrayList<AttributeTypeLiteral>();
+    private List<ObjectClassLiteral> objectClasses = new ArrayList<ObjectClassLiteral>();
     private ParserMonitor monitor = null;
 
 
@@ -293,30 +297,40 @@
 }
     : d:DESC
     {
-        String desc = d.getText().split( "'" )[1];
-        String[] quoted = desc.split( "\"" );
-
-        if ( quoted.length == 1 )
-        {
-            objectClass.setDescription( desc );
+        String text = d.getText();
+        String[] elems = text.split( "'" );
+        
+        if ( elems.length == 1 )
+        { 
+            objectClass.setDescription( "" );
         }
         else
         {
-            StringBuffer buf = new StringBuffer();
-            for ( int ii = 0; ii < quoted.length; ii++ )
-            {
-                if ( ii < quoted.length - 1 )
-                {
-                    buf.append( quoted[ii] ).append( "\\" ).append( "\"" );
-                }
-                else
-                {
-                    buf.append( quoted[ii] );
-                }
-            }
-
-            objectClass.setDescription( buf.toString() );
-        }
+	        String desc = elems[1];
+	        String[] quoted = desc.split( "\"" );
+	
+	        if ( quoted.length == 1 )
+	        {
+	            objectClass.setDescription( desc );
+	        }
+	        else
+	        {
+	            StringBuffer buf = new StringBuffer();
+	            for ( int ii = 0; ii < quoted.length; ii++ )
+	            {
+	                if ( ii < quoted.length - 1 )
+	                {
+	                    buf.append( quoted[ii] ).append( "\\" ).append( "\"" );
+	                }
+	                else
+	                {
+	                    buf.append( quoted[ii] );
+	                }
+	            }
+	
+	            objectClass.setDescription( buf.toString() );
+	        }
+	    }
     }
     ;
 
@@ -392,29 +406,39 @@
 }
     : d:DESC
     {
-        String desc = d.getText().split( "'" )[1];
-        String[] quoted = desc.split( "\"" );
-
-        if ( quoted.length == 1 )
+        String text = d.getText();
+        String[] elems = text.split( "'" );
+        
+        if ( elems.length == 1 )
         {
-            type.setDescription( desc );
+            type.setDescription( "" );
         }
         else
         {
-            StringBuffer buf = new StringBuffer();
-            for ( int ii = 0; ii < quoted.length; ii++ )
+            String desc = elems[1];
+            String[] quoted = desc.split( "\"" );
+
+            if ( quoted.length == 1 )
             {
-                if ( ii < quoted.length - 1 )
-                {
-                    buf.append( quoted[ii] ).append( "\\" ).append( "\"" );
-                }
-                else
+                type.setDescription( desc );
+            }
+            else
+            {
+                StringBuffer buf = new StringBuffer();
+                for ( int ii = 0; ii < quoted.length; ii++ )
                 {
-                    buf.append( quoted[ii] );
+                    if ( ii < quoted.length - 1 )
+                    {
+                        buf.append( quoted[ii] ).append( "\\" ).append( "\"" );
+                    }
+                    else
+                    {
+                        buf.append( quoted[ii] );
+                    }
                 }
-            }
 
-            type.setDescription( buf.toString() );
+                type.setDescription( buf.toString() );
+            }
         }
     }
     ;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParserTest.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParserTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/OpenLdapSchemaParserTest.java Sun Jan 20 08:59:10 2008
@@ -232,4 +232,72 @@
         assertEquals( "personalSignature", objectClass.getMay()[18] );
 
     }
+
+    public void testSimpleAttributeTypeEmptyDesc() throws Exception
+    {
+        String attributeTypeData = "attributetype ( 2.5.4.14 NAME 'searchGuide'\n"
+            + "        DESC ''\n"
+            + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.25 )";
+
+        parser.parse( attributeTypeData );
+        List attributeTypeList = parser.getAttributeTypes();
+        Map attributeTypes = mapAttributeTypes( attributeTypeList );
+        AttributeTypeLiteral type = ( AttributeTypeLiteral ) attributeTypes.get( "2.5.4.14" );
+
+        assertNotNull( type );
+        assertEquals( "2.5.4.14", type.getOid() );
+        assertEquals( "searchGuide", type.getNames()[0] );
+        assertEquals( "", type.getDescription() );
+        assertEquals( "1.3.6.1.4.1.1466.115.121.1.25", type.getSyntax() );
+    }
+
+
+    public void testObjectClassEmptyDesc() throws Exception
+    {
+        String objectClassData = "objectclass ( 0.9.2342.19200300.100.4.4\n"
+            + "\tNAME ( 'pilotPerson' 'newPilotPerson' )\n"
+            + "\tDESC ''\n"
+            + "\tSUP person STRUCTURAL\n"
+            + "\tMAY ( userid $ textEncodedORAddress $ rfc822Mailbox $\n"
+            + "\t\tfavouriteDrink $ roomNumber $ userClass $\n"
+            + "\t\thomeTelephoneNumber $ homePostalAddress $ secretary $\n"
+            + "\t\tpersonalTitle $ preferredDeliveryMethod $ businessCategory $\n"
+            + "\t\tjanetMailbox $ otherMailbox $ mobileTelephoneNumber $\n"
+            + "\t\tpagerTelephoneNumber $ organizationalStatus $\n"
+            + "\t\tmailPreferenceOption $ personalSignature )\n" + "\t)";
+        parser.parse( objectClassData );
+        List objectClassesList = parser.getObjectClassTypes();
+        Map objectClasses = mapObjectClasses( objectClassesList );
+        ObjectClassLiteral objectClass = ( ObjectClassLiteral ) objectClasses.get( "0.9.2342.19200300.100.4.4" );
+
+        assertNotNull( objectClass );
+        assertEquals( "0.9.2342.19200300.100.4.4", objectClass.getOid() );
+        assertEquals( "pilotPerson", objectClass.getNames()[0] );
+        assertEquals( "newPilotPerson", objectClass.getNames()[1] );
+        assertEquals( "", objectClass.getDescription() );
+        assertEquals( ObjectClassTypeEnum.STRUCTURAL, objectClass.getClassType() );
+        assertEquals( "person", objectClass.getSuperiors()[0] );
+
+        assertEquals( "userid", objectClass.getMay()[0] );
+        assertEquals( "textEncodedORAddress", objectClass.getMay()[1] );
+        assertEquals( "rfc822Mailbox", objectClass.getMay()[2] );
+        assertEquals( "favouriteDrink", objectClass.getMay()[3] );
+        assertEquals( "roomNumber", objectClass.getMay()[4] );
+        assertEquals( "userClass", objectClass.getMay()[5] );
+        assertEquals( "homeTelephoneNumber", objectClass.getMay()[6] );
+        assertEquals( "homePostalAddress", objectClass.getMay()[7] );
+        assertEquals( "secretary", objectClass.getMay()[8] );
+        assertEquals( "personalTitle", objectClass.getMay()[9] );
+        assertEquals( "preferredDeliveryMethod", objectClass.getMay()[10] );
+        assertEquals( "businessCategory", objectClass.getMay()[11] );
+        assertEquals( "janetMailbox", objectClass.getMay()[12] );
+        assertEquals( "otherMailbox", objectClass.getMay()[13] );
+        assertEquals( "mobileTelephoneNumber", objectClass.getMay()[14] );
+        assertEquals( "pagerTelephoneNumber", objectClass.getMay()[15] );
+        assertEquals( "organizationalStatus", objectClass.getMay()[16] );
+        assertEquals( "mailPreferenceOption", objectClass.getMay()[17] );
+        assertEquals( "personalSignature", objectClass.getMay()[18] );
+
+    }
+
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractAdminTestCase.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractAdminTestCase.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractAdminTestCase.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractAdminTestCase.java Sun Jan 20 08:59:10 2008
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.core.unit;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.server.constants.ServerDNConstants;
 
 
@@ -30,7 +32,7 @@
  */
 public abstract class AbstractAdminTestCase extends AbstractTestCase
 {
-    protected AbstractAdminTestCase()
+    protected AbstractAdminTestCase() throws NamingException
     {
         super( ServerDNConstants.ADMIN_SYSTEM_DN, "secret" );
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java Sun Jan 20 08:59:10 2008
@@ -36,7 +36,12 @@
 import javax.naming.NamingException;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
-import java.io.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.Iterator;
@@ -95,7 +100,7 @@
     private String ldifPath;
 
     /** Load resources relative to this class */
-    private Class loadClass;
+    private Class<?> loadClass;
 
     private Hashtable<String,Object> overrides = new Hashtable<String,Object>();
 
@@ -104,7 +109,7 @@
     protected DirectoryService service;
 
 
-    protected AbstractTestCase( String username, String password )
+    protected AbstractTestCase( String username, String password ) throws NamingException
     {
         if ( username == null || password == null )
         {
@@ -124,7 +129,7 @@
      * @param ldifPath the relative resource path to the LDIF file
      * @param loadClass the class used to load the LDIF as a resource stream
      */
-    protected void setLdifPath( String ldifPath, Class loadClass )
+    protected void setLdifPath( String ldifPath, Class<?> loadClass )
     {
         this.loadClass = loadClass;
         this.ldifPath = ldifPath;
@@ -174,8 +179,8 @@
         // -------------------------------------------------------------------
 
         LdifReader reader = new LdifReader();
-    	List entries = reader.parseLdif( LDIF );
-        Entry entry = ( Entry ) entries.get(0);
+    	List<Entry> entries = reader.parseLdif( LDIF );
+        Entry entry = entries.get(0);
         testEntries.add( entry );
 
         // -------------------------------------------------------------------
@@ -405,7 +410,7 @@
     }
 
 
-    protected void setLoadClass( Class loadClass )
+    protected void setLoadClass( Class<?> loadClass )
     {
         this.loadClass = loadClass;
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/IntegrationUtils.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/IntegrationUtils.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/IntegrationUtils.java Sun Jan 20 08:59:10 2008
@@ -20,7 +20,6 @@
 
 
 import org.apache.commons.io.FileUtils;
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.shared.ldap.ldif.ChangeType;
 import org.apache.directory.shared.ldap.ldif.Entry;
 import org.apache.directory.shared.ldap.message.AttributeImpl;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/pom.xml?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/pom.xml Sun Jan 20 08:59:10 2008
@@ -48,6 +48,12 @@
 
     <dependency>
       <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-entry</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-schema-registries</artifactId>
       <version>${pom.version}</version>
     </dependency>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Sun Jan 20 08:59:10 2008
@@ -32,6 +32,9 @@
 import org.apache.directory.server.core.changelog.Tag;
 import org.apache.directory.server.core.collective.CollectiveAttributeInterceptor;
 import org.apache.directory.server.core.cursor.Cursor;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.event.EventInterceptor;
 import org.apache.directory.server.core.exception.ExceptionInterceptor;
 import org.apache.directory.server.core.interceptor.Interceptor;
@@ -82,12 +85,14 @@
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
 import org.apache.directory.shared.ldap.ldif.ChangeType;
 import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.DateUtils;
+import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -97,8 +102,11 @@
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import javax.naming.ldap.LdapContext;
+
+import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
+import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Hashtable;
@@ -113,15 +121,19 @@
  * @org.apache.xbean.XBean
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DefaultDirectoryService implements  DirectoryService
+public class DefaultDirectoryService implements DirectoryService
 {
     private static final Logger LOG = LoggerFactory.getLogger( DefaultDirectoryService.class );
 
+    private static final String ILLEGAL_STATE_MSG = "Something has got to be severely " +
+    "wrong with the core packaging\nor the build to have " +
+    "resulted in this exception.";
+    
     private SchemaService schemaService;
 
     /** the registries for system schema objects */
     private Registries registries;
-
+    
     /** the root nexus */
     private DefaultPartitionNexus partitionNexus;
 
@@ -154,10 +166,47 @@
     /**
      * Creates a new instance.
      */
-    public DefaultDirectoryService()
+    public DefaultDirectoryService() 
     {
         setDefaultInterceptorConfigurations();
         changeLog = new DefaultChangeLog();
+        
+        // --------------------------------------------------------------------
+        // Load the bootstrap schemas to start up the schema partition
+        // --------------------------------------------------------------------
+
+        // setup temporary loader and temp registry 
+        BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
+        OidRegistry oidRegistry = new DefaultOidRegistry();
+        registries = new DefaultRegistries( "bootstrap", loader, oidRegistry );
+
+        // load essential bootstrap schemas 
+        Set<Schema> bootstrapSchemas = new HashSet<Schema>();
+        bootstrapSchemas.add( new ApachemetaSchema() );
+        bootstrapSchemas.add( new ApacheSchema() );
+        bootstrapSchemas.add( new CoreSchema() );
+        bootstrapSchemas.add( new SystemSchema() );
+        
+        
+        try
+        {
+            loader.loadWithDependencies( bootstrapSchemas, registries );
+        }
+        catch ( NamingException e )
+        {
+            throw new IllegalStateException( ILLEGAL_STATE_MSG, e );
+        }
+
+        // run referential integrity tests
+        List<Throwable> errors = registries.checkRefInteg();
+        if ( !errors.isEmpty() )
+        {
+            NamingException e = new NamingException();
+            e.setRootCause( errors.get( 0 ) );
+            throw new IllegalStateException( ILLEGAL_STATE_MSG, e );
+        }
+        
+        SerializableComparator.setRegistry( registries.getComparatorRegistry() );
     }
 
 
@@ -468,7 +517,7 @@
             return;
         }
 
-        AddContextPartitionOperationContext addPartitionCtx = new AddContextPartitionOperationContext( parition );
+        AddContextPartitionOperationContext addPartitionCtx = new AddContextPartitionOperationContext( registries, parition );
         partitionNexus.addContextPartition( addPartitionCtx );
     }
 
@@ -483,7 +532,7 @@
         }
 
         RemoveContextPartitionOperationContext removePartitionCtx =
-                new RemoveContextPartitionOperationContext( partition.getSuffixDn() );
+                new RemoveContextPartitionOperationContext( registries, partition.getSuffixDn() );
         partitionNexus.removeContextPartition( removePartitionCtx );
     }
 
@@ -651,6 +700,7 @@
                 switch( reverse.getChangeType().getChangeType() )
                 {
                     case( ChangeType.ADD_ORDINAL ):
+                        //System.out.println( "Reverted attributes : --> " + reverse.getAttributes() );
                         ctx.createSubcontext( reverse.getDn(), reverse.getAttributes() );
                         break;
                     case( ChangeType.DELETE_ORDINAL ):
@@ -818,6 +868,12 @@
     }
 
 
+    public ServerEntry newEntry( LdapDN dn ) throws NamingException
+    {
+        return new DefaultServerEntry( registries, dn );
+    }
+    
+    
     /**
      * Checks to make sure security environment parameters are set correctly.
      *
@@ -919,29 +975,28 @@
         /*
          * If the admin entry is there, then the database was already created
          */
-        if ( !partitionNexus.hasEntry( new EntryOperationContext( PartitionNexus.getAdminName() ) ) )
+        if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, PartitionNexus.getAdminName() ) ) )
         {
             firstStart = true;
 
-            Attributes attributes = new AttributesImpl();
-            Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-            objectClass.add( SchemaConstants.TOP_OC );
-            objectClass.add( SchemaConstants.PERSON_OC );
-            objectClass.add( SchemaConstants.ORGANIZATIONAL_PERSON_OC );
-            objectClass.add( SchemaConstants.INET_ORG_PERSON_OC );
-            attributes.put( objectClass );
-
-            attributes.put( SchemaConstants.UID_AT, PartitionNexus.ADMIN_UID );
-            attributes.put( SchemaConstants.USER_PASSWORD_AT, PartitionNexus.ADMIN_PASSWORD );
-            attributes.put( SchemaConstants.DISPLAY_NAME_AT, "Directory Superuser" );
-            attributes.put( SchemaConstants.CN_AT, "system administrator" );
-            attributes.put( SchemaConstants.SN_AT, "administrator" );
-            attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
-            attributes.put( SchemaConstants.DISPLAY_NAME_AT, "Directory Superuser" );
+            ServerEntry serverEntry = new DefaultServerEntry( registries, PartitionNexus.getAdminName() );
+            
+            serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, 
+                                SchemaConstants.TOP_OC,
+                                SchemaConstants.PERSON_OC,
+                                SchemaConstants.ORGANIZATIONAL_PERSON_OC,
+                                SchemaConstants.INET_ORG_PERSON_OC );
+
+            serverEntry.put( SchemaConstants.UID_AT, PartitionNexus.ADMIN_UID );
+            serverEntry.put( SchemaConstants.USER_PASSWORD_AT, PartitionNexus.ADMIN_PASSWORD );
+            serverEntry.put( SchemaConstants.DISPLAY_NAME_AT, "Directory Superuser" );
+            serverEntry.put( SchemaConstants.CN_AT, "system administrator" );
+            serverEntry.put( SchemaConstants.SN_AT, "administrator" );
+            serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+            serverEntry.put( SchemaConstants.DISPLAY_NAME_AT, "Directory Superuser" );
 
-            partitionNexus.add( new AddOperationContext( PartitionNexus.getAdminName(),
-                attributes ) );
+            partitionNexus.add( new AddOperationContext( registries, PartitionNexus.getAdminName(), serverEntry ) );
         }
 
         // -------------------------------------------------------------------
@@ -952,21 +1007,21 @@
         LdapDN userDn = new LdapDN( ServerDNConstants.USERS_SYSTEM_DN );
         userDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( new EntryOperationContext( userDn ) ) )
+        if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, userDn ) ) )
         {
             firstStart = true;
 
-            Attributes attributes = new AttributesImpl();
-            Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-            objectClass.add( SchemaConstants.TOP_OC );
-            objectClass.add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
-            attributes.put( objectClass );
-
-            attributes.put( SchemaConstants.OU_AT, "users" );
-            attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+            ServerEntry serverEntry = new DefaultServerEntry( registries, userDn );
+            
+            serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, 
+                                SchemaConstants.TOP_OC,
+                                SchemaConstants.ORGANIZATIONAL_UNIT_OC );
+
+            serverEntry.put( SchemaConstants.OU_AT, "users" );
+            serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
 
-            partitionNexus.add( new AddOperationContext( userDn, attributes ) );
+            partitionNexus.add( new AddOperationContext( registries, userDn, serverEntry ) );
         }
 
         // -------------------------------------------------------------------
@@ -976,21 +1031,21 @@
         LdapDN groupDn = new LdapDN( ServerDNConstants.GROUPS_SYSTEM_DN );
         groupDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( new EntryOperationContext( groupDn ) ) )
+        if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, groupDn ) ) )
         {
             firstStart = true;
 
-            Attributes attributes = new AttributesImpl();
-            Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-            objectClass.add( SchemaConstants.TOP_OC );
-            objectClass.add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
-            attributes.put( objectClass );
-
-            attributes.put( SchemaConstants.OU_AT, "groups" );
-            attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+            ServerEntry serverEntry = new DefaultServerEntry( registries, userDn );
+            
+            serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, 
+                                SchemaConstants.TOP_OC,
+                                SchemaConstants.ORGANIZATIONAL_UNIT_OC );
+
+            serverEntry.put( SchemaConstants.OU_AT, "groups" );
+            serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
 
-            partitionNexus.add( new AddOperationContext( groupDn, attributes ) );
+            partitionNexus.add( new AddOperationContext( registries, groupDn, serverEntry ) );
         }
 
         // -------------------------------------------------------------------
@@ -1000,21 +1055,22 @@
         LdapDN name = new LdapDN( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
         name.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( new EntryOperationContext( name ) ) )
+        if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, name ) ) )
         {
             firstStart = true;
 
-            Attributes attributes = new AttributesImpl();
-            Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-            objectClass.add( SchemaConstants.TOP_OC );
-            objectClass.add( SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC );
-            attributes.put( objectClass );
-            attributes.put( SchemaConstants.CN_AT, "Administrators" );
-            attributes.put( SchemaConstants.UNIQUE_MEMBER_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-            attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+            ServerEntry serverEntry = new DefaultServerEntry( registries, userDn );
+            
+            serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, 
+                                SchemaConstants.TOP_OC,
+                                SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC );
+
+            serverEntry.put( SchemaConstants.CN_AT, "Administrators" );
+            serverEntry.put( SchemaConstants.UNIQUE_MEMBER_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
 
-            partitionNexus.add( new AddOperationContext( name, attributes ) );
+            partitionNexus.add( new AddOperationContext( registries, name, serverEntry ) );
             
             Interceptor authzInterceptor = interceptorChain.get( AciAuthorizationInterceptor.class.getName() );
             
@@ -1033,7 +1089,7 @@
             }
 
             AciAuthorizationInterceptor authzSrvc = ( AciAuthorizationInterceptor ) authzInterceptor;
-            authzSrvc.cacheNewGroup( name, attributes );
+            authzSrvc.cacheNewGroup( name, serverEntry );
 
         }
 
@@ -1044,7 +1100,7 @@
         LdapDN configurationDn = new LdapDN( "ou=configuration,ou=system" );
         configurationDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( new EntryOperationContext( configurationDn ) ) )
+        if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, configurationDn ) ) )
         {
             firstStart = true;
 
@@ -1058,7 +1114,8 @@
             attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
 
-            partitionNexus.add( new AddOperationContext( configurationDn, attributes ) );
+            ServerEntry entry = ServerEntryUtils.toServerEntry( attributes, configurationDn, registries );
+            partitionNexus.add( new AddOperationContext( registries, configurationDn, entry ) );
         }
 
         // -------------------------------------------------------------------
@@ -1068,7 +1125,7 @@
         LdapDN partitionsDn = new LdapDN( "ou=partitions,ou=configuration,ou=system" );
         partitionsDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( new EntryOperationContext( partitionsDn ) ) )
+        if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, partitionsDn ) ) )
         {
             firstStart = true;
 
@@ -1082,7 +1139,8 @@
             attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
 
-            partitionNexus.add( new AddOperationContext( partitionsDn, attributes ) );
+            ServerEntry entry = ServerEntryUtils.toServerEntry( attributes, partitionsDn, registries );
+            partitionNexus.add( new AddOperationContext( registries, partitionsDn, entry ) );
         }
 
         // -------------------------------------------------------------------
@@ -1092,7 +1150,7 @@
         LdapDN servicesDn = new LdapDN( "ou=services,ou=configuration,ou=system" );
         servicesDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( new EntryOperationContext( servicesDn ) ) )
+        if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, servicesDn ) ) )
         {
             firstStart = true;
 
@@ -1106,7 +1164,8 @@
             attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
 
-            partitionNexus.add( new AddOperationContext( servicesDn, attributes ) );
+            ServerEntry entry = ServerEntryUtils.toServerEntry( attributes, servicesDn, registries );
+            partitionNexus.add( new AddOperationContext( registries, servicesDn, entry ) );
         }
 
         // -------------------------------------------------------------------
@@ -1116,7 +1175,7 @@
         LdapDN interceptorsDn = new LdapDN( "ou=interceptors,ou=configuration,ou=system" );
         interceptorsDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( new EntryOperationContext( interceptorsDn ) ) )
+        if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, interceptorsDn ) ) )
         {
             firstStart = true;
 
@@ -1130,7 +1189,8 @@
             attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
 
-            partitionNexus.add( new AddOperationContext( interceptorsDn, attributes ) );
+            ServerEntry entry = ServerEntryUtils.toServerEntry( attributes, interceptorsDn, registries );
+            partitionNexus.add( new AddOperationContext( registries, interceptorsDn, entry ) );
         }
 
         // -------------------------------------------------------------------
@@ -1140,7 +1200,7 @@
         LdapDN sysPrefRootDn = new LdapDN( ServerDNConstants.SYSPREFROOT_SYSTEM_DN );
         sysPrefRootDn.normalize( oidsMap );
         
-        if ( !partitionNexus.hasEntry( new EntryOperationContext( sysPrefRootDn ) ) )
+        if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, sysPrefRootDn ) ) )
         {
             firstStart = true;
 
@@ -1155,7 +1215,8 @@
             attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
 
-            partitionNexus.add( new AddOperationContext( sysPrefRootDn, attributes ) );
+            ServerEntry entry = ServerEntryUtils.toServerEntry( attributes, sysPrefRootDn, registries );
+            partitionNexus.add( new AddOperationContext( registries, sysPrefRootDn, entry ) );
         }
 
         return firstStart;
@@ -1174,7 +1235,7 @@
         LdapDN adminDn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN );
         adminDn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
         
-        Attributes adminEntry = partitionNexus.lookup( new LookupOperationContext( adminDn ) );
+        Attributes adminEntry = partitionNexus.lookup( new LookupOperationContext( registries, adminDn ) );
         Object userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get();
         if ( userPassword instanceof byte[] )
         {
@@ -1244,34 +1305,6 @@
         }
 
         // --------------------------------------------------------------------
-        // Load the bootstrap schemas to start up the schema partition
-        // --------------------------------------------------------------------
-
-        // setup temporary loader and temp registry 
-        BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        OidRegistry oidRegistry = new DefaultOidRegistry();
-        registries = new DefaultRegistries( "bootstrap", loader, oidRegistry );
-
-        // load essential bootstrap schemas 
-        Set<Schema> bootstrapSchemas = new HashSet<Schema>();
-        bootstrapSchemas.add( new ApachemetaSchema() );
-        bootstrapSchemas.add( new ApacheSchema() );
-        bootstrapSchemas.add( new CoreSchema() );
-        bootstrapSchemas.add( new SystemSchema() );
-        loader.loadWithDependencies( bootstrapSchemas, registries );
-
-        // run referential integrity tests
-        List<Throwable> errors = registries.checkRefInteg();
-        if ( !errors.isEmpty() )
-        {
-            NamingException e = new NamingException();
-            e.setRootCause( errors.get( 0 ) );
-            throw e;
-        }
-        
-        SerializableComparator.setRegistry( registries.getComparatorRegistry() );
-        
-        // --------------------------------------------------------------------
         // If not present extract schema partition from jar
         // --------------------------------------------------------------------
 
@@ -1320,9 +1353,10 @@
         schemaPartition.setIndexedAttributes( indexedAttributes );
         schemaPartition.setSuffix( ServerDNConstants.OU_SCHEMA_DN );
         
-        Attributes entry = new AttributesImpl();
-        entry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC );
-        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
+        ServerEntry entry = new DefaultServerEntry( registries, new LdapDN( ServerDNConstants.OU_SCHEMA_DN ) );
+        entry.put( SchemaConstants.OBJECT_CLASS_AT, 
+                SchemaConstants.TOP_OC, 
+                SchemaConstants.ORGANIZATIONAL_UNIT_OC );
         entry.put( SchemaConstants.OU_AT, "schema" );
         schemaPartition.setContextEntry( entry );
         schemaPartition.init( this );
@@ -1371,7 +1405,7 @@
         // --------------------------------------------------------------------
         
         PartitionSchemaLoader schemaLoader = new PartitionSchemaLoader( schemaPartition, registries );
-        Registries globalRegistries = new DefaultRegistries( "global", schemaLoader, oidRegistry );
+        Registries globalRegistries = new DefaultRegistries( "global", schemaLoader, registries.getOidRegistry() );
         schemaLoader.loadEnabled( globalRegistries );
         registries = globalRegistries;
         SerializableComparator.setRegistry( globalRegistries.getComparatorRegistry() );
@@ -1382,9 +1416,9 @@
         schemaService = new SchemaService( registries, schemaPartition, schemaControl );
 
 
-        partitionNexus = new DefaultPartitionNexus( new AttributesImpl() );
+        partitionNexus = new DefaultPartitionNexus( new DefaultServerEntry( registries, LdapDN.EMPTY_LDAPDN ) );
         partitionNexus.init( this );
-        partitionNexus.addContextPartition( new AddContextPartitionOperationContext( schemaPartition ) );
+        partitionNexus.addContextPartition( new AddContextPartitionOperationContext( registries, schemaPartition ) );
 
         interceptorChain = new InterceptorChain();
         interceptorChain.init( this );
@@ -1397,6 +1431,89 @@
         if ( LOG.isDebugEnabled() )
         {
             LOG.debug( "<--- DefaultDirectoryService initialized" );
+        }
+    }
+    
+    /**
+     * Read an entry (without DN)
+     * 
+     * @param text The ldif format file
+     * @return An Attributes.
+     */
+    private Attributes readEntry( String text )
+    {
+        StringReader strIn = new StringReader( text );
+        BufferedReader in = new BufferedReader( strIn );
+
+        String line = null;
+        Attributes attributes = new AttributesImpl( true );
+
+        try
+        {
+            while ( ( line = in.readLine() ) != null )
+            {
+                if ( line.length() == 0 )
+                {
+                    continue;
+                }
+
+                String addedLine = line.trim();
+
+                if ( StringTools.isEmpty( addedLine ) )
+                {
+                    continue;
+                }
+
+                Attribute attribute = LdifReader.parseAttributeValue( addedLine );
+                Attribute oldAttribute = attributes.get( attribute.getID() );
+
+                if ( oldAttribute != null )
+                {
+                    try
+                    {
+                        oldAttribute.add( attribute.get() );
+                        attributes.put( oldAttribute );
+                    }
+                    catch (NamingException ne)
+                    {
+                        // Do nothing
+                    }
+                }
+                else
+                {
+                    attributes.put( attribute );
+                }
+            }
+        }
+        catch (IOException ioe)
+        {
+            // Do nothing : we can't reach this point !
+        }
+
+        return attributes;
+    }
+
+    
+    /**
+     * Create a new ServerEntry
+     * 
+     * @param ldif The String representing the attributes, as a LDIF file
+     * @param dn The DN for this new entry
+     */
+    public ServerEntry newEntry( String ldif, String dn )
+    {
+        try
+        {
+            Attributes entry = readEntry( ldif );
+            
+            ServerEntry serverEntry = ServerEntryUtils.toServerEntry( entry, new LdapDN( dn ), registries );
+            return serverEntry;
+        }
+        catch ( Exception e )
+        {
+        	LOG.error( "Cannot build an entry for '{}' and this DN :'{}'", ldif, dn );
+            // do nothing
+            return null;
         }
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryService.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryService.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryService.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryService.java Sun Jan 20 08:59:10 2008
@@ -22,6 +22,8 @@
 
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.server.core.changelog.ChangeLog;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryFactory;
 import org.apache.directory.server.core.interceptor.Interceptor;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.jndi.AbstractContextFactory;
@@ -47,7 +49,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public interface DirectoryService
+public interface DirectoryService extends ServerEntryFactory
 {
     String JNDI_KEY = DirectoryService.class.getName();
 
@@ -379,4 +381,13 @@
      * @param changeLog the change log service to set
      */
     void setChangeLog( ChangeLog changeLog );
+    
+
+    /**
+     * Create a new ServerEntry
+     * 
+     * @param ldif The String representing the attributes, as a LDIF file
+     * @param dn The DN for this new entry
+     */
+    ServerEntry newEntry( String ldif, String dn );
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java Sun Jan 20 08:59:10 2008
@@ -36,7 +36,7 @@
 public abstract class AbstractAuthenticator implements Authenticator
 {
     private DirectoryService directoryService;
-
+    
     /** authenticator type */
     private final String authenticatorType;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java Sun Jan 20 08:59:10 2008
@@ -51,7 +51,7 @@
      */
     public LdapPrincipal authenticate( LdapDN bindDn, ServerContext ctx ) throws NamingException
     {
-        if ( super.getDirectoryService().isAllowAnonymousAccess() )
+        if ( getDirectoryService().isAllowAnonymousAccess() )
         {
             return LdapPrincipal.ANONYMOUS;
         }



Mime
View raw message