directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r815970 - /directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/
Date Wed, 16 Sep 2009 21:15:07 GMT
Author: elecharny
Date: Wed Sep 16 21:15:03 2009
New Revision: 815970

URL: http://svn.apache.org/viewvc?rev=815970&view=rev
Log:
Renamed some method for clarity.

Modified:
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/DitContentRuleSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/DitStructureRuleSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleUseSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NameFormSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.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/AttributeTypeSynchronizer.java?rev=815970&r1=815969&r2=815970&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
Wed Sep 16 21:15:03 2009
@@ -32,6 +32,7 @@
 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.registries.Schema;
 
 
 /**
@@ -60,9 +61,15 @@
         String oid = getOid( entry );
         AttributeType at = factory.getAttributeType( targetEntry, registries, schemaName
);
         
-        if ( registries.isSchemaLoaded( schemaName ) )
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
-            atRegistry.unregister( oid );
+            if ( atRegistry.contains( oid ) )
+            {
+                atRegistry.unregister( oid );
+            }
+            
             atRegistry.register( at );
             
             return SCHEMA_MODIFIED;
@@ -82,8 +89,11 @@
         String schemaName = getSchemaName( name );
         AttributeType at = factory.getAttributeType( entry, registries, schemaName );
         
-        if ( registries.isSchemaLoaded( schemaName ) )
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
+            // Don't inject the modified element if the schema is disabled
             atRegistry.register( at );
         }
         else
@@ -98,10 +108,14 @@
         String schemaName = getSchemaName( name );
         AttributeType at = factory.getAttributeType( entry, registries, schemaName );
         
-        if ( registries.isSchemaLoaded( schemaName ) )
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
+            // Don't inject the modified element if the schema is disabled
             atRegistry.unregister( at.getOid() );
         }
+        
         unregisterOids( at.getOid() );
     }
 
@@ -117,21 +131,20 @@
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
         AttributeType at = factory.getAttributeType( targetEntry, registries, schemaName
);
 
-        if ( registries.isSchemaLoaded( schemaName ) )
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             atRegistry.unregister( oldAt.getOid() );
             atRegistry.register( at );
         }
-        else
-        {
-            registerOids( at );
-        }
         
         unregisterOids( oldAt.getOid() );
+        registerOids( at );
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean
deleteOldRn,
         ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
@@ -144,13 +157,18 @@
         checkOidIsUnique( newOid );
         AttributeType at = factory.getAttributeType( targetEntry, registries, newSchemaName
);
 
-        if ( registries.isSchemaLoaded( oldSchemaName ) )
+        Schema oldSchema = registries.getLoadedSchema( oldSchemaName );
+        
+        if ( ( oldSchema != null ) && oldSchema.isEnabled() )
         {
             atRegistry.unregister( oldAt.getOid() );
         }
+
         unregisterOids( oldAt.getOid() );
 
-        if ( registries.isSchemaLoaded( newSchemaName ) )
+        Schema newSchema = registries.getLoadedSchema( newSchemaName );
+        
+        if ( ( newSchema != null ) && newSchema.isEnabled() )
         {
             atRegistry.register( at );
         }
@@ -161,7 +179,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
         throws Exception
     {
         checkNewParent( newParentName );
@@ -170,12 +188,16 @@
         AttributeType oldAt = factory.getAttributeType( entry, registries, oldSchemaName
);
         AttributeType at = factory.getAttributeType( entry, registries, newSchemaName );
         
-        if ( registries.isSchemaLoaded( oldSchemaName ) )
+        Schema oldSchema = registries.getLoadedSchema( oldSchemaName );
+        
+        if ( ( oldSchema != null ) && oldSchema.isEnabled() )
         {
             atRegistry.unregister( oldAt.getOid() );
         }
         
-        if ( registries.isSchemaLoaded( newSchemaName ) )
+        Schema newSchema = registries.getLoadedSchema( newSchemaName );
+        
+        if ( ( newSchema != null ) && newSchema.isEnabled() )
         {
             atRegistry.register( at );
         }
@@ -192,6 +214,7 @@
         }
         
         Rdn rdn = newParent.getRdn();
+        
         if ( ! registries.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
SchemaConstants.OU_AT_OID ) )
         {
             throw new LdapInvalidNameException( "The parent entry of a attributeType should
be an organizationalUnit.", 

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.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/ComparatorSynchronizer.java?rev=815970&r1=815969&r2=815970&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
Wed Sep 16 21:15:03 2009
@@ -34,6 +34,7 @@
 import org.apache.directory.shared.ldap.schema.registries.ComparatorRegistry;
 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;
 
 
 /**
@@ -82,7 +83,12 @@
         checkOidIsUniqueForComparator( entry );
         LdapComparator<?> comparator = factory.getLdapComparator( entry, registries
);
         
-        if ( isSchemaLoaded( name ) )
+        String schemaName = getSchemaName( name );
+        comparator.setSchemaName( schemaName );
+        
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             comparatorRegistry.register( comparator );
         }
@@ -92,6 +98,7 @@
     public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws Exception
     {
         String oid = getOid( entry );
+        
         if ( matchingRuleRegistry.contains( oid ) )
         {
             throw new LdapOperationNotSupportedException( "The comparator with OID " + oid

@@ -122,7 +129,11 @@
         String oid = ( String ) newRdn.getValue();
         checkOidIsUniqueForComparator( oid );
         
-        if ( isSchemaLoaded( name ) )
+        String schemaName = getSchemaName( name );
+        
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             LdapComparator<?> comparator = factory.getLdapComparator( entry, registries
);
             comparatorRegistry.unregister( oldOid );
@@ -131,7 +142,7 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean
deleteOldRn,
         ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
@@ -150,19 +161,27 @@
         
         LdapComparator<?> comparator = factory.getLdapComparator( entry, registries
);
 
-        if ( isSchemaLoaded( oriChildName ) )
+        String oldSchemaName = getSchemaName( oriChildName );
+        
+        Schema oldSchema = registries.getLoadedSchema( oldSchemaName );
+        
+        if ( ( oldSchema != null ) && oldSchema.isEnabled() )
         {
             comparatorRegistry.unregister( oldOid );
         }
 
-        if ( isSchemaLoaded( newParentName ) )
+        String newSchemaName = getSchemaName( newParentName );
+        
+        Schema newSchema = registries.getLoadedSchema( newSchemaName );
+        
+        if ( ( newSchema != null ) && newSchema.isEnabled() )
         {
             comparatorRegistry.register( comparator );
         }
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
         throws Exception
     {
         checkNewParent( newParentName );
@@ -178,12 +197,20 @@
 
         LdapComparator<?> comparator = factory.getLdapComparator( entry, registries
);
         
-        if ( isSchemaLoaded( oriChildName ) )
+        String oldSchemaName = getSchemaName( oriChildName );
+        
+        Schema oldSchema = registries.getLoadedSchema( oldSchemaName );
+        
+        if ( ( oldSchema != null ) && oldSchema.isEnabled() )
         {
             comparatorRegistry.unregister( oid );
         }
         
-        if ( isSchemaLoaded( newParentName ) )
+        String newSchemaName = getSchemaName( newParentName );
+        
+        Schema newSchema = registries.getLoadedSchema( newSchemaName );
+        
+        if ( ( newSchema != null ) && newSchema.isEnabled() )
         {
             comparatorRegistry.register( comparator );
         }

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/DitContentRuleSynchronizer.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/DitContentRuleSynchronizer.java?rev=815970&r1=815969&r2=815970&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/DitContentRuleSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/DitContentRuleSynchronizer.java
Wed Sep 16 21:15:03 2009
@@ -20,14 +20,14 @@
 package org.apache.directory.server.core.schema.registries.synchronizers;
 
 
+import javax.naming.NamingException;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.DITContentRule;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 
-import javax.naming.NamingException;
-
 
 /**
  * A schema entity change handler for DitContentRules.
@@ -78,7 +78,7 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN,
org.apache.directory.shared.ldap.name.LdapDN, java.lang.String, boolean, javax.naming.directory.Attributes)
      */
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean
deleteOldRn,
         ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
