directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r833647 [3/17] - in /directory: apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ apacheds/branches/apacheds-schema/avl-partition/src/test/java/org/apache/directory/server/core/par...
Date Sat, 07 Nov 2009 07:57:42 GMT
Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java Sat Nov  7 07:57:34 2009
@@ -125,17 +125,17 @@
         this.objectClassAT = this.registries.getAttributeTypeRegistry()
             .lookup( SchemaConstants.OBJECT_CLASS_AT );
         
-        this.registrySynchronizers[COMPARATOR_INDEX] = new ComparatorSynchronizer( registries ); 
-        this.registrySynchronizers[NORMALIZER_INDEX] = new NormalizerSynchronizer( registries );
-        this.registrySynchronizers[SYNTAX_CHECKER_INDEX] = new SyntaxCheckerSynchronizer( registries );
-        this.registrySynchronizers[SYNTAX_INDEX] = new SyntaxSynchronizer( registries );
-        this.registrySynchronizers[MATCHING_RULE_INDEX] = new MatchingRuleSynchronizer( registries );
-        this.registrySynchronizers[ATTRIBUTE_TYPE_INDEX] = new AttributeTypeSynchronizer( registries );
-        this.registrySynchronizers[OBJECT_CLASS_INDEX] = new ObjectClassSynchronizer( registries );
-        this.registrySynchronizers[MATCHING_RULE_USE_INDEX] = new MatchingRuleUseSynchronizer( registries );
-        this.registrySynchronizers[DIT_STRUCTURE_RULE_INDEX] = new DitStructureRuleSynchronizer( registries ); 
-        this.registrySynchronizers[DIT_CONTENT_RULE_INDEX] = new DitContentRuleSynchronizer( registries ); 
-        this.registrySynchronizers[NAME_FORM_INDEX] = new NameFormSynchronizer( registries ); 
+        this.registrySynchronizers[COMPARATOR_INDEX] = new ComparatorSynchronizer( schemaManager ); 
+        this.registrySynchronizers[NORMALIZER_INDEX] = new NormalizerSynchronizer( schemaManager );
+        this.registrySynchronizers[SYNTAX_CHECKER_INDEX] = new SyntaxCheckerSynchronizer( schemaManager );
+        this.registrySynchronizers[SYNTAX_INDEX] = new SyntaxSynchronizer( schemaManager );
+        this.registrySynchronizers[MATCHING_RULE_INDEX] = new MatchingRuleSynchronizer( schemaManager );
+        this.registrySynchronizers[ATTRIBUTE_TYPE_INDEX] = new AttributeTypeSynchronizer( schemaManager );
+        this.registrySynchronizers[OBJECT_CLASS_INDEX] = new ObjectClassSynchronizer( schemaManager );
+        this.registrySynchronizers[MATCHING_RULE_USE_INDEX] = new MatchingRuleUseSynchronizer( schemaManager );
+        this.registrySynchronizers[DIT_STRUCTURE_RULE_INDEX] = new DitStructureRuleSynchronizer( schemaManager ); 
+        this.registrySynchronizers[DIT_CONTENT_RULE_INDEX] = new DitContentRuleSynchronizer( schemaManager ); 
+        this.registrySynchronizers[NAME_FORM_INDEX] = new NameFormSynchronizer( schemaManager ); 
 
         ObjectClassRegistry ocReg = registries.getObjectClassRegistry();
         for ( int ii = 0; ii < META_OBJECT_CLASSES.length; ii++ )

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java Sat Nov  7 07:57:34 2009
@@ -51,9 +51,9 @@
 import org.apache.directory.shared.ldap.schema.SchemaObjectType;
 import org.apache.directory.shared.ldap.schema.SchemaWrapper;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.registries.DefaultSchemaObjectRegistry;
 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.registries.SchemaObjectRegistry;
 import org.apache.directory.shared.ldap.util.DateUtils;
 import org.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory;
 import org.slf4j.Logger;
@@ -143,6 +143,8 @@
         Modification disabledModification = ServerEntryUtils.getModificationItem( mods, disabledAT );
         
         // The attribute might be present, but that does not mean we will change it.
+        // If it's absent, and if we have it in the previous entry, that mean we want
+        // to enable the schema
         if ( disabledModification != null )
         {
             // We are trying to modify the m-disabled attribute. 
@@ -151,6 +153,11 @@
             
             hasModification = modifyDisable( opContext, modification, attribute, disabledInEntry );
         }
+        else if ( disabledInEntry != null )
+        {
+            hasModification = modifyDisable( opContext, ModificationOperation.REMOVE_ATTRIBUTE, null, disabledInEntry );
+        }
+            
         
         return hasModification;
     }
@@ -636,10 +643,8 @@
 
         if ( schema == null )
         {
-            // This is not possible. We can't enable a schema which is not loaded.
-            String msg = "Unwilling to enable a not loaded schema: " + schemaName;
-            LOG.error( msg );
-            throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            // We have to load the schema before enabling it.
+            schemaManager.loadDisabled( schemaName );
         }
         
         return schemaManager.enable( schemaName );
