directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r809674 [1/2] - in /directory/apacheds/branches/apacheds-schema: core-entry/src/main/java/org/apache/directory/server/core/entry/ core-integ/src/main/java/org/apache/directory/server/core/integ/ core-integ/src/test/java/org/apache/directory...
Date Mon, 31 Aug 2009 17:49:06 GMT
Author: akarasulu
Date: Mon Aug 31 17:49:02 2009
New Revision: 809674

URL: http://svn.apache.org/viewvc?rev=809674&view=rev
Log:
fixing several compiler errors due to api changes in schema

Removed:
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/bootstrap/
Modified:
    directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/security/TlsKeyGeneratorTest.java
    directory/apacheds/branches/apacheds-schema/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java Mon Aug 31 17:49:02 2009
@@ -192,6 +192,7 @@
     /* no protection*/ static AttributeType getIA5StringAttributeType()
     {
         AttributeType attributeType = new AttributeType( "1.1" );
+        attributeType.addName( "1.1" );
         LdapSyntax syntax = new LdapSyntax( "1.1.1", "", true );
 
         syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2" )

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java Mon Aug 31 17:49:02 2009
@@ -19,10 +19,9 @@
 package org.apache.directory.server.core.integ;
 
 
-import java.io.File;
+import java.io.File; 
 import java.io.IOException;
 import java.util.List;
-import java.util.Map;
 
 import javax.naming.InvalidNameException;
 import javax.naming.NamingException;
@@ -50,7 +49,6 @@
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.jndi.ServerLdapContext;
-import org.apache.directory.shared.ldap.schema.registries.Schema;
 
 
 /**
@@ -291,10 +289,6 @@
     // -----------------------------------------------------------------------
     // Enable/Disable Schema Tests
     // -----------------------------------------------------------------------
-    public static Map<String, Schema> getLoadedSchemas( DirectoryService service )
-    {
-        return service.getRegistries().getLoadedSchemas();
-    }
 
 
     public static void enableSchema( DirectoryService service, String schemaName ) throws Exception
@@ -326,9 +320,7 @@
      */
     public static boolean isDisabled( DirectoryService service, String schemaName )
     {
-        Schema schema = getLoadedSchemas(service ).get( schemaName );
-        
-        return ( schema == null ) || ( schema.isDisabled() );
+    	return ! service.getRegistries().isSchemaLoaded( schemaName );
     }
     
     
@@ -337,8 +329,6 @@
      */
     public static boolean isEnabled( DirectoryService service, String schemaName )
     {
-        Schema schema = getLoadedSchemas( service ).get( schemaName );
-        
-        return ( schema != null ) && ( !schema.isDisabled() );
+    	return service.getRegistries().isSchemaLoaded( schemaName );
     }
 }

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSchemaHandlerIT.java Mon Aug 31 17:49:02 2009
@@ -34,7 +34,6 @@
 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;
@@ -112,7 +111,7 @@
         dummySchema.put( MetaSchemaConstants.M_DISABLED_AT, "TRUE" );
         schemaRoot.createSubcontext( "cn=dummy", dummySchema );
         
-        assertNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertFalse( IntegrationUtils.isEnabled( service, "dummy" ) );
         assertNotNull( schemaRoot.lookup( "cn=dummy" ) );
     }
     
@@ -135,7 +134,7 @@
         dummySchema.get( MetaSchemaConstants.M_DEPENDENCIES_AT ).add( "core" );
         schemaRoot.createSubcontext( "cn=dummy", dummySchema );
         
-        assertNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertFalse( IntegrationUtils.isEnabled( service, "dummy" ) );
         assertNotNull( schemaRoot.lookup( "cn=dummy" ) );
     }
     
@@ -166,7 +165,7 @@
             assertTrue( e.getResultCode().equals( ResultCodeEnum.UNWILLING_TO_PERFORM ) );
         }
         
-        assertNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertFalse( IntegrationUtils.isEnabled( service, "dummy" ) );
 
         //noinspection EmptyCatchBlock
         try
@@ -195,7 +194,7 @@
         dummySchema.put( "cn", "dummy" );
         schemaRoot.createSubcontext( "cn=dummy", dummySchema );
         
-        assertNotNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertTrue( IntegrationUtils.isEnabled( service, "dummy" ) );
         assertNotNull( schemaRoot.lookup( "cn=dummy" ) );
     }
     
@@ -225,7 +224,7 @@
             assertTrue( e.getResultCode().equals( ResultCodeEnum.UNWILLING_TO_PERFORM ) );
         }
         
-        assertNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertFalse( IntegrationUtils.isEnabled( service, "dummy" ) );
 
         //noinspection EmptyCatchBlock
         try
@@ -256,11 +255,11 @@
 
         // add the dummy schema enabled 
         testAddEnabledSchemaNoDeps();
-        assertNotNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertTrue( IntegrationUtils.isEnabled( service, "dummy" ) );
         
         // delete it now
         schemaRoot.destroySubcontext( "cn=dummy" );
-        assertNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertFalse( IntegrationUtils.isEnabled( service, "dummy" ) );
     }
     
     
@@ -276,7 +275,7 @@
 
         // add the dummy schema enabled
         testAddEnabledSchemaNoDeps();
-        assertNotNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertTrue( IntegrationUtils.isEnabled( service, "dummy" ) );
         
         // make the nis schema depend on the dummy schema
         ModificationItem[] mods = new ModificationItem[1];
@@ -295,7 +294,7 @@
             assertTrue( e.getResultCode().equals( ResultCodeEnum.UNWILLING_TO_PERFORM ) );
         }
 
-        assertNotNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertTrue( IntegrationUtils.isEnabled( service, "dummy" ) );
     }
     
     
@@ -325,7 +324,7 @@
             assertTrue( e.getResultCode().equals( ResultCodeEnum.UNWILLING_TO_PERFORM ) );
         }
         
-        assertNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertFalse( IntegrationUtils.isEnabled( service, "dummy" ) );
 
         //noinspection EmptyCatchBlock
         try
@@ -500,7 +499,7 @@
         
         // check that the nis schema is loaded and the dummy schema is loaded
         assertTrue( IntegrationUtils.isEnabled( service, "nis" ) );