@@ -88,7 +88,7 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN,
org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, 
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, 
         boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/DitStructureRuleSynchronizer.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/DitStructureRuleSynchronizer.java?rev=815970&r1=815969&r2=815970&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/DitStructureRuleSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/DitStructureRuleSynchronizer.java
Wed Sep 16 21:15:03 2009
@@ -20,14 +20,14 @@
 package org.apache.directory.server.core.schema.registries.synchronizers;
 
 
+import javax.naming.NamingException;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.DITStructureRule;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 
-import javax.naming.NamingException;
-
 
 /**
  * A schema entity change handler for DitStructureRules.
@@ -85,7 +85,7 @@
      * org.apache.directory.shared.ldap.name.LdapDN, 
      * java.lang.String, boolean, javax.naming.directory.Attributes)
      */
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean
deleteOldRn,
         ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
@@ -98,7 +98,7 @@
      * org.apache.directory.shared.ldap.name.LdapDN, 
      * javax.naming.directory.Attributes)
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, 
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, 
         boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.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/MatchingRuleSynchronizer.java?rev=815970&r1=815969&r2=815970&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
Wed Sep 16 21:15:03 2009
@@ -32,6 +32,7 @@
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 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;
 
 
 /**
@@ -83,7 +84,9 @@
         String schemaName = getSchemaName( name );
         MatchingRule mr = factory.getMatchingRule( entry, registries, schemaName );
         
-        if ( registries.isSchemaLoaded( schemaName ) )
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             matchingRuleRegistry.register( mr );
         }
@@ -98,10 +101,14 @@
     {
         String schemaName = getSchemaName( name );
         MatchingRule mr = factory.getMatchingRule( entry, registries, schemaName );
-        if ( registries.isSchemaLoaded( schemaName ) )
+        
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             matchingRuleRegistry.unregister( mr.getOid() );
         }
+        
         unregisterOids( mr.getOid() );
     }
 
@@ -131,7 +138,7 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,

+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean
deleteOldRn, 
         ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
@@ -162,7 +169,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
         throws Exception
     {
         checkNewParent( newParentName );

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleUseSynchronizer.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/MatchingRuleUseSynchronizer.java?rev=815970&r1=815969&r2=815970&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleUseSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleUseSynchronizer.java
Wed Sep 16 21:15:03 2009
@@ -20,14 +20,14 @@
 package org.apache.directory.server.core.schema.registries.synchronizers;
 
 
+import javax.naming.NamingException;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.MatchingRuleUse;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 
-import javax.naming.NamingException;
-
 
 /**
  * A schema entity change handler for DitMatchingRuleUses.
@@ -66,14 +66,14 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean
deleteOldRn,
         ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName,
+    public void move( LdapDN oriChildName, LdapDN newParentName,
         ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NameFormSynchronizer.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/NameFormSynchronizer.java?rev=815970&r1=815969&r2=815970&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NameFormSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NameFormSynchronizer.java
Wed Sep 16 21:15:03 2009
@@ -81,7 +81,7 @@
      * org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN,

      * Rdn, boolean, javax.naming.directory.Attributes)
      */
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn,
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRn,
         boolean deleteOldRn, ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