@@ -703,14 +708,14 @@
 
     
     /**
-     * Used to iterate through SchemaObjects in a SchemaObjectRegistry and rename
+     * Used to iterate through SchemaObjects in a DefaultSchemaObjectRegistry and rename
      * their schema property to a new schema name.
      * 
      * @param registry the registry whose objects are changed
      * @param originalSchemaName the original schema name
      * @param newSchemaName the new schema name
      */
-    private void renameSchema( SchemaObjectRegistry<? extends SchemaObject> registry, String originalSchemaName, String newSchemaName ) 
+    private void renameSchema( DefaultSchemaObjectRegistry<? extends SchemaObject> registry, String originalSchemaName, String newSchemaName ) 
     {
         Iterator<? extends SchemaObject> list = registry.iterator();
         while ( list.hasNext() )

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java Sat Nov  7 07:57:34 2009
@@ -32,10 +32,9 @@
 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.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
-import org.apache.directory.shared.ldap.schema.registries.LdapSyntaxRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
-import org.apache.directory.shared.ldap.schema.registries.SyntaxCheckerRegistry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -52,24 +51,15 @@
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( SyntaxCheckerSynchronizer.class );
 
-    /** The SyntaxChecker registry */
-    private final SyntaxCheckerRegistry syntaxCheckerRegistry;
-    
-    /** The Syntax registry */
-    private final LdapSyntaxRegistry ldapSyntaxRegistry;
-    
-
     /**
      * Creates a new instance of SyntaxCheckerSynchronizer.
      *
-     * @param registries The global registries
+     * @param schemaManager The global schemaManager
      * @throws Exception If the initialization failed
      */
-    public SyntaxCheckerSynchronizer( Registries registries ) throws Exception
+    public SyntaxCheckerSynchronizer( SchemaManager schemaManager ) throws Exception
     {
-        super( registries );
-        this.syntaxCheckerRegistry = registries.getSyntaxCheckerRegistry();
-        this.ldapSyntaxRegistry = registries.getLdapSyntaxRegistry();
+        super( schemaManager );
     }
 
 
@@ -82,14 +72,14 @@
         ServerEntry entry = opContext.getEntry();
         String schemaName = getSchemaName( name );
         String oid = getOid( entry );
-        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( targetEntry, registries, schemaName );
+        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
         
         if ( isSchemaEnabled( schemaName ) )
         {
             syntaxChecker.setSchemaName( schemaName );
 
-            syntaxCheckerRegistry.unregister( oid );
-            syntaxCheckerRegistry.register( syntaxChecker );
+            schemaManager.unregisterSyntaxChecker( oid );
+            schemaManager.register( syntaxChecker );
             
             return SCHEMA_MODIFIED;
         }
@@ -108,7 +98,7 @@
         parentDn.remove( parentDn.size() - 1 );
 
         // The parent DN must be ou=syntaxcheckers,cn=<schemaName>,ou=schema
-        checkParent( parentDn, syntaxCheckerRegistry, SchemaConstants.SYNTAX_CHECKER );
+        checkParent( parentDn, schemaManager, SchemaConstants.SYNTAX_CHECKER );
 
         // The new schemaObject's OID must not already exist
         checkOidIsUniqueForSyntaxChecker( entry );
@@ -116,13 +106,13 @@
         // Build the new SyntaxChecker from the given entry
         String schemaName = getSchemaName( dn );
         
-        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( entry, registries, schemaName );
+        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(), schemaName );
 
         addToSchema( syntaxChecker, schemaName );
 
         if ( isSchemaEnabled( schemaName ) )
         {
-            syntaxCheckerRegistry.register( syntaxChecker );
+            schemaManager.register( syntaxChecker );
             LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName );
         }
     }
@@ -138,17 +128,17 @@
         parentDn.remove( parentDn.size() - 1 );
         
         // The parent DN must be ou=syntaxcheckers,cn=<schemaName>,ou=schema
-        checkParent( parentDn, syntaxCheckerRegistry, SchemaConstants.SYNTAX_CHECKER );
+        checkParent( parentDn, schemaManager, SchemaConstants.SYNTAX_CHECKER );
 
         // Get the SyntaxChecker's instance
         String schemaName = getSchemaName( entry.getDn() );