-        assertNotNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertTrue( IntegrationUtils.isEnabled( service, "dummy" ) );
         
         AttributeTypeRegistry atr = getAttributeTypeRegistry();
         
@@ -526,7 +525,7 @@
         
         // now test that both schema are still loaded 
         assertTrue( IntegrationUtils.isEnabled( service, "nis" ) );
-        assertNotNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
+        assertTrue( IntegrationUtils.isEnabled( service, "dummy" ) );
         
         // double check and make sure the test attribute from the test  
         // schema is still loaded and present within the attr registry

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java Mon Aug 31 17:49:02 2009
@@ -268,7 +268,7 @@
         {
             attrs = getSchemaContext( service ).getAttributes( "m-oid=" + oid + ",ou=syntaxCheckers,cn=" + schemaName );
             assertNotNull( attrs );
-            SchemaEntityFactory factory = new SchemaEntityFactory( service.getRegistries() );
+            SchemaEntityFactory factory = new SchemaEntityFactory();
             
             ServerEntry serverEntry = ServerEntryUtils.toServerEntry( attrs, LdapDN.EMPTY_LDAPDN, service.getRegistries() );
 
@@ -1423,7 +1423,7 @@
 
         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() );
+        SchemaEntityFactory factory = new SchemaEntityFactory();
         
         ServerEntry serverEntry = ServerEntryUtils.toServerEntry( attrs, LdapDN.EMPTY_LDAPDN, service.getRegistries() );
         
@@ -1486,7 +1486,7 @@
         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() );
+        SchemaEntityFactory factory = new SchemaEntityFactory();
         
         ServerEntry serverEntry = ServerEntryUtils.toServerEntry( attrs, LdapDN.EMPTY_LDAPDN, service.getRegistries() );
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Mon Aug 31 17:49:02 2009
@@ -55,7 +55,6 @@
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.partition.impl.btree.BTreePartition;
 import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
 import org.apache.directory.server.core.referral.ReferralInterceptor;
 import org.apache.directory.server.core.replication.ReplicationConfiguration;
@@ -68,9 +67,6 @@
 import org.apache.directory.server.core.subtree.SubentryInterceptor;
 import org.apache.directory.server.core.trigger.TriggerInterceptor;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
-import org.apache.directory.server.schema.bootstrap.partition.DbFileListing;
-import org.apache.directory.server.schema.bootstrap.partition.SchemaPartitionExtractor;
-import org.apache.directory.server.schema.loader.ldif.LdifSchemaLoader;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -81,23 +77,22 @@
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
-import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
 import org.apache.directory.shared.ldap.ldif.ChangeType;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.comparators.SerializableComparator;
+import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
-import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.DateUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -316,7 +311,7 @@
         journal = new DefaultJournal();
         syncPeriodMillis = DEFAULT_SYNC_PERIOD;
         csnFactory = new CsnFactory( replicaId );
-        registries = new Registries( new OidRegistry() );
+        registries = new Registries();
     }
 
 
@@ -1438,32 +1433,19 @@
         }
 
         // --------------------------------------------------------------------
-        // If not present extract schema partition from jar
+        // If not present extract schema repository from jar
         // --------------------------------------------------------------------
 
-        File schemaDirectory = new File( workingDirectory, "schema" );
-        SchemaPartitionExtractor extractor;
-        
-        if ( ! schemaDirectory.exists() )
-        {
-            try
-            {
-                extractor = new SchemaPartitionExtractor( workingDirectory );
-                extractor.extract();
-            }
-            catch ( IOException e )
-            {
-                NamingException ne = new NamingException( "Failed to extract pre-loaded schema partition." );
-                ne.setRootCause( e );
-                throw ne;
-            }
-        }
+        File schemaRepository = new File( workingDirectory, "schema" );
+        SchemaLdifExtractor extractor = new SchemaLdifExtractor( workingDirectory );
+        extractor.extractOrCopy();
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        registries = new Registries();
+        loader.loadAllEnabled( registries );
         
         // --------------------------------------------------------------------
         // Load schemas into the schema registry from LDIF schema repository
         // --------------------------------------------------------------------