@@ -93,7 +93,7 @@
      * org.apache.directory.shared.ldap.name.LdapDN, 
      * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, 
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, 
         boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.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/NormalizerSynchronizer.java?rev=815970&r1=815969&r2=815970&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
Wed Sep 16 21:15:03 2009
@@ -34,6 +34,7 @@
 import org.apache.directory.shared.ldap.schema.registries.MatchingRuleRegistry;
 import org.apache.directory.shared.ldap.schema.registries.NormalizerRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.registries.Schema;
 
 
 /**
@@ -82,7 +83,12 @@
         
         Normalizer normalizer = factory.getNormalizer( entry, registries );
         
-        if ( isSchemaLoaded( name ) )
+        String schemaName = getSchemaName( name );
+        normalizer.setSchemaName( schemaName );
+        
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             normalizerRegistry.register( normalizer );
         }
@@ -136,7 +142,7 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean
deleteOldRn,
         ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
@@ -166,7 +172,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
         throws Exception
     {
         checkNewParent( newParentName );

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.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/ObjectClassSynchronizer.java?rev=815970&r1=815969&r2=815970&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
Wed Sep 16 21:15:03 2009
@@ -32,6 +32,7 @@
 import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.registries.Schema;
 
 
 /**
@@ -79,7 +80,9 @@
         String schemaName = getSchemaName( name );
         ObjectClass oc = factory.getObjectClass( entry, registries, schemaName );
 
-        if ( isSchemaLoaded( name ) )
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             objectClassRegistry.register( oc );
         }
@@ -95,7 +98,9 @@
         String schemaName = getSchemaName( name );
         ObjectClass oc = factory.getObjectClass( entry, registries, schemaName );
 
-        if ( isSchemaLoaded( name ) )
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             objectClassRegistry.unregister( oc.getOid() );
         }
@@ -127,7 +132,9 @@
         checkOidIsUnique( newOid );
         ObjectClass oc = factory.getObjectClass( targetEntry, registries, schemaName );
 
-        if ( isSchemaLoaded( name ) )
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             objectClassRegistry.unregister( oldOc.getOid() );
             objectClassRegistry.register( oc );
@@ -141,7 +148,7 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
ServerEntry entry, 
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean
deleteOldRn, ServerEntry entry, 
         boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
@@ -166,13 +173,18 @@
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
         ObjectClass oc = factory.getObjectClass( targetEntry, registries, newSchemaName );
 
-        if ( isSchemaLoaded( oriChildName ) )
+        Schema oldSchema = registries.getLoadedSchema( oldSchemaName );
+        
+        if ( ( oldSchema != null ) && oldSchema.isEnabled() )
         {
             objectClassRegistry.unregister( oldOc.getOid() );
         }
+        
         unregisterOids( oldOc.getOid() );
         
-        if ( isSchemaLoaded( newParentName ) )
+        Schema newSchema = registries.getLoadedSchema( newSchemaName );
+        
+        if ( ( newSchema != null ) && newSchema.isEnabled() )
         {
             objectClassRegistry.register( oc );
         }
@@ -183,7 +195,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
         throws Exception
     {
         checkNewParent( newParentName );

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizer.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/RegistrySynchronizer.java?rev=815970&r1=815969&r2=815970&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizer.java
Wed Sep 16 21:15:03 2009
@@ -20,14 +20,14 @@
 package org.apache.directory.server.core.schema.registries.synchronizers;
 
 
+import java.util.List;
+
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 
-import java.util.List;
-
 
 /**
  * Interface used to detect and react to changes performed on schema entities
@@ -57,8 +57,8 @@
     boolean modify( LdapDN name, List<Modification> mods, ServerEntry entry, ServerEntry
targetEntry, boolean cascaded )
         throws Exception;
     
-    void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
ServerEntry entry,
+    void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
ServerEntry entry,
         boolean cascaded ) throws Exception;
     
-    void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascaded
) throws Exception;
+    void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascaded
) throws Exception;
 }

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=815970&r1=815969&r2=815970&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
Wed Sep 16 21:15:03 2009
@@ -318,7 +318,7 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeManager#modifyRn(org.apache.directory.server.core.interceptor.context.RenameOperationContext,
org.apache.directory.server.core.entry.ServerEntry, boolean)
      */
