directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1244030 - in /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers: RegistrySynchronizerAdaptor.java SchemaSynchronizer.java SyntaxCheckerSynchronizer.java
Date Tue, 14 Feb 2012 16:01:00 GMT
Author: elecharny
Date: Tue Feb 14 16:01:00 2012
New Revision: 1244030

URL: http://svn.apache.org/viewvc?rev=1244030&view=rev
Log:
Reverted the previous change : we can't get rid of the registries here, this is the place
where we modify an existing SchemaManager by changing a copy of its internal Registries. Trying
to modify the SchemaManager instead will lead to very painful potential schema breakage !

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/SchemaSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java?rev=1244030&r1=1244029&r2=1244030&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
Tue Feb 14 16:01:00 2012
@@ -47,13 +47,14 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.ObjectClass;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.registries.ObjectClassRegistry;
+import org.apache.directory.shared.ldap.model.schema.registries.Registries;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
- * Central point of control for schemas enforced by the server.  The
+ * Central point of control for schemas enforced by the server.  The 
  * following duties are presently performed by this class:
  * 
  * <ul>

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/SchemaSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/SchemaSynchronizer.java?rev=1244030&r1=1244029&r2=1244030&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/SchemaSynchronizer.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/SchemaSynchronizer.java
Tue Feb 14 16:01:00 2012
@@ -44,6 +44,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
+import org.apache.directory.shared.ldap.model.schema.registries.Registries;
 import org.apache.directory.shared.ldap.model.schema.registries.Schema;
 import org.apache.directory.shared.ldap.schemaloader.SchemaEntityFactory;
 import org.apache.directory.shared.util.Strings;

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java?rev=1244030&r1=1244029&r2=1244030&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
Tue Feb 14 16:01:00 2012
@@ -34,7 +34,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.SyntaxChecker;
-import org.apache.directory.shared.ldap.model.schema.registries.Registries;
 import org.apache.directory.shared.ldap.model.schema.registries.Schema;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
@@ -42,8 +41,8 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * A synchronizer which detects changes to syntaxCheckers and updates the 
- * respective {@link Registries}.
+ * A synchronizer which detects changes to syntaxCheckers and updates the
+ * {@link SchemaManager}.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -112,8 +111,8 @@ public class SyntaxCheckerSynchronizer e
         SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(),
             schemaName );
 
-        // At this point, the constructed SyntaxChecker has not been checked against the

-        // existing Registries. It will be checked there, if the schema and the 
+        // At this point, the constructed SyntaxChecker has not been checked against the
+        // existing SchemaManager. It will be checked there, if the schema and the
         // SyntaxChecker are both enabled.
         Schema schema = schemaManager.getLoadedSchema( schemaName );
 
@@ -168,7 +167,7 @@ public class SyntaxCheckerSynchronizer e
 
         try
         {
-            syntaxChecker = ( SyntaxChecker ) checkSyntaxCheckerOidExists( entry );
+            syntaxChecker = checkSyntaxCheckerOidExists( entry );
         }
         catch ( LdapSchemaViolationException lsve )
         {
@@ -180,7 +179,7 @@ public class SyntaxCheckerSynchronizer e
                 // Remove the syntaxChecker from the schema/SchemaObject Map
                 schemaManager.getRegistries().dissociateFromSchema( syntaxChecker );
 
-                // Ok, we can exit. 
+                // Ok, we can exit.
                 return;
             }
             else
@@ -227,7 +226,7 @@ public class SyntaxCheckerSynchronizer e
                 I18n.err( I18n.ERR_389, oldOid ) );
         }
 
-        Entry targetEntry = ( Entry ) entry.clone();
+        Entry targetEntry = entry.clone();
         String newOid = newRdn.getNormValue().getString();
 
         if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
@@ -262,7 +261,7 @@ public class SyntaxCheckerSynchronizer e
                 I18n.err( I18n.ERR_391, oldOid ) );
         }
 
-        Entry targetEntry = ( Entry ) entry.clone();
+        Entry targetEntry = entry.clone();
 
         String newOid = newRdn.getNormValue().getString();
 
@@ -338,7 +337,7 @@ public class SyntaxCheckerSynchronizer e
 
         if ( schemaManager.getSyntaxCheckerRegistry().contains( oid ) )
         {
-            return ( SyntaxChecker ) schemaManager.getSyntaxCheckerRegistry().get( oid );
+            return schemaManager.getSyntaxCheckerRegistry().get( oid );
         }
         else
         {



Mime
View raw message