-        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( entry, registries, schemaName );
+        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(), schemaName );
         
         String oid = syntaxChecker.getOid();
         
         if ( isSchemaEnabled( schemaName ) )
         {
-            if ( registries.isReferenced( syntaxChecker ) )
+            if ( schemaManager.getRegistries().isReferenced( syntaxChecker ) )
             {
                 String msg = "Cannot delete " + entry.getDn().getUpName() + ", as there are some " +
                 " dependant SchemaObjects :\n" + getReferenced( syntaxChecker );
@@ -161,9 +151,9 @@
         deleteFromSchema( syntaxChecker, schemaName );
 
         // Update the Registries now
-        if ( syntaxCheckerRegistry.contains( oid ) )
+        if ( schemaManager.getSyntaxCheckerRegistry().contains( oid ) )
         {
-            syntaxCheckerRegistry.unregister( oid );
+            schemaManager.unregisterSyntaxChecker( oid );
             LOG.debug( "Removed {} from the enabled schema {}", syntaxChecker, schemaName );
         }
         else
@@ -181,7 +171,7 @@
         String oldOid = getOid( entry );
         String schemaName = getSchemaName( entry.getDn() );
 
-        if ( ldapSyntaxRegistry.contains( oldOid ) )
+        if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) )
         {
             throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oldOid 
                 + " cannot have it's OID changed until all " 
@@ -192,7 +182,7 @@
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
         
-        if ( registries.getSyntaxCheckerRegistry().contains( newOid ) )
+        if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
         {
             throw new LdapNamingException( "Oid " + newOid + " for new schema syntaxChecker is not unique.", 
                 ResultCodeEnum.OTHER );
@@ -202,9 +192,9 @@
         
         if ( isSchemaEnabled( schemaName ) )
         {
-            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( targetEntry, registries, schemaName );
-            syntaxCheckerRegistry.unregister( oldOid );
-            syntaxCheckerRegistry.register( syntaxChecker );
+            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
+            schemaManager.unregisterSyntaxChecker( oldOid );
+            schemaManager.register( syntaxChecker );
         }
     }
 
@@ -217,7 +207,7 @@
         String oldSchemaName = getSchemaName( oriChildName );
         String newSchemaName = getSchemaName( newParentName );
 
-        if ( ldapSyntaxRegistry.contains( oldOid ) )
+        if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) )
         {
             throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oldOid 
                 + " cannot have it's OID changed until all " 
@@ -229,23 +219,23 @@
         
         String newOid = ( String ) newRdn.getValue();
         
-        if ( registries.getSyntaxCheckerRegistry().contains( newOid ) )
+        if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
         {
             throw new LdapNamingException( "Oid " + newOid + " for new schema syntaxChecker is not unique.", 
                 ResultCodeEnum.OTHER );
         }
 
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( targetEntry, registries, newSchemaName );
+        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager.getRegistries(), newSchemaName );
 
         if ( isSchemaEnabled( oldSchemaName ) )
         {
-            syntaxCheckerRegistry.unregister( oldOid );
+            schemaManager.unregisterSyntaxChecker( oldOid );
         }
 
         if ( isSchemaEnabled( newSchemaName ) )
         {
-            syntaxCheckerRegistry.register( syntaxChecker );
+            schemaManager.register( syntaxChecker );
         }
     }
 
@@ -258,7 +248,7 @@
         String oldSchemaName = getSchemaName( oriChildName );
         String newSchemaName = getSchemaName( newParentName );
 
-        if ( ldapSyntaxRegistry.contains( oid ) )
+        if ( schemaManager.getLdapSyntaxRegistry().contains( oid ) )
         {
             throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oid 
                 + " cannot be moved to another schema until all " 
@@ -266,16 +256,16 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( entry, registries, newSchemaName );
+        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(), newSchemaName );
         
         if ( isSchemaEnabled( oldSchemaName ) )
         {
-            syntaxCheckerRegistry.unregister( oid );
+            schemaManager.unregisterSyntaxChecker( oid );
         }
         
         if ( isSchemaEnabled( newSchemaName ) )
         {
-            syntaxCheckerRegistry.register( syntaxChecker );
+            schemaManager.register( syntaxChecker );
         }
     }
     