-    public void modifyRn( RenameOperationContext opContext, ServerEntry entry, boolean doCascadeModify
) 
+    public void rename( RenameOperationContext opContext, ServerEntry entry, boolean doCascadeModify
) 
         throws Exception
     {
         EntryAttribute oc = entry.get( objectClassAT );
@@ -348,7 +348,7 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeManager#replace(org.apache.directory.server.core.interceptor.context.MoveOperationContext,
org.apache.directory.server.core.entry.ServerEntry, boolean)
      */
-    public void replace( MoveOperationContext opContext, ServerEntry entry, boolean cascade
) throws Exception
+    public void move( MoveOperationContext opContext, ServerEntry entry, boolean cascade
) throws Exception
     {
         EntryAttribute oc = entry.get( objectClassAT );
         
@@ -359,14 +359,14 @@
             if ( objectClass2synchronizerMap.containsKey( oid ) )
             {
                 RegistrySynchronizer synchronizer = objectClass2synchronizerMap.get( oid
);
-                synchronizer.replace( opContext.getDn(), opContext.getParent(), entry, cascade
);
+                synchronizer.move( opContext.getDn(), opContext.getParent(), entry, cascade
);
                 return;
             }
         }
 
         if ( oc.contains( MetaSchemaConstants.META_SCHEMA_OC ) )
         {
-            schemaSynchronizer.replace( opContext.getDn(), opContext.getParent(), entry,
cascade );
+            schemaSynchronizer.move( opContext.getDn(), opContext.getParent(), entry, cascade
);
             return;
         }
         
@@ -377,7 +377,7 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeManager#move(org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext,
org.apache.directory.server.core.entry.ServerEntry, boolean)
      */