-
-        LdifSchemaLoader loader = new LdifSchemaLoader( schemaDirectory );
         
         try
         {
@@ -1490,35 +1472,17 @@
         // Initialize schema partition
         // --------------------------------------------------------------------
 
+        // @TODO implement the LDIF schema partition here and set it up
         
+        JdbmPartition schemaPartition = null;
         
-        JdbmPartition schemaPartition = new JdbmPartition();
-        schemaPartition.setId( "schema" );
-        schemaPartition.setCacheSize( 1000 );
-
-        DbFileListing listing;
-        
-        try 
+        // this is really dumb but ...
+        // just bail but do so so we don't dead code complaint for now
+        if ( "blah".equals( "blah" ) )
         {
-            listing = new DbFileListing();
+        	throw new NotImplementedException();
         }
-        catch( IOException e )
-        {
-            throw new LdapNamingException( "Got IOException while trying to read DBFileListing: " + e.getMessage(), 
-                ResultCodeEnum.OTHER );
-        }
-
-        Set<Index<?,ServerEntry>> indexedAttributes = new HashSet<Index<?,ServerEntry>>();
         
-        for ( String attributeId : listing.getIndexedAttributes() )
-        {
-            indexedAttributes.add( new JdbmIndex<Object,ServerEntry>( attributeId ) );
-        }
-
-        schemaPartition.setIndexedAttributes( indexedAttributes );
-        schemaPartition.setSuffix( ServerDNConstants.OU_SCHEMA_DN );
-        schemaPartition.init( this );
-
         // --------------------------------------------------------------------
         // Enable schemas of all indices of partition configurations 
         // --------------------------------------------------------------------
@@ -1576,7 +1540,7 @@
         // --------------------------------------------------------------------
         
         PartitionSchemaLoader schemaLoader = new PartitionSchemaLoader( schemaPartition, registries );
-        Registries globalRegistries = new Registries( registries.getOidRegistry() );
+        Registries globalRegistries = new Registries();
         schemaLoader.loadEnabled( globalRegistries );
         registries = globalRegistries;
         SerializableComparator.setRegistry( globalRegistries.getComparatorRegistry() );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Mon Aug 31 17:49:02 2009
@@ -365,10 +365,10 @@
 
                 for ( Index<?,ServerEntry> index : indices )
                 {
-                    indexOids.add( atRegistry.getOid( index.getAttributeId() ) );
+                    indexOids.add( atRegistry.getOidByName( index.getAttributeId() ) );
                 }
 
-                if ( ! indexOids.contains( atRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT ) ) )
+                if ( ! indexOids.contains( atRegistry.getOidByName( SchemaConstants.OBJECT_CLASS_AT ) ) )
                 {
                     LOG.warn( "CAUTION: You have not included objectClass as an indexed attribute" +
                             "in the system partition configuration.  This will lead to poor " +
@@ -918,7 +918,7 @@
                     {
                         try
                         {
-                            realIds.add( atRegistry.getOid( idTrimmed ) );
+                            realIds.add( atRegistry.getOidByName( idTrimmed ) );
                         }
                         catch ( Exception e )
                         {

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java Mon Aug 31 17:49:02 2009
@@ -198,7 +198,7 @@
                 index.setWkDirPath( obj.getWkDirPath() );
             }
 
-            String oid = registries.getAttributeTypeRegistry().getOid( index.getAttributeId() );
+            String oid = registries.getAttributeTypeRegistry().getOidByName( index.getAttributeId() );
             
             if ( SYS_INDEX_OIDS.contains( oid ) )
             {

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java Mon Aug 31 17:49:02 2009
@@ -20,10 +20,9 @@
 package org.apache.directory.server.core.schema;
 
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.schema.loader.ldif.SchemaEntityFactory;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
@@ -33,6 +32,7 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaObject;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory;
 
 //import javax.naming.NamingException;
 import java.util.HashSet;
@@ -59,7 +59,7 @@
         this.targetRegistries = targetRegistries;
         this.loader = loader;
         this.m_oidAT = targetRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_OID_AT );
-        this.factory = new SchemaEntityFactory( targetRegistries );
+        this.factory = new SchemaEntityFactory();
     }
     
     
@@ -163,16 +163,6 @@
     
     protected void registerOids( SchemaObject obj ) throws Exception
     {
-        List<String> names = obj.getNames();
-        
-        if ( names != null )
-        {
-            for ( String name:names )
-            {
-                targetRegistries.getOidRegistry().register( name, obj.getOid() );
-            }
-        }
-        
-        targetRegistries.getOidRegistry().register( obj.getOid(), obj.getOid() );
+        targetRegistries.getOidRegistry().register( obj );
     }
 }

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java Mon Aug 31 17:49:02 2009
@@ -25,7 +25,7 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java Mon Aug 31 17:49:02 2009
@@ -24,9 +24,9 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
@@ -256,7 +256,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getAttributeTypeRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+        if ( ! targetRegistries.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
         {
             throw new LdapInvalidNameException( "The parent entry of a attributeType should be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java Mon Aug 31 17:49:02 2009
@@ -25,10 +25,9 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.schema.loader.ldif.SchemaEntityFactory;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
@@ -44,6 +43,7 @@
 import org.apache.directory.shared.ldap.schema.registries.MatchingRuleRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.Base64;
+import org.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory;
 
 
 /**
@@ -69,7 +69,7 @@
         super( targetRegistries, loader );
         this.comparatorRegistry = targetRegistries.getComparatorRegistry();
         this.matchingRuleRegistry = targetRegistries.getMatchingRuleRegistry();
-        this.factory = new SchemaEntityFactory( targetRegistries );
+        this.factory = new SchemaEntityFactory();
         this.byteCodeAT = targetRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_BYTECODE_AT );
         this.descAT = targetRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_DESCRIPTION_AT );
         this.fqcnAT = targetRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_FQCN_AT );
@@ -86,7 +86,10 @@
         {
             comparatorRegistry.unregister( oid );
             LdapComparatorDescription description = getLdapComparatorDescription( schema.getSchemaName(), targetEntry );
-            comparatorRegistry.register( description, comparator );
+            
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            comparatorRegistry.register( comparator );
             
             return SCHEMA_MODIFIED;
         }
@@ -135,7 +138,9 @@
         if ( ! schema.isDisabled() )
         {
         	LdapComparatorDescription comparatorDescription = getLdapComparatorDescription( schema.getSchemaName(), entry );
-            comparatorRegistry.register( comparatorDescription, comparator );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            comparatorRegistry.register( comparator );
         }
     }
     
@@ -154,7 +159,9 @@
         
         if ( ! schema.isDisabled() )
         {
-            comparatorRegistry.register( comparatorDescription, comparator );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            comparatorRegistry.register( comparator );
         }
     }
 
@@ -205,7 +212,9 @@
             comparatorRegistry.unregister( oldOid );
             LdapComparatorDescription comparatorDescription = getLdapComparatorDescription( schema.getSchemaName(), entry );
             comparatorDescription.setOid( oid );
-            comparatorRegistry.register( comparatorDescription, comparator );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            comparatorRegistry.register( comparator );
         }
     }
 
@@ -241,7 +250,9 @@
         {
         	LdapComparatorDescription comparatorDescription = getLdapComparatorDescription( newSchema.getSchemaName(), entry );
             comparatorDescription.setOid( oid );
-            comparatorRegistry.register( comparatorDescription, comparator );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            comparatorRegistry.register( comparator );
         }
     }
 
@@ -273,7 +284,9 @@
         if ( ! newSchema.isDisabled() )
         {
         	LdapComparatorDescription comparatorDescription = getLdapComparatorDescription( newSchema.getSchemaName(), entry );
-            comparatorRegistry.register( comparatorDescription, comparator );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            comparatorRegistry.register( comparator );
         }
     }
     
@@ -310,7 +323,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+        if ( ! targetRegistries.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
         {
             throw new LdapInvalidNameException( "The parent entry of a comparator should be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java Mon Aug 31 17:49:02 2009
@@ -24,9 +24,9 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
@@ -243,7 +243,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getAttributeTypeRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+        if ( ! targetRegistries.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
         {
             throw new LdapInvalidNameException( "The parent entry of a matchingRule should be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java Mon Aug 31 17:49:02 2009
@@ -25,10 +25,9 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.schema.loader.ldif.SchemaEntityFactory;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
@@ -44,6 +43,7 @@
 import org.apache.directory.shared.ldap.schema.registries.NormalizerRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.Base64;
+import org.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory;
 
 
 /**
@@ -68,7 +68,7 @@
         super( targetRegistries, loader );
         this.normalizerRegistry = targetRegistries.getNormalizerRegistry();
         this.matchingRuleRegistry = targetRegistries.getMatchingRuleRegistry();
-        this.factory = new SchemaEntityFactory( targetRegistries );
+        this.factory = new SchemaEntityFactory();
         this.byteCodeAT = targetRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_BYTECODE_AT );
         this.descAT = targetRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_DESCRIPTION_AT );
         this.fqcnAT = targetRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_FQCN_AT );
@@ -137,7 +137,9 @@
         if ( ! schema.isDisabled() )
         {
             NormalizerDescription normalizerDescription = getNormalizerDescription( schema.getSchemaName(), entry );
-            normalizerRegistry.register( normalizerDescription, normalizer );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            normalizerRegistry.register( normalizer );
         }
     }
 
@@ -156,7 +158,9 @@
         
         if ( ! schema.isDisabled() )
         {
-            normalizerRegistry.register( normalizerDescription, normalizer );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            normalizerRegistry.register( normalizer );
         }
     }
 
@@ -208,7 +212,9 @@
             
             NormalizerDescription normalizerDescription = getNormalizerDescription( schema.getSchemaName(), entry );
             normalizerDescription.setOid( oid );
-            normalizerRegistry.register( normalizerDescription, normalizer );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            normalizerRegistry.register( normalizer );
         }
     }
 
@@ -244,7 +250,9 @@
         {
             NormalizerDescription normalizerDescription = getNormalizerDescription( newSchema.getSchemaName(), entry );
             normalizerDescription.setOid( oid );
-            normalizerRegistry.register( normalizerDescription, normalizer );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            normalizerRegistry.register( normalizer );
         }
     }
 
@@ -276,7 +284,9 @@
         if ( ! newSchema.isDisabled() )
         {
             NormalizerDescription normalizerDescription = getNormalizerDescription( newSchema.getSchemaName(), entry );
-            normalizerRegistry.register( normalizerDescription, normalizer );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            normalizerRegistry.register( normalizer );
         }
     }
 
@@ -313,8 +323,8 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        
-        if ( ! targetRegistries.getAttributeTypeRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+
+        if ( ! targetRegistries.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
         {
             throw new LdapInvalidNameException( "The parent entry of a normalizer should be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java Mon Aug 31 17:49:02 2009
@@ -24,9 +24,9 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
@@ -244,7 +244,7 @@
         
         Rdn rdn = newParent.getRdn();
         
-        if ( ! targetRegistries.getAttributeTypeRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+        if ( ! targetRegistries.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
         {
             throw new LdapInvalidNameException( "The parent entry of a objectClass should be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java Mon Aug 31 17:49:02 2009
@@ -20,12 +20,11 @@
 package org.apache.directory.server.core.schema;
 
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
-import org.apache.directory.server.schema.loader.ldif.SchemaEntityFactory;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
@@ -40,6 +39,7 @@
 import org.apache.directory.shared.ldap.schema.SchemaObject;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.schema.registries.SchemaObjectRegistry;
+import org.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory;
 
 import javax.naming.NamingException;
 import java.util.Iterator;
@@ -65,13 +65,13 @@
     private final AttributeType dependenciesAT;
 
 
-    public MetaSchemaHandler( Registries globalRegistries, PartitionSchemaLoader loader ) throws NamingException
+    public MetaSchemaHandler( Registries globalRegistries, PartitionSchemaLoader loader ) throws Exception
     {
         this.globalRegistries = globalRegistries;
         this.disabledAT = globalRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_DISABLED_AT );
         this.loader = loader;
-        this.OU_OID = globalRegistries.getAttributeTypeRegistry().getOid( SchemaConstants.OU_AT );
-        this.factory = new SchemaEntityFactory( globalRegistries );
+        this.OU_OID = globalRegistries.getAttributeTypeRegistry().getOidByName( SchemaConstants.OU_AT );
+        this.factory = new SchemaEntityFactory();
         this.cnAT = globalRegistries.getAttributeTypeRegistry().lookup( SchemaConstants.CN_AT );
         this.dependenciesAT = globalRegistries.getAttributeTypeRegistry()
             .lookup( MetaSchemaConstants.M_DEPENDENCIES_AT );
@@ -288,7 +288,7 @@
     public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws Exception
     {
         String rdnAttribute = newRdn.getUpType();
-        String rdnAttributeOid = globalRegistries.getAttributeTypeRegistry().getOid( rdnAttribute );
+        String rdnAttributeOid = globalRegistries.getAttributeTypeRegistry().getOidByName( rdnAttribute );
         if ( ! rdnAttributeOid.equals( cnAT.getOid() ) )
         {
             throw new LdapOperationNotSupportedException( 
@@ -505,7 +505,7 @@
      */
     private boolean enableSchema( String schemaName ) throws Exception
     {
-        if ( globalRegistries.getLoadedSchemas().containsKey( schemaName ) )
+        if ( globalRegistries.isSchemaLoaded( schemaName ) )
         {
             // TODO log warning: schemaName + " was already loaded"
             return SCHEMA_UNCHANGED;

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java Mon Aug 31 17:49:02 2009
@@ -25,10 +25,9 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.schema.loader.ldif.SchemaEntityFactory;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
@@ -44,6 +43,7 @@
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.schema.registries.SyntaxCheckerRegistry;
 import org.apache.directory.shared.ldap.util.Base64;
+import org.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory;
 
 
 /**
@@ -68,7 +68,7 @@
         super( targetRegistries, loader );
         this.syntaxCheckerRegistry = targetRegistries.getSyntaxCheckerRegistry();
         this.ldapSyntaxRegistry = targetRegistries.getLdapSyntaxRegistry();
-        this.factory = new SchemaEntityFactory( targetRegistries );
+        this.factory = new SchemaEntityFactory();
         this.byteCodeAT = targetRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_BYTECODE_AT );
         this.descAT = targetRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_DESCRIPTION_AT );
         this.fqcnAT = targetRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_FQCN_AT );
@@ -115,7 +115,9 @@
             syntaxCheckerRegistry.unregister( oid );
             SyntaxCheckerDescription syntaxCheckerDescription = 
                 getSyntaxCheckerDescription( schema.getSchemaName(), targetEntry );
-            syntaxCheckerRegistry.register( syntaxCheckerDescription, syntaxChecker );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            syntaxCheckerRegistry.register( syntaxChecker );
             return SCHEMA_MODIFIED;
         }
         
@@ -142,7 +144,9 @@
         {
             SyntaxCheckerDescription syntaxCheckerDescription = 
                 getSyntaxCheckerDescription( schema.getSchemaName(), entry );
-            syntaxCheckerRegistry.register( syntaxCheckerDescription, syntaxChecker );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            syntaxCheckerRegistry.register( syntaxChecker );
         }
     }
 
@@ -162,7 +166,9 @@
         
         if ( ! schema.isDisabled() )
         {
-            syntaxCheckerRegistry.register( syntaxCheckerDescription, syntaxChecker );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            syntaxCheckerRegistry.register( syntaxChecker );
         }
     }
 
@@ -219,7 +225,9 @@
             SyntaxCheckerDescription syntaxCheckerDescription = 
                 getSyntaxCheckerDescription( schema.getSchemaName(), entry );
             syntaxCheckerDescription.setOid( newOid );
-            syntaxCheckerRegistry.register( syntaxCheckerDescription, syntaxChecker );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            syntaxCheckerRegistry.register( syntaxChecker );
         }
     }
 
@@ -262,7 +270,9 @@
             SyntaxCheckerDescription syntaxCheckerDescription = 
                 getSyntaxCheckerDescription( newSchema.getSchemaName(), entry );
             syntaxCheckerDescription.setOid( newOid );
-            syntaxCheckerRegistry.register( syntaxCheckerDescription, syntaxChecker );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            syntaxCheckerRegistry.register( syntaxChecker );
         }
     }
 
@@ -295,7 +305,9 @@
         {
             SyntaxCheckerDescription syntaxCheckerDescription = 
                 getSyntaxCheckerDescription( newSchema.getSchemaName(), entry );
-            syntaxCheckerRegistry.register( syntaxCheckerDescription, syntaxChecker );
+            // @TODO elecharny what did you intend to do with this description object?
+            
+            syntaxCheckerRegistry.register( syntaxChecker );
         }
     }
     
@@ -310,7 +322,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getAttributeTypeRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+        if ( ! targetRegistries.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
         {
             throw new LdapInvalidNameException( "The parent entry of a syntaxChecker should be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java Mon Aug 31 17:49:02 2009
@@ -24,9 +24,9 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
@@ -256,7 +256,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! targetRegistries.getAttributeTypeRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+        if ( ! targetRegistries.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
         {
             throw new LdapInvalidNameException( "The parent entry of a syntax should be an organizationalUnit.", 
                 ResultCodeEnum.NAMING_VIOLATION );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java Mon Aug 31 17:49:02 2009
@@ -34,7 +34,6 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
@@ -42,11 +41,11 @@
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.partition.Partition;
-import org.apache.directory.server.schema.loader.ldif.SchemaEntityFactory;
 import org.apache.directory.shared.ldap.schema.registries.AbstractSchemaLoader;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
@@ -62,6 +61,7 @@
 import org.apache.directory.shared.ldap.schema.parsers.NormalizerDescription;
 import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescription;
 import org.apache.directory.shared.ldap.util.Base64;
+import org.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory;
     
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -103,7 +103,7 @@
     
     public PartitionSchemaLoader( Partition partition, Registries registries ) throws Exception
     {
-        this.factory = new SchemaEntityFactory( registries );
+        this.factory = new SchemaEntityFactory();
         this.partition = partition;
         atRegistry = registries.getAttributeTypeRegistry();
         
@@ -692,7 +692,9 @@
             SyntaxChecker sc = factory.getSyntaxChecker( attrs, targetRegistries );
             SyntaxCheckerDescription syntaxCheckerDescription = 
                 getSyntaxCheckerDescription( schema.getSchemaName(), attrs );
-            targetRegistries.getSyntaxCheckerRegistry().register( syntaxCheckerDescription, sc );
+            // @TODO elecharny what should I do with the description
+            
+            targetRegistries.getSyntaxCheckerRegistry().register( sc );
         }
     }
 
@@ -725,7 +727,9 @@
             ServerEntry attrs = lookupPartition( resultDN );
             Normalizer normalizer = factory.getNormalizer( attrs, targetRegistries );
             NormalizerDescription normalizerDescription = getNormalizerDescription( schema.getSchemaName(), attrs );
-            targetRegistries.getNormalizerRegistry().register( normalizerDescription, normalizer );
+            // @TODO elecharny what should I do with the description
+            
+            targetRegistries.getNormalizerRegistry().register( normalizer );
         }
     }
 
@@ -804,7 +808,9 @@
             ClonedServerEntry attrs = lookupPartition( resultDN );
             LdapComparator<?> comparator = factory.getLdapComparator( attrs, targetRegistries );
             LdapComparatorDescription comparatorDescription = getLdapComparatorDescription( schema.getSchemaName(), attrs );
-            targetRegistries.getComparatorRegistry().register( comparatorDescription, comparator );
+            // @TODO elecharny what should I do with description
+            
+            targetRegistries.getComparatorRegistry().register( comparator );
         }
     }
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java Mon Aug 31 17:49:02 2009
@@ -391,7 +391,7 @@
         }
 
         Set<String> rdnAttributes = getRdnAttributes( name );
-        String id = atRegistry.getOid( attribute.getUpId() );
+        String id = atRegistry.getOidByName( attribute.getUpId() );
 
         if ( !rdnAttributes.contains( id ) )
         {
@@ -546,7 +546,7 @@
         Set<String> rdnAttributes = getRdnAttributes( name );
         String id = attribute.getId();
 
-        if ( !rdnAttributes.contains( atRegistry.getOid( id ) ) )
+        if ( !rdnAttributes.contains( atRegistry.getOidByName( id ) ) )
         {
             return;
         }
@@ -681,7 +681,7 @@
     private static String getRdnValue( String id, LdapDN name, AttributeTypeRegistry atRegistry ) throws NamingException
     {
         // Transform the rdnAttrId to it's OID counterPart
-        String idOid = atRegistry.getOid( id );
+        String idOid = atRegistry.getOidByName( id );
 
         if ( idOid == null )
         {
@@ -696,7 +696,7 @@
             String rdnAttrId = NamespaceTools.getRdnAttribute( comps[ii] );
             
             // Transform the rdnAttrId to it's OID counterPart
-            String rdnAttrOid = atRegistry.getOid( rdnAttrId );
+            String rdnAttrOid = atRegistry.getOidByName( rdnAttrId );
 
             if ( rdnAttrOid == null )
             {

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Mon Aug 31 17:49:02 2009
@@ -35,7 +35,6 @@
 import javax.naming.directory.InvalidAttributeValueException;
 import javax.naming.directory.SearchControls;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
@@ -66,6 +65,8 @@
 import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.schema.syntaxCheckers.AcceptAllSyntaxChecker;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.cursor.EmptyCursor;
 import org.apache.directory.shared.ldap.cursor.SingletonCursor;
@@ -106,7 +107,6 @@
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
-import org.apache.directory.shared.ldap.schema.syntaxChecker.AcceptAllSyntaxChecker;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -465,7 +465,7 @@
                 // Check that the attribute is declared
                 if ( registries.getAttributeTypeRegistry().contains( attribute ) )
                 {
-                    String oid = atRegistry.getOid( attribute );
+                    String oid = atRegistry.getOidByName( attribute );
 
                     // The attribute must be an AttributeType
                     if ( atRegistry.contains( oid ) )
@@ -740,7 +740,7 @@
                     return new BaseEntryFilteringCursor( new EmptyCursor<ServerEntry>(), opContext );
                 }
 
-                String nodeOid = atRegistry.getOid( node.getAttribute() );
+                String nodeOid = atRegistry.getOidByName( node.getAttribute() );
 
                 // see if node attribute is objectClass
                 if ( nodeOid.equals( SchemaConstants.OBJECT_CLASS_AT_OID )
@@ -840,7 +840,7 @@
             return false;
         }
 
-        String attrOid = registries.getAttributeTypeRegistry().getOid( attrId );
+        String attrOid = registries.getAttributeTypeRegistry().getOidByName( attrId );
 
         for ( Value<?> objectClass : objectClasses )
         {
@@ -860,28 +860,6 @@
 
 
     /**
-     * A helper method which tells if a schema is disabled
-     */
-    private  boolean isDisabled( String schemaName )
-    {
-        Schema schema = registries.getLoadedSchemas().get( schemaName );
-        
-        return ( schema == null ) || ( schema.isDisabled() );
-    }
-    
-    
-    /**
-     * A helper method which tells if a schema is enabled
-     */
-    private boolean isEnabled( String schemaName )
-    {
-        Schema schema = registries.getLoadedSchemas().get( schemaName );
-        
-        return ( schema != null ) && ( !schema.isDisabled() );
-    }
-    
-    
-    /**
      * Checks to see if removing a set of attributes from an entry completely removes
      * that attribute's values.  If change has zero size then all attributes are
      * presumed to be removed.
@@ -1042,7 +1020,7 @@
         Set<String> allowed = new HashSet<String>( must );
 
         // Add the 'ObjectClass' attribute ID
-        allowed.add( registries.getAttributeTypeRegistry().getOid( SchemaConstants.OBJECT_CLASS_AT ) );
+        allowed.add( registries.getAttributeTypeRegistry().getOidByName( SchemaConstants.OBJECT_CLASS_AT ) );
 
         // Loop on all objectclasses
         for ( Value<?> objectClass : objectClasses )
@@ -2066,7 +2044,7 @@
                 
                 next.add( addContext );
 
-                if ( isEnabled( schema ) )
+                if ( registries.isSchemaLoaded( schema ) )
                 {
                     // Update the OC superiors for each added ObjectClass
                     computeSuperiors();
@@ -2082,7 +2060,7 @@
                 // Update the structures now that the schema element has been added
                 String schemaName = MetaSchemaUtils.getSchemaName( name );
                 
-                if ( isEnabled( schemaName ) )
+                if ( registries.isSchemaLoaded( schemaName ) )
                 {
                     String ocName = entry.get( MetaSchemaConstants.M_NAME_AT ).getString();
                     ObjectClass addedOC = registries.getObjectClassRegistry().lookup( ocName );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java Mon Aug 31 17:49:02 2009
@@ -29,7 +29,6 @@
 import java.util.Set;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.authn.AuthenticationInterceptor;
 import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
@@ -50,6 +49,7 @@
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.normalization.NormalizationInterceptor;
 import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
@@ -74,7 +74,6 @@
 import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescription;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
-import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.DateUtils;
 
@@ -221,37 +220,37 @@
         
         AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();
 
-        String comparatorsOid = atRegistry.getOid( SchemaConstants.COMPARATORS_AT );
+        String comparatorsOid = atRegistry.getOidByName( SchemaConstants.COMPARATORS_AT );
         opAttr2handlerIndex.put( comparatorsOid, COMPARATOR_INDEX );
 
-        String normalizersOid = atRegistry.getOid( SchemaConstants.NORMALIZERS_AT );
+        String normalizersOid = atRegistry.getOidByName( SchemaConstants.NORMALIZERS_AT );
         opAttr2handlerIndex.put( normalizersOid, NORMALIZER_INDEX );
 
-        String syntaxCheckersOid = atRegistry.getOid( SchemaConstants.SYNTAX_CHECKERS_AT );
+        String syntaxCheckersOid = atRegistry.getOidByName( SchemaConstants.SYNTAX_CHECKERS_AT );
         opAttr2handlerIndex.put( syntaxCheckersOid, SYNTAX_CHECKER_INDEX );
 
-        String ldapSyntaxesOid = atRegistry.getOid( SchemaConstants.LDAP_SYNTAXES_AT );
+        String ldapSyntaxesOid = atRegistry.getOidByName( SchemaConstants.LDAP_SYNTAXES_AT );
         opAttr2handlerIndex.put( ldapSyntaxesOid, SYNTAX_INDEX );
 
-        String matchingRulesOid = atRegistry.getOid( SchemaConstants.MATCHING_RULES_AT );
+        String matchingRulesOid = atRegistry.getOidByName( SchemaConstants.MATCHING_RULES_AT );
         opAttr2handlerIndex.put( matchingRulesOid, MATCHING_RULE_INDEX );
 
-        String attributeTypesOid = atRegistry.getOid( SchemaConstants.ATTRIBUTE_TYPES_AT );
+        String attributeTypesOid = atRegistry.getOidByName( SchemaConstants.ATTRIBUTE_TYPES_AT );
         opAttr2handlerIndex.put( attributeTypesOid, ATTRIBUTE_TYPE_INDEX );
 
-        String objectClassesOid = atRegistry.getOid( SchemaConstants.OBJECT_CLASSES_AT );
+        String objectClassesOid = atRegistry.getOidByName( SchemaConstants.OBJECT_CLASSES_AT );
         opAttr2handlerIndex.put( objectClassesOid, OBJECT_CLASS_INDEX );
 
-        String matchingRuleUseOid = atRegistry.getOid( SchemaConstants.MATCHING_RULE_USE_AT );
+        String matchingRuleUseOid = atRegistry.getOidByName( SchemaConstants.MATCHING_RULE_USE_AT );
         opAttr2handlerIndex.put( matchingRuleUseOid, MATCHING_RULE_USE_INDEX );
 
-        String ditStructureRulesOid = atRegistry.getOid( SchemaConstants.DIT_STRUCTURE_RULES_AT );
+        String ditStructureRulesOid = atRegistry.getOidByName( SchemaConstants.DIT_STRUCTURE_RULES_AT );
         opAttr2handlerIndex.put( ditStructureRulesOid, DIT_STRUCTURE_RULE_INDEX );
 
-        String ditContentRulesOid = atRegistry.getOid( SchemaConstants.DIT_CONTENT_RULES_AT );
+        String ditContentRulesOid = atRegistry.getOidByName( SchemaConstants.DIT_CONTENT_RULES_AT );
         opAttr2handlerIndex.put( ditContentRulesOid, DIT_CONTENT_RULE_INDEX );
 
-        String nameFormsOid = atRegistry.getOid( SchemaConstants.NAME_FORMS_AT );
+        String nameFormsOid = atRegistry.getOidByName( SchemaConstants.NAME_FORMS_AT );
         opAttr2handlerIndex.put( nameFormsOid, NAME_FORM_INDEX );
         
         initHandlerMaps();
@@ -296,7 +295,7 @@
         for ( Value<?> value:oc )
         {
 
-            String oid = registries.getObjectClassRegistry().getOid( value.getString() );
+            String oid = registries.getObjectClassRegistry().getOidByName( value.getString() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
@@ -345,7 +344,7 @@
         
         for ( Value<?> value:oc )
         {
-            String oid = registries.getObjectClassRegistry().getOid( value.getString() );
+            String oid = registries.getObjectClassRegistry().getOidByName( value.getString() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
@@ -394,7 +393,7 @@
         
         for ( Value<?> value:oc )
         {
-            String oid = registries.getObjectClassRegistry().getOid( value.getString() );
+            String oid = registries.getObjectClassRegistry().getOidByName( value.getString() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
@@ -423,7 +422,7 @@
         
         for ( Value<?> value:oc )
         {
-            String oid = registries.getObjectClassRegistry().getOid( value.getString() );
+            String oid = registries.getObjectClassRegistry().getOidByName( value.getString() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
@@ -459,7 +458,7 @@
         
         for ( Value<?> value:oc )
         {
-            String oid = registries.getObjectClassRegistry().getOid( value.getString() );
+            String oid = registries.getObjectClassRegistry().getOidByName( value.getString() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
@@ -487,7 +486,7 @@
         
         for ( Value<?> value:oc )
         {
-            String oid = registries.getObjectClassRegistry().getOid( value.getString() );
+            String oid = registries.getObjectClassRegistry().getOidByName( value.getString() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
@@ -515,7 +514,7 @@
         
         for ( Value<?> value:oc )
         {
-            String oid = registries.getObjectClassRegistry().getOid( value.getString() );
+            String oid = registries.getObjectClassRegistry().getOidByName( value.getString() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
@@ -557,7 +556,7 @@
     {
         for ( Modification mod : opContext.getModItems() )
         {
-            String opAttrOid = registries.getAttributeTypeRegistry().getOid( mod.getAttribute().getId() );
+            String opAttrOid = registries.getAttributeTypeRegistry().getOidByName( mod.getAttribute().getId() );
             
             ServerAttribute serverAttribute = (ServerAttribute)mod.getAttribute();
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java Mon Aug 31 17:49:02 2009
@@ -27,7 +27,6 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -37,8 +36,8 @@
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.Partition;
-import org.apache.directory.server.schema.loader.ldif.SchemaEntityFactory;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
@@ -60,10 +59,10 @@
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
-import org.apache.directory.shared.ldap.schema.syntaxChecker.NumericOidSyntaxChecker;
+import org.apache.directory.shared.ldap.schema.syntaxCheckers.NumericOidSyntaxChecker;
 import org.apache.directory.shared.ldap.util.DateUtils;
+import org.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -100,7 +99,6 @@
 
     private final Partition partition;
     private final SchemaEntityFactory factory;
-    private final OidRegistry oidRegistry;
     private final AttributeTypeRegistry atRegistry;
 
     private final String M_NAME_OID;
@@ -133,26 +131,25 @@
     public SchemaPartitionDao( Partition partition, Registries registries ) throws Exception
     {
         this.partition = partition;
-        this.factory = new SchemaEntityFactory( registries );
-        this.oidRegistry = registries.getOidRegistry();
+        this.factory = new SchemaEntityFactory();
         this.atRegistry = registries.getAttributeTypeRegistry();
 
-        this.M_NAME_OID = atRegistry.getOid( MetaSchemaConstants.M_NAME_AT );
-        this.CN_OID = atRegistry.getOid( SchemaConstants.CN_AT );
+        this.M_NAME_OID = atRegistry.getOidByName( MetaSchemaConstants.M_NAME_AT );
+        this.CN_OID = atRegistry.getOidByName( SchemaConstants.CN_AT );
         this.disabledAttributeType = atRegistry.lookup( MetaSchemaConstants.M_DISABLED_AT );
-        this.M_OID_OID = atRegistry.getOid( MetaSchemaConstants.M_OID_AT );
-        this.OBJECTCLASS_OID = atRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT );
-        this.M_SYNTAX_OID = atRegistry.getOid( MetaSchemaConstants.M_SYNTAX_AT );
-        this.M_ORDERING_OID = atRegistry.getOid( MetaSchemaConstants.M_ORDERING_AT );
-        this.M_EQUALITY_OID = atRegistry.getOid( MetaSchemaConstants.M_EQUALITY_AT );
-        this.M_SUBSTRING_OID = atRegistry.getOid( MetaSchemaConstants.M_SUBSTR_AT );
-        this.M_SUP_ATTRIBUTE_TYPE_OID = atRegistry.getOid( MetaSchemaConstants.M_SUP_ATTRIBUTE_TYPE_AT );
-        this.M_MUST_OID = atRegistry.getOid( MetaSchemaConstants.M_MUST_AT );
-        this.M_MAY_OID = atRegistry.getOid( MetaSchemaConstants.M_MAY_AT );
-        this.M_AUX_OID = atRegistry.getOid( MetaSchemaConstants.M_AUX_AT );
-        this.M_OC_OID = atRegistry.getOid( MetaSchemaConstants.M_OC_AT );
-        this.M_SUP_OBJECT_CLASS_OID = atRegistry.getOid( MetaSchemaConstants.M_SUP_OBJECT_CLASS_AT );
-        this.M_DEPENDENCIES_OID = atRegistry.getOid( MetaSchemaConstants.M_DEPENDENCIES_AT );
+        this.M_OID_OID = atRegistry.getOidByName( MetaSchemaConstants.M_OID_AT );
+        this.OBJECTCLASS_OID = atRegistry.getOidByName( SchemaConstants.OBJECT_CLASS_AT );
+        this.M_SYNTAX_OID = atRegistry.getOidByName( MetaSchemaConstants.M_SYNTAX_AT );
+        this.M_ORDERING_OID = atRegistry.getOidByName( MetaSchemaConstants.M_ORDERING_AT );
+        this.M_EQUALITY_OID = atRegistry.getOidByName( MetaSchemaConstants.M_EQUALITY_AT );
+        this.M_SUBSTRING_OID = atRegistry.getOidByName( MetaSchemaConstants.M_SUBSTR_AT );
+        this.M_SUP_ATTRIBUTE_TYPE_OID = atRegistry.getOidByName( MetaSchemaConstants.M_SUP_ATTRIBUTE_TYPE_AT );
+        this.M_MUST_OID = atRegistry.getOidByName( MetaSchemaConstants.M_MUST_AT );
+        this.M_MAY_OID = atRegistry.getOidByName( MetaSchemaConstants.M_MAY_AT );
+        this.M_AUX_OID = atRegistry.getOidByName( MetaSchemaConstants.M_AUX_AT );
+        this.M_OC_OID = atRegistry.getOidByName( MetaSchemaConstants.M_OC_AT );
+        this.M_SUP_OBJECT_CLASS_OID = atRegistry.getOidByName( MetaSchemaConstants.M_SUP_OBJECT_CLASS_AT );
+        this.M_DEPENDENCIES_OID = atRegistry.getOidByName( MetaSchemaConstants.M_DEPENDENCIES_AT );
         
         for ( String attrId : SCHEMA_ATTRIBUTES )
         {
@@ -197,7 +194,7 @@
     {
         LdapDN base = new LdapDN( ServerDNConstants.OU_SCHEMA_DN );
         base.normalize( atRegistry.getNormalizerMapping() );
-        ExprNode filter = new EqualityNode<String>( atRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT ),
+        ExprNode filter = new EqualityNode<String>( atRegistry.getOidByName( SchemaConstants.OBJECT_CLASS_AT ),
             new ClientStringValue( MetaSchemaConstants.META_SCHEMA_OC ) );
 
         SearchOperationContext searchContext = new SearchOperationContext( null );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Mon Aug 31 17:49:02 2009
@@ -512,7 +512,7 @@
                 }
                 else
                 {
-                    setOids.add( registries.getAttributeTypeRegistry().getOid( id ) );
+                    setOids.add( registries.getAttributeTypeRegistry().getOidByName( id ) );
                 }
             }
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java Mon Aug 31 17:49:02 2009
@@ -27,7 +27,6 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.authn.AuthenticationInterceptor;
 import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
@@ -37,6 +36,7 @@
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
 import org.apache.directory.server.utils.AttributesFactory;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.name.LdapDN;

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=809674&r1=809673&r2=809674&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Mon Aug 31 17:49:02 2009
@@ -146,7 +146,7 @@
         oidRegistry = registries.getOidRegistry();
 
         // setup various attribute type values
-        objectClassType = atRegistry.lookup( atRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT ) );
+        objectClassType = atRegistry.lookup( atRegistry.getOidByName( SchemaConstants.OBJECT_CLASS_AT ) );
 
         ssParser = new SubtreeSpecificationParser( new NormalizerMappingResolver()
         {
@@ -612,7 +612,7 @@
             LdapDN baseDn = ( LdapDN ) apName.clone();
             baseDn.addAll( ss.getBase() );
 
-            ExprNode filter = new PresenceNode( atRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT ) );
+            ExprNode filter = new PresenceNode( atRegistry.getOidByName( SchemaConstants.OBJECT_CLASS_AT ) );
             SearchControls controls = new SearchControls();
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]
@@ -772,7 +772,7 @@
             next.rename( opContext );
 
             subentry = subentryCache.getSubentry( newNormName );
-            ExprNode filter = new PresenceNode( atRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT ) );
+            ExprNode filter = new PresenceNode( atRegistry.getOidByName( SchemaConstants.OBJECT_CLASS_AT ) );
             SearchControls controls = new SearchControls();
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]
@@ -849,7 +849,7 @@
 
             subentry = subentryCache.getSubentry( newNormName );
 
-            ExprNode filter = new PresenceNode( atRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT ) );
+            ExprNode filter = new PresenceNode( atRegistry.getOidByName( SchemaConstants.OBJECT_CLASS_AT ) );
             SearchControls controls = new SearchControls();
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]
@@ -1057,7 +1057,7 @@
             apName.remove( apName.size() - 1 );
             LdapDN oldBaseDn = ( LdapDN ) apName.clone();
             oldBaseDn.addAll( ssOld.getBase() );
-            ExprNode filter = new PresenceNode( atRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT ) );
+            ExprNode filter = new PresenceNode( atRegistry.getOidByName( SchemaConstants.OBJECT_CLASS_AT ) );
             SearchControls controls = new SearchControls();
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]



Mime
View raw message