You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2007/01/25 03:29:02 UTC

svn commit: r499644 [1/2] - in /directory/apacheds/trunk: bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/ constants/src/main/java/org/apache/directory/server/constants/ core-unit/src/test/java/org/apache/directory/serv...

Author: akarasulu
Date: Wed Jan 24 18:29:00 2007
New Revision: 499644

URL: http://svn.apache.org/viewvc?view=rev&rev=499644
Log:
making schema objects store the name of the schema they are defined in

Modified:
    directory/apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java
    directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/CoreSchemaConstants.java
    directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/MetaSchemaConstants.java
    directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/SystemSchemaConstants.java
    directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerITest.java
    directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerITest.java
    directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerITest.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeImpl.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleImpl.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SyntaxImpl.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
    directory/apacheds/trunk/schema-bootstrap/pom.xml
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdNormalizer.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITContentRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITStructureRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitContentRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitStructureRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleUseRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNameFormRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleUseRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NameFormRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java

Modified: directory/apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java (original)
+++ directory/apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java Wed Jan 24 18:29:00 2007
@@ -459,9 +459,8 @@
         while ( ii.hasNext() )
         {
             Syntax syntax = ( Syntax ) ii.next();
-            String schemaName = syntaxRegistry.getSchemaName( syntax.getOid() );
-            getLog().info( "\t\t o [" + schemaName + "] - " + getNameOrNumericoid( syntax ) );
-            LdapDN dn = checkCreateSchema( schemaName );
+            getLog().info( "\t\t o [" + syntax.getSchema() + "] - " + getNameOrNumericoid( syntax ) );
+            LdapDN dn = checkCreateSchema( syntax.getSchema() );
             dn.add( CoreSchemaConstants.OU_AT + "=syntaxes" );
             dn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
             checkCreateContainer( dn );

Modified: directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/CoreSchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/CoreSchemaConstants.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/CoreSchemaConstants.java (original)
+++ directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/CoreSchemaConstants.java Wed Jan 24 18:29:00 2007
@@ -28,6 +28,8 @@
  */
 public interface CoreSchemaConstants
 {
+    public static final String SCHEMA_NAME = "core";
+
     public static final String OU_AT = "ou";
     public static final String ORGANIZATIONAL_UNIT_OC = "organizationalUnit";
 }

Modified: directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/MetaSchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/MetaSchemaConstants.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/MetaSchemaConstants.java (original)
+++ directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/MetaSchemaConstants.java Wed Jan 24 18:29:00 2007
@@ -28,6 +28,8 @@
  */
 public interface MetaSchemaConstants
 {
+    public static final String SCHEMA_NAME = "apachemeta";
+
     public static final String META_TOP_OC = "metaTop";
     public static final String META_SCHEMA_OC = "metaSchema";
     public static final String META_OBJECT_CLASS_OC = "metaObjectClass";

Modified: directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/SystemSchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/SystemSchemaConstants.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/SystemSchemaConstants.java (original)
+++ directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/SystemSchemaConstants.java Wed Jan 24 18:29:00 2007
@@ -28,6 +28,7 @@
  */
 public interface SystemSchemaConstants
 {
+    public static final String SCHEMA_NAME = "system";
 
     public static final String CN_AT = "cn";
     public static final String OBJECT_CLASS_AT = "objectClass";

Modified: directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerITest.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerITest.java (original)
+++ directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerITest.java Wed Jan 24 18:29:00 2007
@@ -280,7 +280,7 @@
         LdapDN dn = getComparatorContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
         testAddComparator();
-        registries.getMatchingRuleRegistry().register( "apachemeta", new DummyMR() );
+        registries.getMatchingRuleRegistry().register( new DummyMR() );
         
         try
         {
@@ -300,7 +300,7 @@
     public void testMoveComparatorWhenInUse() throws NamingException
     {
         testAddComparator();
-        registries.getMatchingRuleRegistry().register( "apachemeta", new DummyMR() );
+        registries.getMatchingRuleRegistry().register( new DummyMR() );
         
         LdapDN dn = getComparatorContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
@@ -326,7 +326,7 @@
     public void testMoveComparatorAndChangeRdnWhenInUse() throws NamingException
     {
         testAddComparator();
-        registries.getMatchingRuleRegistry().register( "apachemeta", new DummyMR() );
+        registries.getMatchingRuleRegistry().register( new DummyMR() );
         
         LdapDN dn = getComparatorContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
@@ -354,7 +354,7 @@
         LdapDN dn = getComparatorContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
         testAddComparator();
-        registries.getMatchingRuleRegistry().register( "apachemeta", new DummyMR() );
+        registries.getMatchingRuleRegistry().register( new DummyMR() );
         
         LdapDN newdn = getComparatorContainer( "apachemeta" );
         newdn.add( MetaSchemaConstants.M_OID_AT + "=" + NEW_OID );
@@ -535,6 +535,10 @@
         {
             return false;
         }
-        
+
+        public String getSchema()
+        {
+            return null;
+        }
     }
 }

Modified: directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerITest.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerITest.java (original)
+++ directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerITest.java Wed Jan 24 18:29:00 2007
@@ -279,7 +279,7 @@
         LdapDN dn = getNormalizerContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
         testAddNormalizer();
-        registries.getMatchingRuleRegistry().register( "apachemeta", new DummyMR() );
+        registries.getMatchingRuleRegistry().register( new DummyMR() );
         
         try
         {
@@ -299,7 +299,7 @@
     public void testMoveNormalizerWhenInUse() throws NamingException
     {
         testAddNormalizer();
-        registries.getMatchingRuleRegistry().register( "apachemeta", new DummyMR() );
+        registries.getMatchingRuleRegistry().register( new DummyMR() );
         
         LdapDN dn = getNormalizerContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
@@ -325,7 +325,7 @@
     public void testMoveNormalizerAndChangeRdnWhenInUse() throws NamingException
     {
         testAddNormalizer();
-        registries.getMatchingRuleRegistry().register( "apachemeta", new DummyMR() );
+        registries.getMatchingRuleRegistry().register( new DummyMR() );
         
         LdapDN dn = getNormalizerContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
@@ -353,7 +353,7 @@
         LdapDN dn = getNormalizerContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
         testAddNormalizer();
-        registries.getMatchingRuleRegistry().register( "apachemeta", new DummyMR() );
+        registries.getMatchingRuleRegistry().register( new DummyMR() );
         
         LdapDN newdn = getNormalizerContainer( "apachemeta" );
         newdn.add( MetaSchemaConstants.M_OID_AT + "=" + NEW_OID );
@@ -534,6 +534,10 @@
         {
             return false;
         }
-        
+
+        public String getSchema()
+        {
+            return null;
+        }
     }
 }

Modified: directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerITest.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerITest.java (original)
+++ directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerITest.java Wed Jan 24 18:29:00 2007
@@ -276,7 +276,7 @@
         LdapDN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
         testAddSyntaxChecker();
-        registries.getSyntaxRegistry().register( "apachemeta", new DummySyntax() );
+        registries.getSyntaxRegistry().register( new DummySyntax() );
         
         try
         {
@@ -296,7 +296,7 @@
     public void testMoveSyntaxCheckerWhenInUse() throws NamingException
     {
         testAddSyntaxChecker();
-        registries.getSyntaxRegistry().register( "apachemeta", new DummySyntax() );
+        registries.getSyntaxRegistry().register( new DummySyntax() );
         
         LdapDN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
@@ -322,7 +322,7 @@
     public void testMoveSyntaxCheckerAndChangeRdnWhenInUse() throws NamingException
     {
         testAddSyntaxChecker();
-        registries.getSyntaxRegistry().register( "apachemeta", new DummySyntax() );
+        registries.getSyntaxRegistry().register( new DummySyntax() );
         
         LdapDN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
@@ -350,7 +350,7 @@
         LdapDN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( MetaSchemaConstants.M_OID_AT + "=" + OID );
         testAddSyntaxChecker();
-        registries.getSyntaxRegistry().register( "apachemeta", new DummySyntax() );
+        registries.getSyntaxRegistry().register( new DummySyntax() );
         
         LdapDN newdn = getSyntaxCheckerContainer( "apachemeta" );
         newdn.add( MetaSchemaConstants.M_OID_AT + "=" + NEW_OID );
@@ -548,6 +548,11 @@
         public boolean isHumanReadible()
         {
             return false;
+        }
+
+        public String getSchema()
+        {
+            return null;
         }
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeImpl.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeImpl.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AttributeTypeImpl.java Wed Jan 24 18:29:00 2007
@@ -133,6 +133,12 @@
     }
     
     
+    public void setSchema( String schema )
+    {
+        super.setSchema( schema );
+    }
+    
+    
     public void setSuperiorOid( String superiorOid )
     {
         this.superiorOid = superiorOid;

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleImpl.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleImpl.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleImpl.java Wed Jan 24 18:29:00 2007
@@ -74,6 +74,12 @@
         return normalizerRegistry.lookup( oid );
     }
     
+    
+    public void setSchema( String schema )
+    {
+        super.setSchema( schema );
+    }
+    
 
     public void setDescription( String description )
     {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java Wed Jan 24 18:29:00 2007
@@ -67,13 +67,13 @@
     protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
     {
         String oldOid = getOid( entry );
-        AttributeType at = factory.getAttributeType( targetEntry, targetRegistries );
         Schema schema = getSchema( name );
+        AttributeType at = factory.getAttributeType( targetEntry, targetRegistries, schema.getSchemaName() );
         
         if ( ! schema.isDisabled() )
         {
             attributeTypeRegistry.unregister( oldOid );
-            attributeTypeRegistry.register( schema.getSchemaName(), at );
+            attributeTypeRegistry.register( at );
         }
     }
 
@@ -84,12 +84,12 @@
         parentDn.remove( parentDn.size() - 1 );
         checkNewParent( parentDn );
         
-        AttributeType at = factory.getAttributeType( entry, targetRegistries );
         Schema schema = getSchema( name );
+        AttributeType at = factory.getAttributeType( entry, targetRegistries, schema.getSchemaName() );
         
         if ( ! schema.isDisabled() )
         {
-            attributeTypeRegistry.register( schema.getSchemaName(), at );
+            attributeTypeRegistry.register( at );
         }
         else
         {
@@ -100,7 +100,8 @@
 
     public void delete( LdapDN name, Attributes entry ) throws NamingException
     {
-        AttributeType at = factory.getAttributeType( entry, targetRegistries );
+        Schema schema = getSchema( name );
+        AttributeType at = factory.getAttributeType( entry, targetRegistries, schema.getSchemaName() );
         Set<SearchResult> dependees = dao.listAttributeTypeDependees( at );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -111,8 +112,6 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
         
-        Schema schema = getSchema( name );
-        
         if ( ! schema.isDisabled() )
         {
             attributeTypeRegistry.unregister( at.getOid() );
@@ -123,7 +122,8 @@
 
     public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
     {
-        AttributeType oldAt = factory.getAttributeType( entry, targetRegistries );
+        Schema schema = getSchema( name );
+        AttributeType oldAt = factory.getAttributeType( entry, targetRegistries, schema.getSchemaName() );
         Set<SearchResult> dependees = dao.listAttributeTypeDependees( oldAt );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -134,16 +134,15 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Schema schema = getSchema( name );
         Attributes targetEntry = ( Attributes ) entry.clone();
         String newOid = NamespaceTools.getRdnValue( newRdn );
         targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
-        AttributeType at = factory.getAttributeType( targetEntry, targetRegistries );
+        AttributeType at = factory.getAttributeType( targetEntry, targetRegistries, schema.getSchemaName() );
 
         if ( ! schema.isDisabled() )
         {
             attributeTypeRegistry.unregister( oldAt.getOid() );
-            attributeTypeRegistry.register( schema.getSchemaName(), at );
+            attributeTypeRegistry.register( at );
         }
         else
         {
@@ -158,7 +157,8 @@
         throws NamingException
     {
         checkNewParent( newParentName );
-        AttributeType oldAt = factory.getAttributeType( entry, targetRegistries );
+        Schema oldSchema = getSchema( oriChildName );
+        AttributeType oldAt = factory.getAttributeType( entry, targetRegistries, oldSchema.getSchemaName() );
         Set<SearchResult> dependees = dao.listAttributeTypeDependees( oldAt );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -169,12 +169,11 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Schema oldSchema = getSchema( oriChildName );
         Schema newSchema = getSchema( newParentName );
         Attributes targetEntry = ( Attributes ) entry.clone();
         String newOid = NamespaceTools.getRdnValue( newRn );
         targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
-        AttributeType at = factory.getAttributeType( targetEntry, targetRegistries );
+        AttributeType at = factory.getAttributeType( targetEntry, targetRegistries, newSchema.getSchemaName() );
 
         if ( ! oldSchema.isDisabled() )
         {
@@ -184,7 +183,7 @@
 
         if ( ! newSchema.isDisabled() )
         {
-            attributeTypeRegistry.register( newSchema.getSchemaName(), at );
+            attributeTypeRegistry.register( at );
         }
         else
         {
@@ -197,7 +196,8 @@
         throws NamingException
     {
         checkNewParent( newParentName );
-        AttributeType oldAt = factory.getAttributeType( entry, targetRegistries );
+        Schema oldSchema = getSchema( oriChildName );
+        AttributeType oldAt = factory.getAttributeType( entry, targetRegistries, oldSchema.getSchemaName() );
         Set<SearchResult> dependees = dao.listAttributeTypeDependees( oldAt );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -208,10 +208,8 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Schema oldSchema = getSchema( oriChildName );
         Schema newSchema = getSchema( newParentName );
-        
-        AttributeType at = factory.getAttributeType( entry, targetRegistries );
+        AttributeType at = factory.getAttributeType( entry, targetRegistries, newSchema.getSchemaName() );
         
         if ( ! oldSchema.isDisabled() )
         {
@@ -220,7 +218,7 @@
         
         if ( ! newSchema.isDisabled() )
         {
-            attributeTypeRegistry.register( newSchema.getSchemaName(), at );
+            attributeTypeRegistry.register( at );
         }
     }
     

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java Wed Jan 24 18:29:00 2007
@@ -66,13 +66,13 @@
     protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
     {
         String oldOid = getOid( entry );
-        MatchingRule mr = factory.getMatchingRule( targetEntry, targetRegistries );
         Schema schema = getSchema( name );
+        MatchingRule mr = factory.getMatchingRule( targetEntry, targetRegistries, schema.getSchemaName() );
         
         if ( ! schema.isDisabled() )
         {
             matchingRuleRegistry.unregister( oldOid );
-            matchingRuleRegistry.register( schema.getSchemaName(), mr );
+            matchingRuleRegistry.register( mr );
         }
     }
 
@@ -83,12 +83,12 @@
         parentDn.remove( parentDn.size() - 1 );
         checkNewParent( parentDn );
         
-        MatchingRule mr = factory.getMatchingRule( entry, targetRegistries );
         Schema schema = getSchema( name );
+        MatchingRule mr = factory.getMatchingRule( entry, targetRegistries, schema.getSchemaName() );
         
         if ( ! schema.isDisabled() )
         {
-            matchingRuleRegistry.register( schema.getSchemaName(), mr );
+            matchingRuleRegistry.register( mr );
         }
         else
         {
@@ -99,7 +99,8 @@
 
     public void delete( LdapDN name, Attributes entry ) throws NamingException
     {
-        MatchingRule mr = factory.getMatchingRule( entry, targetRegistries );
+        Schema schema = getSchema( name );
+        MatchingRule mr = factory.getMatchingRule( entry, targetRegistries, schema.getSchemaName() );
         Set<SearchResult> dependees = dao.listMatchingRuleDependees( mr );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -110,8 +111,6 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
         
-        Schema schema = getSchema( name );
-        
         if ( ! schema.isDisabled() )
         {
             matchingRuleRegistry.unregister( mr.getOid() );
@@ -122,7 +121,8 @@
 
     public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
     {
-        MatchingRule oldMr = factory.getMatchingRule( entry, targetRegistries );
+        Schema schema = getSchema( name );
+        MatchingRule oldMr = factory.getMatchingRule( entry, targetRegistries, schema.getSchemaName() );
         Set<SearchResult> dependees = dao.listMatchingRuleDependees( oldMr );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -133,16 +133,15 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Schema schema = getSchema( name );
         Attributes targetEntry = ( Attributes ) entry.clone();
         String newOid = NamespaceTools.getRdnValue( newRdn );
         targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
-        MatchingRule mr = factory.getMatchingRule( targetEntry, targetRegistries );
+        MatchingRule mr = factory.getMatchingRule( targetEntry, targetRegistries, schema.getSchemaName() );
 
         if ( ! schema.isDisabled() )
         {
             matchingRuleRegistry.unregister( oldMr.getOid() );
-            matchingRuleRegistry.register( schema.getSchemaName(), mr );
+            matchingRuleRegistry.register( mr );
         }
         else
         {
@@ -157,7 +156,8 @@
         throws NamingException
     {
         checkNewParent( newParentName );
-        MatchingRule oldMr = factory.getMatchingRule( entry, targetRegistries );
+        Schema oldSchema = getSchema( oriChildName );
+        MatchingRule oldMr = factory.getMatchingRule( entry, targetRegistries, oldSchema.getSchemaName() );
         Set<SearchResult> dependees = dao.listMatchingRuleDependees( oldMr );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -168,12 +168,11 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Schema oldSchema = getSchema( oriChildName );
         Schema newSchema = getSchema( newParentName );
         Attributes targetEntry = ( Attributes ) entry.clone();
         String newOid = NamespaceTools.getRdnValue( newRn );
         targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
-        MatchingRule mr = factory.getMatchingRule( targetEntry, targetRegistries );
+        MatchingRule mr = factory.getMatchingRule( targetEntry, targetRegistries, newSchema.getSchemaName() );
 
         if ( ! oldSchema.isDisabled() )
         {
@@ -183,7 +182,7 @@
 
         if ( ! newSchema.isDisabled() )
         {
-            matchingRuleRegistry.register( newSchema.getSchemaName(), mr );
+            matchingRuleRegistry.register( mr );
         }
         else
         {
@@ -196,7 +195,8 @@
         throws NamingException
     {
         checkNewParent( newParentName );
-        MatchingRule oldMr = factory.getMatchingRule( entry, targetRegistries );
+        Schema oldSchema = getSchema( oriChildName );
+        MatchingRule oldMr = factory.getMatchingRule( entry, targetRegistries, oldSchema.getSchemaName() );
         Set<SearchResult> dependees = dao.listMatchingRuleDependees( oldMr );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -207,10 +207,8 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Schema oldSchema = getSchema( oriChildName );
         Schema newSchema = getSchema( newParentName );
-        
-        MatchingRule mr = factory.getMatchingRule( entry, targetRegistries );
+        MatchingRule mr = factory.getMatchingRule( entry, targetRegistries, newSchema.getSchemaName() );
         
         if ( ! oldSchema.isDisabled() )
         {
@@ -219,7 +217,7 @@
         
         if ( ! newSchema.isDisabled() )
         {
-            matchingRuleRegistry.register( newSchema.getSchemaName(), mr );
+            matchingRuleRegistry.register( mr );
         }
     }
     

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java Wed Jan 24 18:29:00 2007
@@ -66,13 +66,13 @@
     protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
     {
         String oldOid = getOid( entry );
-        ObjectClass oc = factory.getObjectClass( targetEntry, targetRegistries );
         Schema schema = getSchema( name );
+        ObjectClass oc = factory.getObjectClass( targetEntry, targetRegistries, schema.getSchemaName() );
 
         if ( ! schema.isDisabled() )
         {
             objectClassRegistry.unregister( oldOid );
-            objectClassRegistry.register( schema.getSchemaName(), oc );
+            objectClassRegistry.register( oc );
         }
     }
 
@@ -83,12 +83,12 @@
         parentDn.remove( parentDn.size() - 1 );
         checkNewParent( parentDn );
         
-        ObjectClass oc = factory.getObjectClass( entry, targetRegistries );
         Schema schema = getSchema( name );
+        ObjectClass oc = factory.getObjectClass( entry, targetRegistries, schema.getSchemaName() );
         
         if ( ! schema.isDisabled() )
         {
-            objectClassRegistry.register( schema.getSchemaName(), oc );
+            objectClassRegistry.register( oc );
         }
         else
         {
@@ -99,7 +99,8 @@
 
     public void delete( LdapDN name, Attributes entry ) throws NamingException
     {
-        ObjectClass oc = factory.getObjectClass( entry, targetRegistries );
+        Schema schema = getSchema( name );
+        ObjectClass oc = factory.getObjectClass( entry, targetRegistries, schema.getSchemaName() );
         Set<SearchResult> dependees = dao.listObjectClassDependees( oc );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -110,8 +111,6 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
         
-        Schema schema = getSchema( name );
-        
         if ( ! schema.isDisabled() )
         {
             objectClassRegistry.unregister( oc.getOid() );
@@ -123,7 +122,8 @@
 
     public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
     {
-        ObjectClass oldOc = factory.getObjectClass( entry, targetRegistries );
+        Schema schema = getSchema( name );
+        ObjectClass oldOc = factory.getObjectClass( entry, targetRegistries, schema.getSchemaName() );
         Set<SearchResult> dependees = dao.listObjectClassDependees( oldOc );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -134,16 +134,15 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Schema schema = getSchema( name );
         Attributes targetEntry = ( Attributes ) entry.clone();
         String newOid = NamespaceTools.getRdnValue( newRdn );
         targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
-        ObjectClass oc = factory.getObjectClass( targetEntry, targetRegistries );
+        ObjectClass oc = factory.getObjectClass( targetEntry, targetRegistries, schema.getSchemaName() );
 
         if ( ! schema.isDisabled() )
         {
             objectClassRegistry.unregister( oldOc.getOid() );
-            objectClassRegistry.register( schema.getSchemaName(), oc );
+            objectClassRegistry.register( oc );
         }
         else
         {
@@ -158,7 +157,8 @@
         throws NamingException
     {
         checkNewParent( newParentName );
-        ObjectClass oldOc = factory.getObjectClass( entry, targetRegistries );
+        Schema oldSchema = getSchema( oriChildName );
+        ObjectClass oldOc = factory.getObjectClass( entry, targetRegistries, oldSchema.getSchemaName() );
         Set<SearchResult> dependees = dao.listObjectClassDependees( oldOc );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -169,12 +169,11 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Schema oldSchema = getSchema( oriChildName );
         Schema newSchema = getSchema( newParentName );
         Attributes targetEntry = ( Attributes ) entry.clone();
         String newOid = NamespaceTools.getRdnValue( newRn );
         targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
-        ObjectClass oc = factory.getObjectClass( targetEntry, targetRegistries );
+        ObjectClass oc = factory.getObjectClass( targetEntry, targetRegistries, newSchema.getSchemaName() );
 
         if ( ! oldSchema.isDisabled() )
         {
@@ -184,7 +183,7 @@
         
         if ( ! newSchema.isDisabled() )
         {
-            objectClassRegistry.register( newSchema.getSchemaName(), oc );
+            objectClassRegistry.register( oc );
         }
         else
         {
@@ -197,7 +196,8 @@
         throws NamingException
     {
         checkNewParent( newParentName );
-        ObjectClass oldAt = factory.getObjectClass( entry, targetRegistries );
+        Schema oldSchema = getSchema( oriChildName );
+        ObjectClass oldAt = factory.getObjectClass( entry, targetRegistries, oldSchema.getSchemaName() );
         Set<SearchResult> dependees = dao.listObjectClassDependees( oldAt );
         if ( dependees != null && dependees.size() > 0 )
         {
@@ -208,10 +208,8 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Schema oldSchema = getSchema( oriChildName );
         Schema newSchema = getSchema( newParentName );
-        
-        ObjectClass oc = factory.getObjectClass( entry, targetRegistries );
+        ObjectClass oc = factory.getObjectClass( entry, targetRegistries, newSchema.getSchemaName() );
         
         if ( ! oldSchema.isDisabled() )
         {
@@ -220,7 +218,7 @@
         
         if ( ! newSchema.isDisabled() )
         {
-            objectClassRegistry.register( newSchema.getSchemaName(), oc );
+            objectClassRegistry.register( oc );
         }
     }
     

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java Wed Jan 24 18:29:00 2007
@@ -66,13 +66,13 @@
     protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
     {
         String oldOid = getOid( entry );
-        Syntax syntax = factory.getSyntax( targetEntry, targetRegistries );
         Schema schema = getSchema( name );
+        Syntax syntax = factory.getSyntax( targetEntry, targetRegistries, schema.getSchemaName() );
         
         if ( ! schema.isDisabled() )
         {
             syntaxRegistry.unregister( oldOid );
-            syntaxRegistry.register( schema.getSchemaName(), syntax );
+            syntaxRegistry.register( syntax );
         }
     }
 
@@ -83,12 +83,12 @@
         parentDn.remove( parentDn.size() - 1 );
         checkNewParent( parentDn );
         
-        Syntax syntax = factory.getSyntax( entry, targetRegistries );
         Schema schema = getSchema( name );
+        Syntax syntax = factory.getSyntax( entry, targetRegistries, schema.getSchemaName() );
         
         if ( ! schema.isDisabled() )
         {
-            syntaxRegistry.register( schema.getSchemaName(), syntax );
+            syntaxRegistry.register( syntax );
         }
         else
         {
@@ -141,12 +141,12 @@
         Attributes targetEntry = ( Attributes ) entry.clone();
         String newOid = NamespaceTools.getRdnValue( newRdn );
         targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
-        Syntax syntax = factory.getSyntax( targetEntry, targetRegistries );
+        Syntax syntax = factory.getSyntax( targetEntry, targetRegistries, schema.getSchemaName() );
         
         if ( ! schema.isDisabled() )
         {
             syntaxRegistry.unregister( oldOid );
-            syntaxRegistry.register( schema.getSchemaName(), syntax );
+            syntaxRegistry.register( syntax );
         }
         else
         {
@@ -180,7 +180,7 @@
         Attributes targetEntry = ( Attributes ) entry.clone();
         String newOid = NamespaceTools.getRdnValue( newRn );
         targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
-        Syntax syntax = factory.getSyntax( targetEntry, targetRegistries );
+        Syntax syntax = factory.getSyntax( targetEntry, targetRegistries, newSchema.getSchemaName() );
 
         if ( ! oldSchema.isDisabled() )
         {
@@ -191,7 +191,7 @@
 
         if ( ! newSchema.isDisabled() )
         {
-            syntaxRegistry.register( newSchema.getSchemaName(), syntax );
+            syntaxRegistry.register( syntax );
         }
         else
         {
@@ -220,7 +220,7 @@
         Schema oldSchema = getSchema( oriChildName );
         Schema newSchema = getSchema( newParentName );
         
-        Syntax syntax = factory.getSyntax( entry, targetRegistries );
+        Syntax syntax = factory.getSyntax( entry, targetRegistries, newSchema.getSchemaName() );
         
         if ( ! oldSchema.isDisabled() )
         {
@@ -229,7 +229,7 @@
         
         if ( ! newSchema.isDisabled() )
         {
-            syntaxRegistry.register( newSchema.getSchemaName(), syntax );
+            syntaxRegistry.register( syntax );
         }
     }
     

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java Wed Jan 24 18:29:00 2007
@@ -79,6 +79,12 @@
     }
 
     
+    public void setSchema( String schema )
+    {
+        super.setSchema( schema );
+    }
+    
+    
     public AttributeType[] getMayList() throws NamingException
     {
         if ( this.mayListOids == null )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java Wed Jan 24 18:29:00 2007
@@ -277,11 +277,11 @@
             LdapDN resultDN = new LdapDN( result.getName() );
             resultDN.normalize( attrRegistry.getNormalizerMapping() );
             Attributes attrs = partition.lookup( resultDN );
-            ObjectClass oc = factory.getObjectClass( attrs, targetRegistries );
+            ObjectClass oc = factory.getObjectClass( attrs, targetRegistries, schema.getSchemaName() );
             
             try
             {
-                targetRegistries.getObjectClassRegistry().register( schema.getSchemaName(), oc );
+                targetRegistries.getObjectClassRegistry().register( oc );
             }
             catch ( NamingException ne )
             {
@@ -314,7 +314,7 @@
             
             try
             {
-                targetRegistries.getObjectClassRegistry().register( schema.getSchemaName(), oc );
+                targetRegistries.getObjectClassRegistry().register( oc );
             }
             catch ( NamingException ne )
             {
@@ -370,10 +370,10 @@
             LdapDN resultDN = new LdapDN( result.getName() );
             resultDN.normalize( attrRegistry.getNormalizerMapping() );
             Attributes attrs = partition.lookup( resultDN );
-            AttributeType at = factory.getAttributeType( attrs, targetRegistries );
+            AttributeType at = factory.getAttributeType( attrs, targetRegistries, schema.getSchemaName() );
             try
             {
-                targetRegistries.getAttributeTypeRegistry().register( schema.getSchemaName(), at );
+                targetRegistries.getAttributeTypeRegistry().register( at );
             }
             catch ( NamingException ne )
             {
@@ -406,7 +406,7 @@
             
             try
             {
-                targetRegistries.getAttributeTypeRegistry().register( schema.getSchemaName(), at );
+                targetRegistries.getAttributeTypeRegistry().register( at );
             }
             catch ( NamingException ne )
             {
@@ -461,8 +461,8 @@
             LdapDN resultDN = new LdapDN( result.getName() );
             resultDN.normalize( attrRegistry.getNormalizerMapping() );
             Attributes attrs = partition.lookup( resultDN );
-            MatchingRule mrule = factory.getMatchingRule( attrs, targetRegistries );
-            targetRegistries.getMatchingRuleRegistry().register( schema.getSchemaName(), mrule );
+            MatchingRule mrule = factory.getMatchingRule( attrs, targetRegistries, schema.getSchemaName() );
+            targetRegistries.getMatchingRuleRegistry().register( mrule );
 
         }
     }
@@ -487,8 +487,8 @@
             LdapDN resultDN = new LdapDN( result.getName() );
             resultDN.normalize( attrRegistry.getNormalizerMapping() );
             Attributes attrs = partition.lookup( resultDN );
-            Syntax syntax = factory.getSyntax( attrs, targetRegistries );
-            targetRegistries.getSyntaxRegistry().register( schema.getSchemaName(), syntax );
+            Syntax syntax = factory.getSyntax( attrs, targetRegistries, schema.getSchemaName() );
+            targetRegistries.getSyntaxRegistry().register( syntax );
         }
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java Wed Jan 24 18:29:00 2007
@@ -518,10 +518,11 @@
     }
 
 
-    public Syntax getSyntax( Attributes entry, Registries targetRegistries ) throws NamingException
+    public Syntax getSyntax( Attributes entry, Registries targetRegistries, String schema ) throws NamingException
     {
         String oid = ( String ) entry.get( MetaSchemaConstants.M_OID_AT ).get();
         SyntaxImpl syntax = new SyntaxImpl( oid, targetRegistries.getSyntaxCheckerRegistry() );
+        syntax.setSchema( schema );
         
         if ( entry.get( MetaSchemaConstants.X_HUMAN_READIBLE_AT ) != null )
         {
@@ -538,11 +539,12 @@
     }
 
     
-    public MatchingRule getMatchingRule( Attributes entry, Registries targetRegistries ) throws NamingException
+    public MatchingRule getMatchingRule( Attributes entry, Registries targetRegistries, String schema ) throws NamingException
     {
         String oid = ( String ) entry.get( MetaSchemaConstants.M_OID_AT ).get();
         String syntaxOid = ( String ) entry.get( MetaSchemaConstants.M_SYNTAX_AT ).get();
         MatchingRuleImpl mr = new MatchingRuleImpl( oid, syntaxOid, targetRegistries );
+        mr.setSchema( schema );
         setSchemaObjectProperties( mr, entry );
         return mr;
     }
@@ -564,10 +566,11 @@
     }
     
     
-    public ObjectClass getObjectClass( Attributes entry, Registries targetRegistries ) throws NamingException
+    public ObjectClass getObjectClass( Attributes entry, Registries targetRegistries, String schema ) throws NamingException
     {
         String oid = ( String ) entry.get( MetaSchemaConstants.M_OID_AT ).get();
         ObjectClassImpl oc = new ObjectClassImpl( oid, targetRegistries );
+        oc.setSchema( schema );
         
         if ( entry.get( MetaSchemaConstants.M_SUP_OBJECT_CLASS_AT ) != null )
         {
@@ -600,10 +603,11 @@
     }
     
     
-    public AttributeType getAttributeType( Attributes entry, Registries targetRegistries ) throws NamingException
+    public AttributeType getAttributeType( Attributes entry, Registries targetRegistries, String schema ) throws NamingException
     {
         String oid = ( String ) entry.get( MetaSchemaConstants.M_OID_AT ).get();
         AttributeTypeImpl at = new AttributeTypeImpl( oid, targetRegistries );
+        at.setSchema( schema );
         setSchemaObjectProperties( at, entry );
         
         if ( entry.get( MetaSchemaConstants.M_SYNTAX_AT ) != null )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SyntaxImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SyntaxImpl.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SyntaxImpl.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SyntaxImpl.java Wed Jan 24 18:29:00 2007
@@ -56,4 +56,10 @@
     {
         super.setHumanReadible( humanReadible );
     }
+    
+    
+    public void setSchema( String schema )
+    {
+        super.setSchema( schema );
+    }
 }

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java Wed Jan 24 18:29:00 2007
@@ -32,6 +32,7 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.schema.Syntax;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker;
@@ -56,11 +57,6 @@
     }
 
 
-    public void register( String schema, AttributeType attributeType ) throws NamingException
-    {
-    }
-
-
     public AttributeType lookup( final String id ) throws NamingException
     {
         if ( returnOperational )
@@ -165,6 +161,11 @@
                         {
                             return null;
                         }
+
+                        public String getSchema()
+                        {
+                            return null;
+                        }
                         
                     };
                 }
@@ -211,6 +212,12 @@
                 {
                     return id;
                 }
+
+
+                public String getSchema()
+                {
+                    return null;
+                }
             };
         }
         else
@@ -290,6 +297,11 @@
                         {
                             return null;
                         }
+
+                        public String getSchema()
+                        {
+                            return null;
+                        }
                         
                     };
                 }
@@ -348,6 +360,11 @@
                                 {
                                     return null;
                                 }
+
+                                public String getSchema()
+                                {
+                                    return null;
+                                }
                                 
                             };
                         }
@@ -394,6 +411,11 @@
                         {
                             return null;
                         }
+
+                        public String getSchema()
+                        {
+                            return null;
+                        }
                         
                     };
                 }
@@ -440,6 +462,12 @@
                 {
                     return id;
                 }
+
+
+                public String getSchema()
+                {
+                    return null;
+                }
             };
         }
     }
@@ -463,7 +491,7 @@
     }
 
 
-    public Map getNormalizerMapping() throws NamingException
+    public Map<String,OidNormalizer> getNormalizerMapping() throws NamingException
     {
         return null;
     }
@@ -488,6 +516,11 @@
 
 
     public void unregister( String numericOid ) throws NamingException
+    {
+    }
+
+
+    public void register( AttributeType attributeType ) throws NamingException
     {
     }
 }

Modified: directory/apacheds/trunk/schema-bootstrap/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/pom.xml?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/pom.xml (original)
+++ directory/apacheds/trunk/schema-bootstrap/pom.xml Wed Jan 24 18:29:00 2007
@@ -25,6 +25,11 @@
       <version>${pom.version}</version>
     </dependency>
     <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-constants</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>nlog4j</artifactId>
       <scope>provided</scope>

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java Wed Jan 24 18:29:00 2007
@@ -114,6 +114,12 @@
             super( oid );
             this.registry = registry;
         }
+        
+        
+        public void setSchema( String schema )
+        {
+            super.setSchema( schema );
+        }
 
 
         public void setDescription( String description )
@@ -170,6 +176,12 @@
         }
 
 
+        public void setSchema( String schema )
+        {
+            super.setSchema( schema );
+        }
+
+
         public void setSyntaxOid( String syntaxOid )
         {
             this.syntaxOid = syntaxOid;
@@ -242,6 +254,12 @@
         }
 
 
+        public void setSchema( String schema )
+        {
+            super.setSchema( schema );
+        }
+
+
         public AttributeType getSuperior() throws NamingException
         {
             if ( superiorId == null )
@@ -454,6 +472,12 @@
         public ObjectClassTypeEnum getType()
         {
             return type;
+        }
+
+
+        public void setSchema( String schema )
+        {
+            super.setSchema( schema );
         }
 
 

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java Wed Jan 24 18:29:00 2007
@@ -27,6 +27,7 @@
 import jdbm.helper.StringComparator;
 
 import org.apache.commons.collections.comparators.ComparableComparator;
+import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.server.schema.registries.SyntaxRegistry;
 import org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer;
@@ -47,6 +48,8 @@
  */
 public class ApachemetaMatchingRuleProducer extends AbstractBootstrapProducer
 {
+    
+    
     public ApachemetaMatchingRuleProducer()
     {
         super( ProducerTypeEnum.MATCHING_RULE_PRODUCER );
@@ -66,7 +69,7 @@
     {
         MatchingRule matchingRule = null;
         
-        matchingRule = new NameOrNumericIdMatch( registries.getOidRegistry() );
+        matchingRule = new NameOrNumericIdMatch( registries.getOidRegistry(), MetaSchemaConstants.SCHEMA_NAME );
         cb.schemaObjectProduced( this, matchingRule.getOid(), matchingRule );
         
         matchingRule = new ObjectClassTypeMatch();
@@ -89,7 +92,7 @@
         private final String OID = "1.3.6.1.4.1.18060.0.4.0.1.4";
         private final Syntax syntax;
         private final String[] NAMES = new String[] { "ruleIdMatch" };
-
+        
         
         RuleIdMatch( SyntaxRegistry registry ) throws NamingException
         {
@@ -135,6 +138,11 @@
         {
             return false;
         }
+
+        public String getSchema()
+        {
+            return MetaSchemaConstants.SCHEMA_NAME;
+        }
     }
     
     
@@ -191,6 +199,11 @@
         {
             return false;
         }
+
+        public String getSchema()
+        {
+            return MetaSchemaConstants.SCHEMA_NAME;
+        }
     }
     
     
@@ -247,6 +260,11 @@
         {
             return false;
         }
+
+        public String getSchema()
+        {
+            return MetaSchemaConstants.SCHEMA_NAME;
+        }
     }
 
     
@@ -299,6 +317,11 @@
         public boolean isObsolete()
         {
             return false;
+        }
+
+        public String getSchema()
+        {
+            return MetaSchemaConstants.SCHEMA_NAME;
         }
     }
 }

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java Wed Jan 24 18:29:00 2007
@@ -22,6 +22,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.schema.Syntax;
 import org.apache.directory.shared.ldap.schema.syntax.NumericOidSyntaxChecker;
@@ -114,6 +115,11 @@
         {
             return false;
         }
+
+        public String getSchema()
+        {
+            return MetaSchemaConstants.SCHEMA_NAME;
+        }
     }
 
 
@@ -158,6 +164,11 @@
         {
             return false;
         }
+
+        public String getSchema()
+        {
+            return MetaSchemaConstants.SCHEMA_NAME;
+        }
     }
 
 
@@ -202,6 +213,11 @@
         {
             return false;
         }
+
+        public String getSchema()
+        {
+            return MetaSchemaConstants.SCHEMA_NAME;
+        }
     }
 
 
@@ -245,6 +261,11 @@
         public final boolean isObsolete()
         {
             return false;
+        }
+
+        public String getSchema()
+        {
+            return MetaSchemaConstants.SCHEMA_NAME;
         }
     }
 }

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java Wed Jan 24 18:29:00 2007
@@ -33,26 +33,22 @@
 import org.apache.directory.server.schema.bootstrap.SystemSchema;
 import org.apache.directory.server.schema.bootstrap.BootstrapSchema;
 import org.apache.directory.server.schema.bootstrap.ProducerTypeEnum;
+import org.apache.directory.server.schema.bootstrap.AbstractBootstrapProducer.BootstrapAttributeType;
+import org.apache.directory.server.schema.bootstrap.AbstractBootstrapProducer.BootstrapMatchingRule;
+import org.apache.directory.server.schema.bootstrap.AbstractBootstrapProducer.BootstrapObjectClass;
+import org.apache.directory.server.schema.bootstrap.AbstractBootstrapProducer.BootstrapSyntax;
 import org.apache.directory.server.schema.registries.AbstractSchemaLoader;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.ComparatorRegistry;
-import org.apache.directory.server.schema.registries.DITContentRuleRegistry;
-import org.apache.directory.server.schema.registries.DITStructureRuleRegistry;
 import org.apache.directory.server.schema.registries.DefaultRegistries;
 import org.apache.directory.server.schema.registries.MatchingRuleRegistry;
-import org.apache.directory.server.schema.registries.MatchingRuleUseRegistry;
-import org.apache.directory.server.schema.registries.NameFormRegistry;
 import org.apache.directory.server.schema.registries.NormalizerRegistry;
 import org.apache.directory.server.schema.registries.ObjectClassRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.server.schema.registries.SyntaxCheckerRegistry;
 import org.apache.directory.server.schema.registries.SyntaxRegistry;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.DITContentRule;
-import org.apache.directory.shared.ldap.schema.DITStructureRule;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
-import org.apache.directory.shared.ldap.schema.MatchingRuleUse;
-import org.apache.directory.shared.ldap.schema.NameForm;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.Syntax;
@@ -228,61 +224,57 @@
                 
             case SYNTAX_PRODUCER :
                 Syntax syntax = ( Syntax ) schemaObject;
+                
+                if ( schemaObject instanceof BootstrapSyntax )
+                {
+                    ( ( BootstrapSyntax ) syntax ).setSchema( schema.getSchemaName() );
+                }
+
                 SyntaxRegistry syntaxRegistry = registries.getSyntaxRegistry();
-                syntaxRegistry.register( schema.getSchemaName(), syntax );
+                syntaxRegistry.register( syntax );
                 break;
                 
             case MATCHING_RULE_PRODUCER :
                 MatchingRule matchingRule = ( MatchingRule ) schemaObject;
+                
+                if ( schemaObject instanceof BootstrapMatchingRule )
+                {
+                    ( ( BootstrapMatchingRule ) matchingRule ).setSchema( schema.getSchemaName() );
+                }
+
                 MatchingRuleRegistry matchingRuleRegistry;
                 matchingRuleRegistry = registries.getMatchingRuleRegistry();
-                matchingRuleRegistry.register( schema.getSchemaName(), matchingRule );
+                matchingRuleRegistry.register( matchingRule );
                 break;
                 
             case ATTRIBUTE_TYPE_PRODUCER :
                 AttributeType attributeType = ( AttributeType ) schemaObject;
+                
+                if ( attributeType instanceof BootstrapAttributeType )
+                {
+                    ( ( BootstrapAttributeType ) attributeType ).setSchema( schema.getSchemaName() );
+                }
+                
                 AttributeTypeRegistry attributeTypeRegistry;
                 attributeTypeRegistry = registries.getAttributeTypeRegistry();
-                attributeTypeRegistry.register( schema.getSchemaName(), attributeType );
+                attributeTypeRegistry.register( attributeType );
                 break;
                 
             case OBJECT_CLASS_PRODUCER :
                 ObjectClass objectClass = ( ObjectClass ) schemaObject;
-                ObjectClassRegistry objectClassRegistry;
-                objectClassRegistry = registries.getObjectClassRegistry();
-                objectClassRegistry.register( schema.getSchemaName(), objectClass );
-                break;
-                
-            case MATCHING_RULE_USE_PRODUCER :
-                MatchingRuleUse matchingRuleUse = ( MatchingRuleUse ) schemaObject;
-                MatchingRuleUseRegistry matchingRuleUseRegistry;
-                matchingRuleUseRegistry = registries.getMatchingRuleUseRegistry();
-                matchingRuleUseRegistry.register( schema.getSchemaName(), matchingRuleUse );
-                break;
-                
-            case DIT_CONTENT_RULE_PRODUCER :
-                DITContentRule ditContentRule = ( DITContentRule ) schemaObject;
-                DITContentRuleRegistry ditContentRuleRegistry;
-                ditContentRuleRegistry = registries.getDitContentRuleRegistry();
-                ditContentRuleRegistry.register( schema.getSchemaName(), ditContentRule );
-                break;
                 
-            case NAME_FORM_PRODUCER :
-                NameForm nameForm = ( NameForm ) schemaObject;
-                NameFormRegistry nameFormRegistry;
-                nameFormRegistry = registries.getNameFormRegistry();
-                nameFormRegistry.register( schema.getSchemaName(), nameForm );
-                break;
+                if ( objectClass instanceof BootstrapObjectClass )
+                {
+                    ( ( BootstrapObjectClass ) objectClass ).setSchema( schema.getSchemaName() );
+                }
                 
-            case DIT_STRUCTURE_RULE_PRODUCER :
-                DITStructureRule ditStructureRule = ( DITStructureRule ) schemaObject;
-                DITStructureRuleRegistry ditStructureRuleRegistry;
-                ditStructureRuleRegistry = registries.getDitStructureRuleRegistry();
-                ditStructureRuleRegistry.register( schema.getSchemaName(), ditStructureRule );
+                ObjectClassRegistry objectClassRegistry;
+                objectClassRegistry = registries.getObjectClassRegistry();
+                objectClassRegistry.register( objectClass );
                 break;
                 
             default:
-                throw new IllegalStateException( "ProducerTypeEnum is broke!" );
+                throw new IllegalStateException( "ProducerTypeEnum value is invalid: " + type );
         }
     }
 

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java Wed Jan 24 18:29:00 2007
@@ -44,19 +44,22 @@
     private transient Normalizer normalizer;
     private transient Comparator comparator;
     private transient Syntax syntax;
+    private final String schema;
     
     
-    public NameOrNumericIdMatch()
+    public NameOrNumericIdMatch( String schema )
     {
         this.syntax = new ApachemetaSyntaxProducer.NameOrNumericIdSyntax();
+        this.schema = schema;
     }
 
     
-    public NameOrNumericIdMatch( OidRegistry registry )
+    public NameOrNumericIdMatch( OidRegistry registry, String schema )
     {
         this.normalizer = new NameOrNumericIdNormalizer( registry );
         this.comparator = new NameOrNumericIdComparator( registry );
         this.syntax = new ApachemetaSyntaxProducer.NameOrNumericIdSyntax();
+        this.schema = schema;
     }
     
 
@@ -137,5 +140,11 @@
     public boolean isObsolete()
     {
         return false;
+    }
+
+
+    public String getSchema()
+    {
+        return schema;
     }
 }

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdNormalizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdNormalizer.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdNormalizer.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdNormalizer.java Wed Jan 24 18:29:00 2007
@@ -28,7 +28,6 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.syntax.NumericOidSyntaxChecker;
-import org.apache.directory.shared.ldap.schema.syntax.OidSyntaxChecker;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java Wed Jan 24 18:29:00 2007
@@ -40,12 +40,11 @@
     /**
      * Registers a new AttributeType with this registry.
      *
-     * @param schema the name of the schema the AttributeType is associated with
      * @param attributeType the AttributeType to register
      * @throws NamingException if the AttributeType is already registered or
      * the registration operation is not supported
      */
-    void register( String schema, AttributeType attributeType ) throws NamingException;
+    void register( AttributeType attributeType ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITContentRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITContentRuleRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITContentRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITContentRuleRegistry.java Wed Jan 24 18:29:00 2007
@@ -38,12 +38,11 @@
     /**
      * Registers a DITContentRule with this registry.
      * 
-     * @param schema the name of the schema the DITContentRule is associated with
      * @param dITContentRule the DITContentRule to register
      * @throws NamingException if the DITContentRule is already registered or
      * the registration operation is not supported
      */
-    void register( String schema, DITContentRule dITContentRule ) throws NamingException;
+    void register( DITContentRule dITContentRule ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITStructureRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITStructureRuleRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITStructureRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITStructureRuleRegistry.java Wed Jan 24 18:29:00 2007
@@ -38,12 +38,11 @@
     /**
      * Registers a DITStructureRule with this registry.
      * 
-     * @param schema the name of the schema the DITStructureRule is associated with
      * @param dITStructureRule the dITStructureRule to register
      * @throws NamingException if the DITStructureRule is already registered
      * or the registration operation is not supported
      */
-    void register( String schema, DITStructureRule dITStructureRule ) throws NamingException;
+    void register( DITStructureRule dITStructureRule ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java Wed Jan 24 18:29:00 2007
@@ -51,8 +51,6 @@
 
     /** maps an OID to an AttributeType */
     private final Map<String,AttributeType> byOid;
-    /** maps an OID to a schema name*/
-    private final Map<String,String> oidToSchema;
     /** maps OIDs to a Set of descendants for that OID */
     private final Map<String,Set<AttributeType>> oidToDescendantSet;
     /** the registry used to resolve names to OIDs */
@@ -71,7 +69,6 @@
     public DefaultAttributeTypeRegistry( OidRegistry oidRegistry )
     {
         this.byOid = new HashMap<String,AttributeType>();
-        this.oidToSchema = new HashMap<String,String>();
         this.oidToDescendantSet= new HashMap<String,Set<AttributeType>>();
         this.oidRegistry = oidRegistry;
     }
@@ -82,7 +79,7 @@
     // ------------------------------------------------------------------------
 
     
-    public void register( String schema, AttributeType attributeType ) throws NamingException
+    public void register( AttributeType attributeType ) throws NamingException
     {
         if ( byOid.containsKey( attributeType.getOid() ) )
         {
@@ -99,7 +96,6 @@
         oidRegistry.register( attributeType.getOid(), attributeType.getOid() );
 
         registerDescendants( attributeType );
-        oidToSchema.put( attributeType.getOid(), schema );
         byOid.put( attributeType.getOid(), attributeType );
         if ( log.isDebugEnabled() )
         {
@@ -190,12 +186,14 @@
     public String getSchemaName( String id ) throws NamingException
     {
         id = oidRegistry.getOid( id );
-        if ( oidToSchema.containsKey( id ) )
+        AttributeType at = byOid.get( id );
+        
+        if ( at != null )
         {
-            return ( String ) oidToSchema.get( id );
+            return at.getSchema();
         }
 
-        throw new NamingException( "OID " + id + " not found in oid to " + "schema name map!" );
+        throw new NamingException( "OID " + id + " not found in oid to " + "AttributeType map!" );
     }
 
 
@@ -278,7 +276,6 @@
         }
 
         byOid.remove( numericOid );
-        oidToSchema.remove( numericOid );
         oidToDescendantSet.remove( numericOid );
     }
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitContentRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitContentRuleRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitContentRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitContentRuleRegistry.java Wed Jan 24 18:29:00 2007
@@ -43,8 +43,6 @@
     private final static Logger log = LoggerFactory.getLogger( DefaultDitContentRuleRegistry.class );
     /** maps an OID to an DITContentRule */
     private final Map<String,DITContentRule> byOid;
-    /** maps an OID to a schema name*/
-    private final Map<String,String> oidToSchema;
     /** the registry used to resolve names to OIDs */
     private final OidRegistry oidRegistry;
 
@@ -59,7 +57,6 @@
     public DefaultDitContentRuleRegistry(OidRegistry oidRegistry)
     {
         this.byOid = new HashMap<String,DITContentRule>();
-        this.oidToSchema = new HashMap<String,String>();
         this.oidRegistry = oidRegistry;
     }
 
@@ -69,7 +66,7 @@
     // ------------------------------------------------------------------------
 
     
-    public void register( String schema, DITContentRule dITContentRule ) throws NamingException
+    public void register( DITContentRule dITContentRule ) throws NamingException
     {
         if ( byOid.containsKey( dITContentRule.getOid() ) )
         {
@@ -80,7 +77,6 @@
 
         oidRegistry.register( dITContentRule.getName(), dITContentRule.getOid() );
         byOid.put( dITContentRule.getOid(), dITContentRule );
-        oidToSchema.put( dITContentRule.getOid(), schema );
         if ( log.isDebugEnabled() )
         {
             log.debug( "registed dITContentRule: " + dITContentRule );
@@ -128,12 +124,13 @@
     public String getSchemaName( String id ) throws NamingException
     {
         id = oidRegistry.getOid( id );
-        if ( oidToSchema.containsKey( id ) )
+        DITContentRule dcr = byOid.get( id );
+        if ( dcr != null )
         {
-            return ( String ) oidToSchema.get( id );
+            return dcr.getSchema();
         }
 
-        throw new NamingException( "OID " + id + " not found in oid to " + "schema name map!" );
+        throw new NamingException( "OID " + id + " not found in oid to " + "DITContentRule map!" );
     }
 
 

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitStructureRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitStructureRuleRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitStructureRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitStructureRuleRegistry.java Wed Jan 24 18:29:00 2007
@@ -43,8 +43,6 @@
     private final static Logger log = LoggerFactory.getLogger( DefaultDitStructureRuleRegistry.class );
     /** maps an OID to an DITStructureRule */
     private final Map<String,DITStructureRule> byOid;
-    /** maps an OID to a schema name*/
-    private final Map<String,String> oidToSchema;
     /** the registry used to resolve names to OIDs */
     private final OidRegistry oidRegistry;
 
@@ -60,7 +58,6 @@
     public DefaultDitStructureRuleRegistry(OidRegistry oidRegistry)
     {
         this.byOid = new HashMap<String,DITStructureRule>();
-        this.oidToSchema = new HashMap<String,String>();
         this.oidRegistry = oidRegistry;
     }
 
@@ -69,7 +66,7 @@
     // Service Methods
     // ------------------------------------------------------------------------
 
-    public void register( String schema, DITStructureRule dITStructureRule ) throws NamingException
+    public void register( DITStructureRule dITStructureRule ) throws NamingException
     {
         if ( byOid.containsKey( dITStructureRule.getOid() ) )
         {
@@ -78,7 +75,6 @@
             throw e;
         }
 
-        oidToSchema.put( dITStructureRule.getOid(), schema );
         oidRegistry.register( dITStructureRule.getName(), dITStructureRule.getOid() );
         byOid.put( dITStructureRule.getOid(), dITStructureRule );
         if ( log.isDebugEnabled() )
@@ -128,12 +124,13 @@
     public String getSchemaName( String id ) throws NamingException
     {
         id = oidRegistry.getOid( id );
-        if ( oidToSchema.containsKey( id ) )
+        DITStructureRule dsr = byOid.get( id );
+        if ( dsr != null )
         {
-            return ( String ) oidToSchema.get( id );
+            return dsr.getSchema();
         }
 
-        throw new NamingException( "OID " + id + " not found in oid to " + "schema name map!" );
+        throw new NamingException( "OID " + id + " not found in oid to " + "DITStructureRule map!" );
     }
 
 

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java Wed Jan 24 18:29:00 2007
@@ -44,8 +44,6 @@
     private final static Logger log = LoggerFactory.getLogger( DefaultMatchingRuleRegistry.class );
     /** a map using an OID for the key and a MatchingRule for the value */
     private final Map<String,MatchingRule> byOid;
-    /** maps an OID to a schema name*/
-    private final Map<String,String> oidToSchema;
     /** the registry used to resolve names to OIDs */
     private final OidRegistry oidRegistry;
 
@@ -62,7 +60,6 @@
      */
     public DefaultMatchingRuleRegistry(OidRegistry oidRegistry)
     {
-        this.oidToSchema = new HashMap<String,String>();
         this.oidRegistry = oidRegistry;
         this.byOid = new HashMap<String,MatchingRule>();
     }
@@ -97,7 +94,7 @@
     /**
      * @see MatchingRuleRegistry#register(String, MatchingRule)
      */
-    public void register( String schema, MatchingRule matchingRule ) throws NamingException
+    public void register( MatchingRule matchingRule ) throws NamingException
     {
         if ( byOid.containsKey( matchingRule.getOid() ) )
         {
@@ -106,8 +103,6 @@
             throw e;
         }
 
-        oidToSchema.put( matchingRule.getOid(), schema );
-
         String[] names = matchingRule.getNames();
         for ( int ii = 0; ii < names.length; ii++ )
         {
@@ -147,12 +142,13 @@
     public String getSchemaName( String id ) throws NamingException
     {
         id = oidRegistry.getOid( id );
-        if ( oidToSchema.containsKey( id ) )
+        MatchingRule mr = byOid.get( id );
+        if ( mr != null )
         {
-            return ( String ) oidToSchema.get( id );
+            return mr.getSchema();
         }
 
-        throw new NamingException( "OID " + id + " not found in oid to " + "schema name map!" );
+        throw new NamingException( "OID " + id + " not found in oid to " + "MatchingRule name map!" );
     }
 
 
@@ -170,6 +166,5 @@
         }
 
         byOid.remove( numericOid );
-        oidToSchema.remove( numericOid );
     }
 }