-    public void move( MoveAndRenameOperationContext opContext, ServerEntry entry, boolean
cascade ) throws Exception
+    public void moveAndRename( MoveAndRenameOperationContext opContext, ServerEntry entry,
boolean cascade ) throws Exception
     {
         EntryAttribute oc = entry.get( objectClassAT );
         
@@ -388,7 +388,7 @@
             if ( objectClass2synchronizerMap.containsKey( oid ) )
             {
                 RegistrySynchronizer synchronizer = objectClass2synchronizerMap.get( oid
);
-                synchronizer.move( opContext.getDn(), opContext.getParent(), opContext.getNewRdn(),

+                synchronizer.moveAndRename( opContext.getDn(), opContext.getParent(), opContext.getNewRdn(),

                     opContext.getDelOldDn(), entry, cascade );
                 return;
             }
@@ -396,7 +396,7 @@
 
         if ( oc.contains( MetaSchemaConstants.META_SCHEMA_OC ) )
         {
-            schemaSynchronizer.move( opContext.getDn(), opContext.getParent(), opContext.getNewRdn(),

+            schemaSynchronizer.moveAndRename( opContext.getDn(), opContext.getParent(), opContext.getNewRdn(),

                 opContext.getDelOldDn(), entry, cascade );
             return;
         }

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=815970&r1=815969&r2=815970&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
Wed Sep 16 21:15:03 2009
@@ -20,12 +20,18 @@
 package org.apache.directory.server.core.schema.registries.synchronizers;
 
 
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.naming.NamingException;
+
 import org.apache.commons.lang.NotImplementedException;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.schema.PartitionSchemaLoader;
-import org.apache.directory.shared.ldap.schema.registries.Schema;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -40,15 +46,10 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaObject;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.registries.Schema;
 import org.apache.directory.shared.ldap.schema.registries.SchemaObjectRegistry;
 import org.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory;
 
-import javax.naming.NamingException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 
 /**
  * @TODO poorly implemented - revisit the SchemaChangeHandler for this puppy
@@ -178,7 +179,7 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
ServerEntry entry, boolean cascaded ) throws NamingException
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean
deleteOldRn, ServerEntry entry, boolean cascaded ) throws NamingException
     {
 
     }
@@ -369,7 +370,7 @@
      * Moves are not allowed for metaSchema objects so this always throws an
      * UNWILLING_TO_PERFORM LdapException.
      */
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn,

+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean
deleteOldRn, 
         ServerEntry entry, boolean cascade ) throws NamingException
     {
         throw new LdapOperationNotSupportedException( "Moving around schemas is not allowed.",
@@ -381,7 +382,7 @@
      * Moves are not allowed for metaSchema objects so this always throws an
      * UNWILLING_TO_PERFORM LdapException.
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, 
+    public void move( LdapDN oriChildName, LdapDN newParentName, 
         ServerEntry entry, boolean cascade ) throws NamingException
     {
         throw new LdapOperationNotSupportedException( "Moving around schemas is not allowed.",

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=815970&r1=815969&r2=815970&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
Wed Sep 16 21:15:03 2009
@@ -34,6 +34,7 @@
 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.Schema;
 import org.apache.directory.shared.ldap.schema.registries.SyntaxCheckerRegistry;
 
 
@@ -80,6 +81,7 @@
         parentDn.remove( parentDn.size() - 1 );
         checkNewParent( parentDn );
         String oid = getOid( entry );
+        
         if ( registries.getSyntaxCheckerRegistry().contains( oid ) )
         {
             throw new LdapNamingException( "Oid " + oid + " for new schema syntaxChecker
is not unique.", 
@@ -88,7 +90,12 @@
         
         SyntaxChecker syntaxChecker = factory.getSyntaxChecker( entry, registries );
 
-        if ( isSchemaLoaded( name ) )
+        String schemaName = getSchemaName( name );
+        syntaxChecker.setSchemaName( schemaName );
+
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             syntaxCheckerRegistry.register( syntaxChecker );
         }
@@ -98,6 +105,7 @@
     public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws Exception
     {
         String oid = getOid( entry );
+        
         if ( ldapSyntaxRegistry.contains( oid ) )
         {
             throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " +
oid 
@@ -106,7 +114,11 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
         
-        if ( isSchemaLoaded( name ) && syntaxCheckerRegistry.contains( oid ) )
+        String schemaName = getSchemaName( name );
+
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             syntaxCheckerRegistry.unregister( oid );
         }
@@ -143,7 +155,7 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,

+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean
deleteOldRn, 
         ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
@@ -181,7 +193,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
         throws Exception
     {
         checkNewParent( newParentName );

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=815970&r1=815969&r2=815970&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
Wed Sep 16 21:15:03 2009
@@ -32,6 +32,7 @@
 import org.apache.directory.shared.ldap.schema.LdapSyntax;
 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.Schema;
 
 
 /**
@@ -81,7 +82,9 @@
         String schemaName = getSchemaName( name );
         LdapSyntax syntax = factory.getSyntax( entry, registries, schemaName );
 
-        if ( isSchemaLoaded( name ) )
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             syntaxRegistry.register( syntax );
         }
@@ -96,7 +99,11 @@
     public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws Exception
     {
         String oid = getOid( entry );
-        if ( isSchemaLoaded( name ) && syntaxRegistry.contains( oid ) )
+        
+        String schemaName = getSchemaName( name );
+        Schema schema = registries.getLoadedSchema( schemaName );
+        
+        if ( ( schema != null ) && schema.isEnabled() )
         {
             syntaxRegistry.unregister( oid );
         }
@@ -143,7 +150,7 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean
deleteOldRn,
         ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
@@ -188,7 +195,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
         throws Exception
     {
         checkNewParent( newParentName );



Mime
View raw message