@@ -284,7 +274,7 @@
     {
         String oid = getOid( entry );
         
-        if ( registries.getNormalizerRegistry().contains( oid ) )
+        if ( schemaManager.getNormalizerRegistry().contains( oid ) )
         {
             throw new LdapNamingException( "Oid " + oid + " for new schema SyntaxChecker is not unique.", 
                 ResultCodeEnum.OTHER );
@@ -302,7 +292,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! registries.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+        if ( ! schemaManager.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-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java Sat Nov  7 07:57:34 2009
@@ -37,11 +37,8 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaObject;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.shared.ldap.schema.registries.LdapSyntaxRegistry;
-import org.apache.directory.shared.ldap.schema.registries.MatchingRuleRegistry;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.schema.registries.Schema;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -59,21 +56,16 @@
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( SyntaxSynchronizer.class );
 
-    /** The Synatx registry */
-    private final LdapSyntaxRegistry syntaxRegistry;
-
-    
     /**
      * Creates a new instance of SyntaxSynchronizer.
      *
-     * @param registries The global registries
+     * @param schemaManager The global schemaManager
      * @throws Exception If the initialization failed
      */
-    public SyntaxSynchronizer( Registries registries ) 
+    public SyntaxSynchronizer( SchemaManager schemaManager ) 
         throws Exception
     {
-        super( registries );
-        this.syntaxRegistry = registries.getLdapSyntaxRegistry();
+        super( schemaManager );
     }
 
     
@@ -85,13 +77,13 @@
         LdapDN name = opContext.getDn();
         ServerEntry entry = opContext.getEntry();
         String oid = getOid( entry );
-        LdapSyntax syntax = factory.getSyntax( targetEntry, registries, getSchemaName( name ) );
+        LdapSyntax syntax = factory.getSyntax( targetEntry, schemaManager.getRegistries(), getSchemaName( name ) );
         String schemaName = getSchemaName( entry.getDn() );
         
         if ( isSchemaEnabled( schemaName ) )
         {
-            syntaxRegistry.unregister( oid );
-            syntaxRegistry.register( syntax );
+            schemaManager.unregisterLdapSyntax( oid );
+            schemaManager.register( syntax );
             
             return SCHEMA_MODIFIED;
         }
@@ -110,21 +102,21 @@
         parentDn.remove( parentDn.size() - 1 );
 
         // The parent DN must be ou=syntaxes,cn=<schemaName>,ou=schema
-        checkParent( parentDn, syntaxRegistry, SchemaConstants.SYNTAX );
+        checkParent( parentDn, schemaManager, SchemaConstants.SYNTAX );
 
         // The new schemaObject's OID must not already exist
         checkOidIsUnique( entry );
         
         // Build the new Syntax from the given entry
         String schemaName = getSchemaName( dn );
-        LdapSyntax syntax = factory.getSyntax( entry, registries, schemaName );
+        LdapSyntax syntax = factory.getSyntax( entry, schemaManager.getRegistries(), schemaName );
 
         // Applies the Registries to this Syntax 
-        Schema schema = registries.getLoadedSchema( schemaName );
+        Schema schema = schemaManager.getLoadedSchema( schemaName );
 
         if ( schema.isEnabled() && syntax.isEnabled() )
         {
-            syntax.applyRegistries( registries );
+            syntax.applyRegistries( schemaManager.getRegistries() );
         }
         
         // Associates this Syntax with the schema
@@ -134,9 +126,9 @@
         if ( isSchemaEnabled( schemaName ) )
         {
             // Update the using table, as a Syntax is associated with a SyntaxChecker
-            registries.addReference( syntax, syntax.getSyntaxChecker() );
+            schemaManager.getRegistries().addReference( syntax, syntax.getSyntaxChecker() );
 
-            syntaxRegistry.register( syntax );
+            schemaManager.register( syntax );
             LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName );
         }
         else
@@ -152,10 +144,9 @@
      */
     private List<SchemaObject> checkInUse( String oid )
     {
-        AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();
         List<SchemaObject> dependees = new ArrayList<SchemaObject>();
         
-        for ( AttributeType attributeType : atRegistry )
+        for ( AttributeType attributeType : schemaManager.getAttributeTypeRegistry() )
         {
             if ( oid.equals( attributeType.getSyntax().getOid() ) )
             {
@@ -163,9 +154,7 @@
             }
         }
         
-        MatchingRuleRegistry mrRegistry = registries.getMatchingRuleRegistry();
-        
-        for ( MatchingRule matchingRule : mrRegistry )
+        for ( MatchingRule matchingRule : schemaManager.getMatchingRuleRegistry() )
         {
             if ( oid.equals( matchingRule.getSyntax().getOid() ) )
             {
@@ -213,25 +202,25 @@
         parentDn.remove( parentDn.size() - 1 );
         
         // The parent DN must be ou=syntaxes,cn=<schemaName>,ou=schema
-        checkParent( parentDn, syntaxRegistry, SchemaConstants.SYNTAX );
+        checkParent( parentDn, schemaManager, SchemaConstants.SYNTAX );
         
         // Get the Syntax from the given entry ( it has been grabbed from the server earlier)
         String schemaName = getSchemaName( entry.getDn() );
-        LdapSyntax syntax = factory.getSyntax( entry, registries, schemaName );
+        LdapSyntax syntax = factory.getSyntax( entry, schemaManager.getRegistries(), schemaName );
         
         // Applies the Registries to this Syntax 
-        Schema schema = registries.getLoadedSchema( schemaName );
+        Schema schema = schemaManager.getLoadedSchema( schemaName );
 
         if ( schema.isEnabled() && syntax.isEnabled() )
         {
-            syntax.applyRegistries( registries );
+            syntax.applyRegistries( schemaManager.getRegistries() );
         }
 
         String oid = syntax.getOid();
         
         if ( isSchemaEnabled( schemaName ) )
         {
-            if ( registries.isReferenced( syntax ) )
+            if ( schemaManager.getRegistries().isReferenced( syntax ) )
             {
                 String msg = "Cannot delete " + entry.getDn().getUpName() + ", as there are some " +
                     " dependant SchemaObjects :\n" + getReferenced( syntax );
@@ -242,14 +231,14 @@
         
         deleteFromSchema( syntax, schemaName );
 
-        if ( syntaxRegistry.contains( oid ) )
+        if ( schemaManager.getLdapSyntaxRegistry().contains( oid ) )
         {
             // Update the references.
             // The SyntaxChecker
-            registries.delReference( syntax, syntax.getSyntaxChecker() );
+            schemaManager.getRegistries().delReference( syntax, syntax.getSyntaxChecker() );
             
             // Update the Registry
-            syntaxRegistry.unregister( oid );
+            schemaManager.unregisterLdapSyntax( oid );
             
             LOG.debug( "Removed {} from the enabled schema {}", syntax, schemaName );
         }
@@ -286,12 +275,12 @@
         checkOidIsUnique( newOid );
         
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        LdapSyntax syntax = factory.getSyntax( targetEntry, registries, getSchemaName( entry.getDn() ) );
+        LdapSyntax syntax = factory.getSyntax( targetEntry, schemaManager.getRegistries(), getSchemaName( entry.getDn() ) );
         
         if ( isSchemaEnabled( schemaName ) )
         {
-            syntaxRegistry.unregister( oldOid );
-            syntaxRegistry.register( syntax );
+            schemaManager.unregisterLdapSyntax( oldOid );
+            schemaManager.register( syntax );
         }
         else
         {
@@ -328,11 +317,11 @@
         checkOidIsUnique( newOid );
         
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        LdapSyntax syntax = factory.getSyntax( targetEntry, registries, getSchemaName( newParentName ) );
+        LdapSyntax syntax = factory.getSyntax( targetEntry, schemaManager.getRegistries(), getSchemaName( newParentName ) );
 
         if ( isSchemaEnabled( oldSchemaName ) )
         {
-            syntaxRegistry.unregister( oldOid );
+            schemaManager.unregisterLdapSyntax( oldOid );
         }
         else
         {
@@ -341,7 +330,7 @@
 
         if ( isSchemaEnabled( newSchemaName ) )
         {
-            syntaxRegistry.register( syntax );
+            schemaManager.register( syntax );
         }
         else
         {
@@ -372,11 +361,11 @@
 //                ResultCodeEnum.UNWILLING_TO_PERFORM );
 //        }
         
-        LdapSyntax syntax = factory.getSyntax( entry, registries, getSchemaName( newParentName ) );
+        LdapSyntax syntax = factory.getSyntax( entry, schemaManager.getRegistries(), getSchemaName( newParentName ) );
         
         if ( isSchemaEnabled( oldSchemaName ) )
         {
-            syntaxRegistry.unregister( oid );
+            schemaManager.unregisterLdapSyntax( oid );
         }
         else
         {
@@ -385,7 +374,7 @@
         
         if ( isSchemaEnabled( newSchemaName ) )
         {
-            syntaxRegistry.register( syntax );
+            schemaManager.register( syntax );
         }
         else
         {
@@ -404,7 +393,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
-        if ( ! registries.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+        if ( ! schemaManager.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-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java Sat Nov  7 07:57:34 2009
@@ -40,8 +40,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.LdapDNSerializer;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-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.SchemaManager;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -64,14 +63,14 @@
     /** The logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( DefaultServerEntry.class );
 
-    /** The AttributeType registries */
-    private final transient AttributeTypeRegistry atRegistry;
-    
     /** A speedup to get the ObjectClass attribute */
     private static transient AttributeType OBJECT_CLASS_AT;
     
     /** A mutex to manage synchronization*/
     private static transient Object MUTEX = new Object();
+    
+    /** The SchemaManager */
+    private SchemaManager schemaManager;
 
 
     //-------------------------------------------------------------------------
@@ -89,7 +88,7 @@
             throw new IllegalArgumentException( message );
         }
         
-        return atRegistry.lookup( upId );
+        return schemaManager.lookupAttributeTypeRegistry( upId );
     }
 
     
@@ -134,7 +133,7 @@
      * We can't do it once as a static part in the body of this class, because
      * the access to the registries is mandatory to get back the AttributeType.
      */
-    private void initObjectClassAT( Registries registries )
+    private void initObjectClassAT( SchemaManager schemaManager )
     {
         try
         {
@@ -142,7 +141,7 @@
             {
                 synchronized ( MUTEX )
                 {
-                    OBJECT_CLASS_AT = atRegistry.lookup( SchemaConstants.OBJECT_CLASS_AT );
+                    OBJECT_CLASS_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT );
                 }
             }
         }
@@ -208,7 +207,7 @@
      */
     /* no protection ! */ DefaultServerEntry()
     {
-        atRegistry = null;
+        schemaManager = null;
         dn = LdapDN.EMPTY_LDAPDN;
     }
 
@@ -223,13 +222,13 @@
      * 
      * @param registries The reference to the global registries
      */
-    public DefaultServerEntry( Registries registries )
+    public DefaultServerEntry( SchemaManager schemaManager )
     {
-        atRegistry = registries.getAttributeTypeRegistry();
+        this.schemaManager = schemaManager;
         dn = LdapDN.EMPTY_LDAPDN;
 
         // Initialize the ObjectClass object
-        initObjectClassAT( registries );
+        initObjectClassAT( schemaManager );
     }
 
 
@@ -245,12 +244,12 @@
      * @param registries The reference to the global registries
      * @param entry the entry to copy
      */
-    public DefaultServerEntry( Registries registries, Entry entry )
+    public DefaultServerEntry( SchemaManager schemaManager, Entry entry )
     {
-        atRegistry = registries.getAttributeTypeRegistry();
+        this.schemaManager = schemaManager;
 
         // Initialize the ObjectClass object
-        initObjectClassAT( registries );
+        initObjectClassAT( schemaManager );
 
         // We will clone the existing entry, because it may be normalized
         if ( entry.getDn() != null )
@@ -267,7 +266,7 @@
             try
             {
                 // The dn must be normalized
-                dn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
+                dn.normalize( schemaManager.getNormalizerMapping() );
             }
             catch ( NamingException ne )
             {
@@ -292,7 +291,7 @@
                 }
                 else
                 {
-                    attributeType = registries.getAttributeTypeRegistry().lookup( attribute.getId() );
+                    attributeType = schemaManager.lookupAttributeTypeRegistry( attribute.getId() );
                 }
                 
                 // Create a new ServerAttribute.
@@ -322,7 +321,7 @@
      * @param registries The reference to the global registries
      * @param dn The DN for this serverEntry. Can be null.
      */
-    public DefaultServerEntry( Registries registries, LdapDN dn )
+    public DefaultServerEntry( SchemaManager schemaManager, LdapDN dn )
     {
         if ( dn == null )
         {
@@ -333,10 +332,10 @@
             this.dn = dn;
         }
         
-        atRegistry = registries.getAttributeTypeRegistry();
+        this.schemaManager = schemaManager;
 
         // Initialize the ObjectClass object
-        initObjectClassAT( registries );
+        initObjectClassAT( schemaManager );
     }
 
 
@@ -357,7 +356,7 @@
      * @param dn The DN for this serverEntry. Can be null.
      * @param attributeTypes The list of attributes to create, without value.
      */
-    public DefaultServerEntry( Registries registries, LdapDN dn, AttributeType... attributeTypes )
+    public DefaultServerEntry( SchemaManager schemaManager, LdapDN dn, AttributeType... attributeTypes )
     {
         if ( dn == null )
         {
@@ -368,10 +367,10 @@
             this.dn = dn;
         }
 
-        atRegistry = registries.getAttributeTypeRegistry();
+        this.schemaManager = schemaManager;
 
         // Initialize the ObjectClass object
-        initObjectClassAT( registries );
+        initObjectClassAT( schemaManager );
 
         // Add the attributeTypes
         set( attributeTypes );
@@ -399,7 +398,7 @@
      * @param attributeType The attribute to create, without value.
      * @param upId The User Provided ID fro this AttributeType
      */
-    public DefaultServerEntry( Registries registries, LdapDN dn, AttributeType attributeType, String upId )
+    public DefaultServerEntry( SchemaManager schemaManager, LdapDN dn, AttributeType attributeType, String upId )
     {
         if ( dn == null )
         {
@@ -410,11 +409,11 @@
             this.dn = dn;
         }
         
-        atRegistry = registries.getAttributeTypeRegistry();
+        this.schemaManager = schemaManager;
         // Initialize the ObjectClass object
 
         // Initialize the ObjectClass object
-        initObjectClassAT( registries );
+        initObjectClassAT( schemaManager );
 
         try
         {
@@ -441,7 +440,7 @@
      * @param dn The DN for this serverEntry. Can be null.
      * @param upIds The list of attributes to create.
      */
-    public DefaultServerEntry( Registries registries, LdapDN dn, String... upIds )
+    public DefaultServerEntry( SchemaManager schemaManager, LdapDN dn, String... upIds )
     {
         if ( dn == null )
         {
@@ -452,9 +451,9 @@
             this.dn = dn;
         }
         
-        atRegistry = registries.getAttributeTypeRegistry();
+        this.schemaManager = schemaManager;
 
-        initObjectClassAT( registries );
+        initObjectClassAT( schemaManager );
 
         set( upIds );
     }
@@ -473,7 +472,7 @@
      * @param dn The DN for this serverEntry. Can be null
      * @param attributes The list of attributes to create
      */
-    public DefaultServerEntry( Registries registries, LdapDN dn, ServerAttribute... attributes )
+    public DefaultServerEntry( SchemaManager schemaManager, LdapDN dn, ServerAttribute... attributes )
     {
         if ( dn == null )
         {
@@ -484,9 +483,9 @@
             this.dn = dn;
         }
         
-        atRegistry = registries.getAttributeTypeRegistry();
+        this.schemaManager = schemaManager;
 
-        initObjectClassAT( registries );
+        initObjectClassAT( schemaManager );
 
         for ( ServerAttribute attribute:attributes )
         {
@@ -991,7 +990,7 @@
         
         try
         {
-            AttributeType attributeType = atRegistry.lookup( id );
+            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( id );
             
             if ( attributeType == null )
             {
@@ -1033,7 +1032,7 @@
         
         try
         {
-            AttributeType attributeType = atRegistry.lookup( id );
+            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( id );
             
             if ( attributeType == null )
             {
@@ -1075,7 +1074,7 @@
         
         try
         {
-            AttributeType attributeType = atRegistry.lookup( id );
+            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( id );
             
             if ( attributeType == null )
             {
@@ -1180,7 +1179,7 @@
     {
         try
         {
-            return get( atRegistry.lookup( StringTools.trim( StringTools.toLowerCase( alias ) ) ) );
+            return get( schemaManager.lookupAttributeTypeRegistry( StringTools.trim( StringTools.toLowerCase( alias ) ) ) );
         }
         catch ( NamingException ne )
         {
@@ -2104,7 +2103,7 @@
             
             try
             {
-                attributeType = atRegistry.lookup( attribute );
+                attributeType = schemaManager.lookupAttributeTypeRegistry( attribute );
             }
             catch ( NamingException ne )
             {
@@ -2385,7 +2384,7 @@
             
             try
             {
-                AttributeType attributeType = atRegistry.lookup( oid );
+                AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( oid );
                 
                 // Create the attribute we will read
                 DefaultServerAttribute attribute = new DefaultServerAttribute( attributeType );

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntrySerializer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntrySerializer.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntrySerializer.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntrySerializer.java Sat Nov  7 07:57:34 2009
@@ -25,12 +25,12 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import jdbm.helper.Serializer;
+
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import jdbm.helper.Serializer;
-
 
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -48,18 +48,18 @@
      */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
-    /** The registries reference */
-    private transient Registries registries;
+    /** The schemaManager reference */
+    private transient SchemaManager schemaManager;
 
 
     /**
      * Creates a new instance of ServerEntrySerializer.
      *
-     * @param registries The reference to the global registries
+     * @param schemaManager The reference to the global schemaManager
      */
-    public ServerEntrySerializer( Registries registries )
+    public ServerEntrySerializer( SchemaManager schemaManager )
     {
-        this.registries = registries;
+        this.schemaManager = schemaManager;
     }
 
 
@@ -144,7 +144,7 @@
     {
         ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( bytes ) );
 
-        DefaultServerEntry serverEntry = new DefaultServerEntry( registries );
+        DefaultServerEntry serverEntry = new DefaultServerEntry( schemaManager );
         
         try
         {

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java Sat Nov  7 07:57:34 2009
@@ -42,9 +42,8 @@
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.util.EmptyEnumeration;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -195,14 +194,14 @@
      * 
      * @throws InvalidAttributeIdentifierException If we get an invalid attribute
      */
-    public static ServerEntry toServerEntry( Attributes attributes, LdapDN dn, Registries registries ) 
+    public static ServerEntry toServerEntry( Attributes attributes, LdapDN dn, SchemaManager schemaManager ) 
             throws InvalidAttributeIdentifierException
     {
         if ( attributes instanceof BasicAttributes )
         {
             try 
             {
-                ServerEntry entry = new DefaultServerEntry( registries, dn );
+                ServerEntry entry = new DefaultServerEntry( schemaManager, dn );
     
                 for ( NamingEnumeration<? extends Attribute> attrs = attributes.getAll(); attrs.hasMoreElements(); )
                 {
@@ -212,7 +211,7 @@
                     String id = SchemaUtils.stripOptions( attributeId );
                     Set<String> options = SchemaUtils.getOptions( attributeId );
                     // TODO : handle options.
-                    AttributeType attributeType = registries.getAttributeTypeRegistry().lookup( id );
+                    AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( id );
                     ServerAttribute serverAttribute = ServerEntryUtils.toServerAttribute( attr, attributeType );
                     
                     if ( serverAttribute != null )
@@ -244,12 +243,12 @@
      * @return the resultant entry after the modification has taken place
      * @throws NamingException if there are problems accessing attributes
      */
-    public static ServerEntry getTargetEntry( Modification mod, ServerEntry entry, Registries registries ) throws NamingException
+    public static ServerEntry getTargetEntry( Modification mod, ServerEntry entry, SchemaManager schemaManager ) throws NamingException
     {
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         ModificationOperation modOp = mod.getOperation();
         String id = mod.getAttribute().getId();
-        AttributeType attributeType = registries.getAttributeTypeRegistry().lookup( id );
+        AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( id );
         
         switch ( modOp )
         {
@@ -397,7 +396,7 @@
      * @throws NamingException
      */
     public static List<Modification> convertToServerModification( List<ModificationItem> modificationItems, 
-        AttributeTypeRegistry atRegistry ) throws NamingException
+        SchemaManager schemaManager ) throws NamingException
     {
         if ( modificationItems != null )
         {
@@ -405,7 +404,7 @@
 
             for ( ModificationItem modificationItem: modificationItems )
             {
-                AttributeType attributeType = atRegistry.lookup( modificationItem.getAttribute().getID() );
+                AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( modificationItem.getAttribute().getID() );
                 modifications.add( toServerModification( modificationItem, attributeType ) );
             }
         
@@ -442,7 +441,7 @@
 
     
     public static List<Modification> toServerModification( Modification[] modifications, 
-        AttributeTypeRegistry atRegistry ) throws NamingException
+        SchemaManager schemaManager ) throws NamingException
     {
         if ( modifications != null )
         {
@@ -463,7 +462,7 @@
                 // TODO - after removing JNDI we need to make the server handle 
                 // this in the codec
                 
-                if ( ! atRegistry.contains( id ) 
+                if ( ! schemaManager.getAttributeTypeRegistry().contains( id ) 
                      && modification.getAttribute().size() == 0 
                      && modification.getOperation() == ModificationOperation.REPLACE_ATTRIBUTE )
                 {
@@ -476,7 +475,7 @@
                 
                 
                 // TODO : handle options
-                AttributeType attributeType = atRegistry.lookup( id );
+                AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( id );
                 modificationsList.add( toServerModification( modification, attributeType ) );
             }
         
@@ -490,7 +489,7 @@
 
 
     public static List<Modification> toServerModification( ModificationItem[] modifications, 
-        AttributeTypeRegistry atRegistry ) throws NamingException
+        SchemaManager schemaManager ) throws NamingException
     {
         if ( modifications != null )
         {
@@ -510,7 +509,7 @@
                 // TODO - after removing JNDI we need to make the server handle 
                 // this in the codec
                 
-                if ( ! atRegistry.contains( id ) 
+                if ( ! schemaManager.getAttributeTypeRegistry().contains( id ) 
                      && modification.getAttribute().size() == 0 
                      && modification.getModificationOp() == DirContext.REPLACE_ATTRIBUTE )
                 {
@@ -523,7 +522,7 @@
                 
                 
                 // TODO : handle options
-                AttributeType attributeType = atRegistry.lookup( id );
+                AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( id );
                 modificationsList.add( toServerModification( (ModificationItem)modification, attributeType ) );
             }
         

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java Sat Nov  7 07:57:34 2009
@@ -24,15 +24,13 @@
 import java.io.ObjectOutput;
 
 import javax.naming.NamingException;
-//import javax.naming.directory.DirContext;
 
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-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.SchemaManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -81,7 +79,7 @@
     }
     
     
-    public ServerModification( Registries registries, Modification modification )
+    public ServerModification( SchemaManager schemaManager, Modification modification )
     {
         operation = modification.getOperation();
         
@@ -97,7 +95,7 @@
             }
             else
             {
-                at = registries.getAttributeTypeRegistry().lookup( modAttribute.getId() );
+                at = schemaManager.lookupAttributeTypeRegistry( modAttribute.getId() );
             }
             
             attribute = new DefaultServerAttribute( at, modAttribute );
@@ -278,7 +276,7 @@
      * @throws ClassNotFoundException if we weren't able to construct a Modification instance
      * @throws NamingException If we didn't found the AttributeType in the registries
      */
-    public void deserialize( ObjectInput in, AttributeTypeRegistry atRegistry ) throws IOException, ClassNotFoundException, NamingException
+    public void deserialize( ObjectInput in, SchemaManager schemaManager ) throws IOException, ClassNotFoundException, NamingException
     {
         // Read the operation
         int op = in.readInt();
@@ -289,7 +287,7 @@
         String oid = in.readUTF();
         
         // Lookup for tha associated AttributeType
-        AttributeType attributeType = atRegistry.lookup( oid );
+        AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( oid );
         
         attribute = new DefaultServerAttribute( attributeType );
         

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerAttributeTest.java Sat Nov  7 07:57:34 2009
@@ -120,11 +120,11 @@
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy();
     	loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager sm = new DefaultSchemaManager( loader );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
 
-        sm.loadAllEnabled();
+        schemaManager.loadAllEnabled();
         
-        List<Throwable> errors = sm.getErrors();
+        List<Throwable> errors = schemaManager.getErrors();
         
         if ( errors.size() != 0 )
         {
@@ -133,10 +133,10 @@
                 ExceptionUtils.printErrors( errors ) );
         }
         
-        atCN = sm.getRegistries().getAttributeTypeRegistry().lookup( "cn" );
-        atC = sm.getRegistries().getAttributeTypeRegistry().lookup( "c" );
-        atSN = sm.getRegistries().getAttributeTypeRegistry().lookup( "sn" );
-        atPwd = sm.getRegistries().getAttributeTypeRegistry().lookup( "userpassword" );
+        atCN = schemaManager.lookupAttributeTypeRegistry( "cn" );
+        atC = schemaManager.lookupAttributeTypeRegistry( "c" );
+        atSN = schemaManager.lookupAttributeTypeRegistry( "sn" );
+        atPwd = schemaManager.lookupAttributeTypeRegistry( "userpassword" );
     }
 
     /**



Mime
View raw message