directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r807974 - in /directory: apacheds/branches/apacheds-schema/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/
Date Wed, 26 Aug 2009 12:01:28 GMT
Author: elecharny
Date: Wed Aug 26 12:01:27 2009
New Revision: 807974

URL: http://svn.apache.org/viewvc?rev=807974&view=rev
Log:
Fixed the registries constructor so that it takes the oidRegistry as an input, as we need
to update it when adding or removing schemaObjects

Modified:
    directory/apacheds/branches/apacheds-schema/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ComparatorRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DITContentRuleRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DITStructureRuleRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/LdapSyntaxRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleUseRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NameFormRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NormalizerRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ObjectClassRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaObjectRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SyntaxCheckerRegistry.java

Modified: directory/apacheds/branches/apacheds-schema/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java
Wed Aug 26 12:01:27 2009
@@ -163,7 +163,7 @@
         public BootstrapMatchingRule(String oid, Registries registries)
         {
             super( oid );
-            this.syntaxRegistry = registries.getSyntaxRegistry();
+            this.syntaxRegistry = registries.getLdapSyntaxRegistry();
             this.normalizerRegistry = registries.getNormalizerRegistry();
             this.comparatorRegistry = registries.getComparatorRegistry();
         }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ComparatorRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ComparatorRegistry.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ComparatorRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ComparatorRegistry.java
