directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r807157 - /directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Date Mon, 24 Aug 2009 11:37:28 GMT
Author: elecharny
Date: Mon Aug 24 11:37:28 2009
New Revision: 807157

URL: http://svn.apache.org/viewvc?rev=807157&view=rev
Log:
First version of the movced Registries object (it still does not compile)

Added:
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
      - copied, changed from r806865, directory/apacheds/branches/apacheds-schema/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java

Copied: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
(from r806865, directory/apacheds/branches/apacheds-schema/schema-registries/src/main/java/org/apache/directory/server/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?p2=directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java&p1=directory/apacheds/branches/apacheds-schema/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java&r1=806865&r2=807157&rev=807157&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Mon Aug 24 11:37:28 2009
@@ -17,25 +17,17 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.server.schema.registries;
+package org.apache.directory.shared.ldap.schema.registries;
 
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
 import org.apache.directory.server.schema.bootstrap.Schema;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.shared.ldap.schema.registries.ComparatorRegistry;
-import org.apache.directory.shared.ldap.schema.registries.DITContentRuleRegistry;
-import org.apache.directory.shared.ldap.schema.registries.DITStructureRuleRegistry;
-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.MatchingRuleUseRegistry;
-import org.apache.directory.shared.ldap.schema.registries.NameFormRegistry;
-import org.apache.directory.shared.ldap.schema.registries.NormalizerRegistry;
-import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
-import org.apache.directory.shared.ldap.schema.registries.SyntaxCheckerRegistry;
+import org.apache.directory.server.schema.registries.SchemaLoader;
+import org.apache.directory.server.schema.registries.SchemaLoaderListener;
 
 
 /**
@@ -44,47 +36,199 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface Registries
+public class Registries
 {
-    String getName();
+    /** The AttributeType registry */
+    private AttributeTypeRegistry attributeTypeRegistry;
     
-    Map<String,Schema> getLoadedSchemas();
+    /** The ObjectClass registry */
+    private ObjectClassRegistry objectClassRegistry;
+
+
+    /** The LdapSyntax registry */
+    private ComparatorRegistry comparatorRegistry;
+
+    /** The DitContentRule registry */
+    private DITContentRuleRegistry ditContentRuleRegistry;
+
+    /** The DitStructureRule registry */
+    private DITStructureRuleRegistry ditStructureRuleRegistry;
+
+    /** The MatchingRule registry */
+    private MatchingRuleRegistry matchingRuleRegistry;
+
+    /** The MatchingRuleUse registry */
+    private MatchingRuleUseRegistry matchingRuleUseRegistry;
+
+    /** The NameForm registry */
+    private NameFormRegistry nameFormRegistry;
+
+    /** The Normalizer registry */
+    private NormalizerRegistry normalizerRegistry;
+
+    /** The OID registry */
+    private OidRegistry oidRegistry;
+
+    /** The SyntaxChecker registry */
+    private SyntaxCheckerRegistry syntaxCheckerRegistry;
+
+    /** The LdapSyntax registry */
+    private LdapSyntaxRegistry ldapSyntaxRegistry;
+    
+    //private Map<String,Schema> loadedByName = new HashMap<String, Schema>();
+    //private final SchemaLoader schemaLoader;
+    //private final String name;
+
+    //String getName();
     
-    void load( String schemaName ) throws Exception;
+    //Map<String, Schema> getLoadedSchemas();
     
-    void load( String schemaName, Properties props ) throws Exception;
+    //void load( String schemaName ) throws Exception;
+    
+    //void load( String schemaName, Properties props ) throws Exception;
 
-    void unload( String schemaName ) throws Exception;
+    //void unload( String schemaName ) throws Exception;
+    
+    //SchemaLoader getSchemaLoader();
     
-    SchemaLoader getSchemaLoader();
+    public DefaultRegistries( String name, SchemaLoader schemaLoader, OidRegistry registry
)
+    {
+        this.name = name;
+        this.schemaLoader = schemaLoader;
+        
+        this.schemaLoader.setListener( new SchemaLoaderListener() {
+            public void schemaLoaded( Schema schema )
+            {
+                loadedByName.put( schema.getSchemaName(), schema );
+            }
+        });
+        
+        oidRegistry = registry;
+        normalizerRegistry = new NormalizerRegistry();
+        comparatorRegistry = new ComparatorRegistry();
+        syntaxCheckerRegistry = new SyntaxCheckerRegistry();
+        ldapSyntaxRegistry = new LdapSyntaxRegistry();
+        matchingRuleRegistry = new MatchingRuleRegistry();
+        attributeTypeRegistry = new AttributeTypeRegistry( oidRegistry );
+        objectClassRegistry = new ObjectClassRegistry();
+        ditContentRuleRegistry = new DITContentRuleRegistry();
+        ditStructureRuleRegistry = new DITStructureRuleRegistry();
+        matchingRuleUseRegistry = new MatchingRuleUseRegistry();
+        nameFormRegistry = new NameFormRegistry();
+    }
     
-    AttributeTypeRegistry getAttributeTypeRegistry();
     
-    ComparatorRegistry getComparatorRegistry();
+    /**
+     * @return The AttributeType registry
+     */
+    public AttributeTypeRegistry getAttributeTypeRegistry()
+    {
+        return attributeTypeRegistry;
+    }
 
-    DITContentRuleRegistry getDitContentRuleRegistry();
+    
+    /**
+     * @return The Comparator registry
+     */
+    public ComparatorRegistry getComparatorRegistry()
+    {
+        return comparatorRegistry;
+    }
 
-    DITStructureRuleRegistry getDitStructureRuleRegistry();
+    
+    /**
+     * @return The DITContentRule registry
+     */
+    public DITContentRuleRegistry getDitContentRuleRegistry()
+    {
+        return ditContentRuleRegistry;
+    }
+
+    
+    /**
+     * @return The DITStructureRule registry
+     */
+    public DITStructureRuleRegistry getDitStructureRuleRegistry()
+    {
+        return ditStructureRuleRegistry;
+    }
 
-    MatchingRuleRegistry getMatchingRuleRegistry();
+    
+    /**
+     * @return The MatchingRule registry
+     */
+    public MatchingRuleRegistry getMatchingRuleRegistry()
+    {
+        return matchingRuleRegistry;
+    }
 
-    MatchingRuleUseRegistry getMatchingRuleUseRegistry();
+    
+    /**
+     * @return The MatchingRuleUse registry
+     */
+    public MatchingRuleUseRegistry getMatchingRuleUseRegistry()
+    {
+        return matchingRuleUseRegistry;
+    }
 
-    NameFormRegistry getNameFormRegistry();
+    
+    /**
+     * @return The NameForm registry
+     */
+    public NameFormRegistry getNameFormRegistry()
+    {
+        return nameFormRegistry;
+    }
 
-    NormalizerRegistry getNormalizerRegistry();
+    
+    /**
+     * @return The Normalizer registry
+     */
+    public NormalizerRegistry getNormalizerRegistry()
+    {
+        return normalizerRegistry;
+    }
 
-    ObjectClassRegistry getObjectClassRegistry();
+    
+    /**
+     * @return The ObjectClass registry
+     */
+    public ObjectClassRegistry getObjectClassRegistry()
+    {
+        return objectClassRegistry;
+    }
 
-    OidRegistry getOidRegistry();
+    
+    /**
+     * @return The getOid registry
+     */
+    public OidRegistry getOidRegistry()
+    {
+        return oidRegistry;
+    }
 
-    SyntaxCheckerRegistry getSyntaxCheckerRegistry();
+    
+    /**
+     * @return The SyntaxChecker registry
+     */
+    public SyntaxCheckerRegistry getSyntaxCheckerRegistry()
+    {
+        return syntaxCheckerRegistry;
+    }
 
-    LdapSyntaxRegistry getLdapSyntaxRegistry();
+    
+    /**
+     * @return The LdapSyntax registry
+     */
+    public LdapSyntaxRegistry getLdapSyntaxRegistry()
+    {
+        return ldapSyntaxRegistry;
+    }
+    
 
-    List<Throwable> checkRefInteg();
+    //List<Throwable> checkRefInteg();
 
-    Schema getSchema( String schemaName );
+    //Schema getSchema( String schemaName );
 
     /**
      * Removes a schema from the loaded set without unloading the schema.
@@ -92,7 +236,7 @@
      * 
      * @param schemaName the name of the schema to remove
      */
-    void removeFromLoadedSet( String schemaName );
+    //void removeFromLoadedSet( String schemaName );
     
     /**
      * Adds a schema to the loaded set but does not load the schema in 
@@ -103,5 +247,5 @@
      * 
      * @param schema the schema object to add to the loaded set.
      */
-    void addToLoadedSet( Schema schema );
+    //void addToLoadedSet( Schema schema );
 }



Mime
View raw message