Wed Aug 26 12:01:27 2009
@@ -34,9 +34,11 @@
 {
     /**
      * Creates a new default ComparatorRegistry instance.
+     * 
+     * @param oidRegistry The global OID registry 
      */
-    public ComparatorRegistry()
+    public ComparatorRegistry( OidRegistry oidRegistry )
     {
-        super( SchemaObjectType.COMPARATOR );
+        super( SchemaObjectType.COMPARATOR, oidRegistry );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DITContentRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DITContentRuleRegistry.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DITContentRuleRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DITContentRuleRegistry.java
Wed Aug 26 12:01:27 2009
@@ -20,14 +20,8 @@
 package org.apache.directory.shared.ldap.schema.registries;
 
 
-import java.util.Iterator;
-
-import javax.naming.NamingException;
-
 import org.apache.directory.shared.ldap.schema.DITContentRule;
-import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.SchemaObjectType;
-import org.apache.directory.shared.ldap.schema.parsers.NormalizerDescription;
 
 
 /**
@@ -40,9 +34,11 @@
 {
     /**
      * Creates a new default NormalizerRegistry instance.
+     * 
+     * @param oidRegistry The global OID registry 
      */
-    public DITContentRuleRegistry()
+    public DITContentRuleRegistry( OidRegistry oidRegistry )
     {
-        super( SchemaObjectType.DIT_CONTENT_RULE );
+        super( SchemaObjectType.DIT_CONTENT_RULE, oidRegistry );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DITStructureRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DITStructureRuleRegistry.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DITStructureRuleRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DITStructureRuleRegistry.java
Wed Aug 26 12:01:27 2009
@@ -52,10 +52,12 @@
     
     /**
      * Creates a new default NormalizerRegistry instance.
+     * 
+     * @param oidRegistry The global OID registry 
      */
-    public DITStructureRuleRegistry()
+    public DITStructureRuleRegistry( OidRegistry oidRegistry )
     {
-        super( SchemaObjectType.DIT_STRUCTURE_RULE );
+        super( SchemaObjectType.DIT_STRUCTURE_RULE, oidRegistry );
         byRuleId = new ConcurrentHashMap<Integer, DITStructureRule>();
     }
 

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/LdapSyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/LdapSyntaxRegistry.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/LdapSyntaxRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/LdapSyntaxRegistry.java
Wed Aug 26 12:01:27 2009
@@ -33,9 +33,11 @@
 {
     /**
      * Creates a new default LdapSyntaxRegistry instance.
+     * 
+     * @param oidRegistry The global OID registry 
      */
-    public LdapSyntaxRegistry()
+    public LdapSyntaxRegistry( OidRegistry oidRegistry )
     {
-        super( SchemaObjectType.LDAP_SYNTAX );
+        super( SchemaObjectType.LDAP_SYNTAX, oidRegistry );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleRegistry.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleRegistry.java
Wed Aug 26 12:01:27 2009
@@ -34,9 +34,11 @@
 {
     /**
      * Creates a new default MatchingRuleRegistry instance.
+     * 
+     * @param oidRegistry The global OID registry 
      */
-    public MatchingRuleRegistry()
+    public MatchingRuleRegistry( OidRegistry oidRegistry )
     {
-        super( SchemaObjectType.MATCHING_RULE );
+        super( SchemaObjectType.MATCHING_RULE, oidRegistry );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleUseRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleUseRegistry.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleUseRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleUseRegistry.java
Wed Aug 26 12:01:27 2009
@@ -36,9 +36,11 @@
 {
     /**
      * Creates a new default MatchingRuleUseRegistry instance.
+     * 
+     * @param oidRegistry The global OID registry 
      */
-    public MatchingRuleUseRegistry()
+    public MatchingRuleUseRegistry( OidRegistry oidRegistry )
     {
-        super( SchemaObjectType.MATCHING_RULE_USE );
+        super( SchemaObjectType.MATCHING_RULE_USE, oidRegistry );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NameFormRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NameFormRegistry.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NameFormRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NameFormRegistry.java
Wed Aug 26 12:01:27 2009
@@ -34,9 +34,11 @@
 {
     /**
      * Creates a new default NameFormRegistry instance.
+     * 
+     * @param oidRegistry The global OID registry 
      */
-    public NameFormRegistry()
+    public NameFormRegistry( OidRegistry oidRegistry )
     {
-        super( SchemaObjectType.NAME_FORM );
+        super( SchemaObjectType.NAME_FORM, oidRegistry );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NormalizerRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NormalizerRegistry.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NormalizerRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NormalizerRegistry.java
Wed Aug 26 12:01:27 2009
@@ -34,9 +34,11 @@
 {
     /**
      * Creates a new default NormalizerRegistry instance.
+     * 
+     * @param oidRegistry The global OID registry 
      */
-    public NormalizerRegistry()
+    public NormalizerRegistry( OidRegistry oidRegistry )
     {
-        super( SchemaObjectType.NORMALIZER );
+        super( SchemaObjectType.NORMALIZER, oidRegistry );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ObjectClassRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ObjectClassRegistry.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ObjectClassRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ObjectClassRegistry.java
Wed Aug 26 12:01:27 2009
@@ -34,9 +34,11 @@
 {
     /**
      * Creates a new default ObjectClassRegistry instance.
+     * 
+     * @param oidRegistry The global OID registry 
      */
-    public ObjectClassRegistry()
+    public ObjectClassRegistry( OidRegistry oidRegistry )
     {
-        super( SchemaObjectType.OBJECT_CLASS );
+        super( SchemaObjectType.OBJECT_CLASS, oidRegistry );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Wed Aug 26 12:01:27 2009
@@ -104,17 +104,17 @@
         });
         
         oidRegistry = registry;
-        normalizerRegistry = new NormalizerRegistry();
-        comparatorRegistry = new ComparatorRegistry();
-        syntaxCheckerRegistry = new SyntaxCheckerRegistry();
-        ldapSyntaxRegistry = new LdapSyntaxRegistry();
-        matchingRuleRegistry = new MatchingRuleRegistry();
+        normalizerRegistry = new NormalizerRegistry( oidRegistry );
+        comparatorRegistry = new ComparatorRegistry( oidRegistry );
+        syntaxCheckerRegistry = new SyntaxCheckerRegistry( oidRegistry );
+        ldapSyntaxRegistry = new LdapSyntaxRegistry( oidRegistry );
+        matchingRuleRegistry = new MatchingRuleRegistry( oidRegistry );
         attributeTypeRegistry = new AttributeTypeRegistry( oidRegistry );
-        objectClassRegistry = new ObjectClassRegistry();
-        ditContentRuleRegistry = new DITContentRuleRegistry();
-        ditStructureRuleRegistry = new DITStructureRuleRegistry();
-        matchingRuleUseRegistry = new MatchingRuleUseRegistry();
-        nameFormRegistry = new NameFormRegistry();
+        objectClassRegistry = new ObjectClassRegistry( oidRegistry );
+        ditContentRuleRegistry = new DITContentRuleRegistry( oidRegistry );
+        ditStructureRuleRegistry = new DITStructureRuleRegistry( oidRegistry );
+        matchingRuleUseRegistry = new MatchingRuleUseRegistry( oidRegistry );
+        nameFormRegistry = new NameFormRegistry( oidRegistry );
     }
     
     

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaObjectRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaObjectRegistry.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaObjectRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaObjectRegistry.java
Wed Aug 26 12:01:27 2009
@@ -53,14 +53,18 @@
     /** The SchemaObject type */
     protected SchemaObjectType type;
 
+    /** the global OID Registry */
+    protected final OidRegistry oidRegistry;
+    
 
     /**
      * Creates a new SchemaObjectRegistry instance.
      */
-    protected SchemaObjectRegistry( SchemaObjectType schemaObjectType )
+    protected SchemaObjectRegistry( SchemaObjectType schemaObjectType, OidRegistry oidRegistry
)
     {
         byOid = new ConcurrentHashMap<String, T>();
         type = schemaObjectType;
+        this.oidRegistry = oidRegistry;
     }
     
     
@@ -205,6 +209,9 @@
         {
             LOG.debug( "registered {} for OID {}", schemaObject, oid );
         }
+        
+        // And register the oid -> schemaObject relation
+        oidRegistry.register( schemaObject );
     }
 
 
@@ -226,6 +233,9 @@
 
         SchemaObject schemaObject = byOid.remove( numericOid );
         
+        // And remove the SchemaObject from the oidRegistry
+        oidRegistry.unregister( numericOid );
+        
         if ( DEBUG )
         {
             LOG.debug( "Removed {} with oid {} from the registry", schemaObject, numericOid
);
@@ -239,7 +249,7 @@
      * 
      * @param schemaName the name of the schema whose SchemaObjects will be removed from
      */
-    public void unregisterSchemaElements( String schemaName )
+    public void unregisterSchemaElements( String schemaName ) throws NamingException
     {
         if ( schemaName == null )
         {
@@ -254,6 +264,7 @@
             {
                 String oid = schemaObject.getOid();
                 SchemaObject removed = byOid.remove( oid );
+                oidRegistry.unregister( oid );
                 
                 if ( DEBUG )
                 {

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SyntaxCheckerRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SyntaxCheckerRegistry.java?rev=807974&r1=807973&r2=807974&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SyntaxCheckerRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SyntaxCheckerRegistry.java
Wed Aug 26 12:01:27 2009
@@ -34,9 +34,11 @@
 {
     /**
      * Creates a new default SyntaxCheckerRegistry instance.
+     * 
+     * @param oidRegistry The global OID registry 
      */
-    public SyntaxCheckerRegistry()
+    public SyntaxCheckerRegistry( OidRegistry oidRegistry )
     {
-        super( SchemaObjectType.SYNTAX_CHECKER );
+        super( SchemaObjectType.SYNTAX_CHECKER, oidRegistry );
     }
 }



Mime
View raw message