directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r499844 - in /directory/apacheds/trunk: core/src/main/java/org/apache/directory/server/core/ core/src/main/java/org/apache/directory/server/core/schema/ schema-registries/src/main/java/org/apache/directory/server/schema/registries/
Date Thu, 25 Jan 2007 16:45:43 GMT
Author: akarasulu
Date: Thu Jan 25 08:45:40 2007
New Revision: 499844

URL: http://svn.apache.org/viewvc?view=rev&rev=499844
Log:
enabling schemas to be disabled ...

 o added new shared interface for schema object based registries
 o turned list methods into iterator methods 
 o added new unregisterSchemaElements(String schemaName) method for non 
   SchemaObject based registries like comparator, syntaxChecker and normalizer
   registries

Might be nice to have an abstract base class later on for a schemaObject 
registry which the others can extend.  This way we can avoid some duplicate
code.


Added:
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SchemaObjectRegistry.java
Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ComparatorRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITContentRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITStructureRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitContentRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitStructureRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleUseRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNameFormRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxCheckerRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleUseRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NameFormRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NormalizerRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxCheckerRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Thu Jan 25 08:45:40 2007
@@ -72,6 +72,7 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.DateUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -478,7 +479,7 @@
         // create system users area
         // -------------------------------------------------------------------
 
-        Map oidsMap = configuration.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
+        Map<String,OidNormalizer> oidsMap = configuration.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
         LdapDN userDn = new LdapDN( "ou=users,ou=system" );
         userDn.normalize( oidsMap );
         
@@ -936,10 +937,10 @@
 
         // now get all the attributeTypes that are binary from the registry
         AttributeTypeRegistry registry = registries.getAttributeTypeRegistry();
-        Iterator list = registry.list();
+        Iterator<AttributeType> list = registry.iterator();
         while ( list.hasNext() )
         {
-            AttributeType type = ( AttributeType ) list.next();
+            AttributeType type = list.next();
             
             if ( !type.getSyntax().isHumanReadible() )
             {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java Thu Jan 25 08:45:40 2007
@@ -20,6 +20,8 @@
 package org.apache.directory.server.core.schema;
 
 
+import java.util.Iterator;
+
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
@@ -31,6 +33,7 @@
 import org.apache.directory.server.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.server.schema.registries.SchemaObjectRegistry;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
@@ -38,6 +41,7 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
 
 
 /**
@@ -141,11 +145,36 @@
     }
     
 
-    private void disableSchema( String schemaName )
+    private void disableSchema( String schemaName ) throws NamingException
     {
-        throw new NotImplementedException();
+        disableSchema( globalRegistries.getDitStructureRuleRegistry(), schemaName );
+        disableSchema( globalRegistries.getDitContentRuleRegistry(), schemaName );
+        disableSchema( globalRegistries.getMatchingRuleUseRegistry(), schemaName );
+        disableSchema( globalRegistries.getNameFormRegistry(), schemaName );
+        disableSchema( globalRegistries.getObjectClassRegistry(), schemaName );
+        disableSchema( globalRegistries.getAttributeTypeRegistry(), schemaName );
+        disableSchema( globalRegistries.getMatchingRuleRegistry(), schemaName );
+        disableSchema( globalRegistries.getSyntaxRegistry(), schemaName );
+
+        globalRegistries.getNormalizerRegistry().unregisterSchemaElements( schemaName );
+        globalRegistries.getComparatorRegistry().unregisterSchemaElements( schemaName );
+        globalRegistries.getSyntaxCheckerRegistry().unregisterSchemaElements( schemaName );
     }
 
+    
+    private void disableSchema( SchemaObjectRegistry registry, String schemaName ) throws NamingException
+    {
+        Iterator<? extends SchemaObject> objects = registry.iterator();
+        while ( objects.hasNext() )
+        {
+            SchemaObject obj = objects.next();
+            if ( obj.getSchema().equalsIgnoreCase( schemaName ) )
+            {
+                registry.unregister( obj.getOid() );
+            }
+        }
+    }
+    
 
     /**
      * TODO - for now we're just going to add the schema to the global 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Thu Jan 25 08:45:40 2007
@@ -21,7 +21,6 @@
 
  
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -139,16 +138,16 @@
     private LdapDN schemaBaseDN;
     
     /** A map used to store all the objectClasses superiors */
-    private Map superiors;
+    private Map<String, List<ObjectClass>> superiors;
 
     /** A map used to store all the objectClasses may attributes */
-    private Map allMay;
+    private Map<String, List<AttributeType>> allMay;
 
     /** A map used to store all the objectClasses must */
-    private Map allMust;
+    private Map<String, List<AttributeType>> allMust;
 
     /** A map used to store all the objectClasses allowed attributes (may + must) */
-    private Map allowed;
+    private Map<String, List<AttributeType>> allowed;
 
     /**
      * Creates a schema service interceptor.
@@ -199,13 +198,13 @@
      * Compute the MUST attributes for an objectClass. This method gather all the
      * MUST from all the objectClass and its superors.
      */
-    private void computeMustAttributes( ObjectClass objectClass, Set atSeen ) throws NamingException
+    private void computeMustAttributes( ObjectClass objectClass, Set<String> atSeen ) throws NamingException
     {
-        List parents = (List)superiors.get( objectClass.getOid() );
+        List parents = superiors.get( objectClass.getOid() );
 
-        List mustList = new ArrayList();
-        List allowedList = new ArrayList();
-        Set mustSeen = new HashSet();
+        List<AttributeType> mustList = new ArrayList<AttributeType>();
+        List<AttributeType> allowedList = new ArrayList<AttributeType>();
+        Set<String> mustSeen = new HashSet<String>();
 
         allMust.put( objectClass.getOid(), mustList );
         allowed.put( objectClass.getOid(), allowedList );
@@ -243,13 +242,13 @@
      *
      * The allowed attributes is also computed, it's the union of MUST and MAY
      */
-    private void computeMayAttributes( ObjectClass objectClass, Set atSeen ) throws NamingException
+    private void computeMayAttributes( ObjectClass objectClass, Set<String> atSeen ) throws NamingException
     {
-        List parents = (List)superiors.get( objectClass.getOid() );
+        List parents = superiors.get( objectClass.getOid() );
 
-        List mayList = new ArrayList();
-        Set maySeen = new HashSet();
-        List allowedList = (List)allowed.get( objectClass.getOid() );
+        List<AttributeType> mayList = new ArrayList<AttributeType>();
+        Set<String> maySeen = new HashSet<String>();
+        List<AttributeType> allowedList = allowed.get( objectClass.getOid() );
 
 
         allMay.put( objectClass.getOid(), mayList );
@@ -292,7 +291,7 @@
      * As a result, we will gather all of these three ObjectClasses in 'inetOrgPerson' ObjectClasse
      * superiors.
      */
-    private void computeOCSuperiors( ObjectClass objectClass, List superiors, Set ocSeen ) throws NamingException
+    private void computeOCSuperiors( ObjectClass objectClass, List<ObjectClass> superiors, Set<String> ocSeen ) throws NamingException
     {
         ObjectClass[] parents = objectClass.getSuperClasses();
 
@@ -332,21 +331,21 @@
     private void computeSuperiors() throws NamingException
     {
         Iterator objectClasses = registries.getObjectClassRegistry().iterator();
-        superiors = new HashMap();
-        allMust = new HashMap();
-        allMay = new HashMap();
-        allowed = new HashMap();
+        superiors = new HashMap<String, List<ObjectClass>>();
+        allMust = new HashMap<String, List<AttributeType>>();
+        allMay = new HashMap<String, List<AttributeType>>();
+        allowed = new HashMap<String, List<AttributeType>>();
 
         while ( objectClasses.hasNext() )
         {
-            List ocSuperiors = new ArrayList();
+            List<ObjectClass> ocSuperiors = new ArrayList<ObjectClass>();
 
             ObjectClass objectClass = (ObjectClass)objectClasses.next();
             superiors.put( objectClass.getOid(), ocSuperiors );
 
-            computeOCSuperiors( objectClass, ocSuperiors, new HashSet() );
+            computeOCSuperiors( objectClass, ocSuperiors, new HashSet<String>() );
 
-            Set atSeen = new HashSet();
+            Set<String> atSeen = new HashSet<String>();
             computeMustAttributes( objectClass, atSeen );
             computeMayAttributes( objectClass, atSeen );
 
@@ -563,10 +562,10 @@
         if ( returnAllOperationalAttributes || set.contains( "attributetypes" ) )
         {
             attr = new AttributeImpl( "attributeTypes" );
-            Iterator list = registries.getAttributeTypeRegistry().list();
+            Iterator<AttributeType> list = registries.getAttributeTypeRegistry().iterator();
             while ( list.hasNext() )
             {
-                AttributeType at = ( AttributeType ) list.next();
+                AttributeType at = list.next();
                 attr.add( SchemaUtils.render( at ).toString() );
             }
             attrs.put( attr );
@@ -587,7 +586,7 @@
         if ( returnAllOperationalAttributes || set.contains( "matchingruleuse" ) )
         {
             attr = new AttributeImpl( "matchingRuleUse" );
-            Iterator list = registries.getMatchingRuleUseRegistry().list();
+            Iterator list = registries.getMatchingRuleUseRegistry().iterator();
             while ( list.hasNext() )
             {
                 MatchingRuleUse mru = ( MatchingRuleUse ) list.next();
@@ -611,10 +610,10 @@
         if ( returnAllOperationalAttributes || set.contains( "ditcontentrules" ) )
         {
             attr = new AttributeImpl( "dITContentRules" );
-            Iterator list = registries.getDitContentRuleRegistry().list();
+            Iterator<DITContentRule> list = registries.getDitContentRuleRegistry().iterator();
             while ( list.hasNext() )
             {
-                DITContentRule dcr = ( DITContentRule ) list.next();
+                DITContentRule dcr = list.next();
                 attr.add( SchemaUtils.render( dcr ).toString() );
             }
             attrs.put( attr );
@@ -623,7 +622,7 @@
         if ( returnAllOperationalAttributes || set.contains( "ditstructurerules" ) )
         {
             attr = new AttributeImpl( "dITStructureRules" );
-            Iterator list = registries.getDitStructureRuleRegistry().list();
+            Iterator list = registries.getDitStructureRuleRegistry().iterator();
             while ( list.hasNext() )
             {
                 DITStructureRule dsr = ( DITStructureRule ) list.next();
@@ -635,7 +634,7 @@
         if ( returnAllOperationalAttributes || set.contains( "nameforms" ) )
         {
             attr = new AttributeImpl( "nameForms" );
-            Iterator list = registries.getNameFormRegistry().list();
+            Iterator list = registries.getNameFormRegistry().iterator();
             while ( list.hasNext() )
             {
                 NameForm nf = ( NameForm ) list.next();
@@ -738,7 +737,7 @@
     }
 
 
-    private void getSuperiors( ObjectClass oc, Set ocSeen, List result ) throws NamingException
+    private void getSuperiors( ObjectClass oc, Set<String> ocSeen, List<ObjectClass> result ) throws NamingException
     {
         ObjectClass[] superiors = oc.getSuperClasses();
 
@@ -875,9 +874,9 @@
     }
 
 
-    private boolean getObjectClasses( Attribute objectClasses, List result ) throws NamingException
+    private boolean getObjectClasses( Attribute objectClasses, List<ObjectClass> result ) throws NamingException
     {
-        Set ocSeen = new HashSet();
+        Set<String> ocSeen = new HashSet<String>();
         ObjectClassRegistry registry = registries.getObjectClassRegistry();
 
         // We must select all the ObjectClasses, except 'top',
@@ -916,9 +915,9 @@
         return hasExtensibleObject;
     }
 
-    private Set getAllMust( NamingEnumeration objectClasses ) throws NamingException
+    private Set<String> getAllMust( NamingEnumeration objectClasses ) throws NamingException
     {
-        Set must = new HashSet();
+        Set<String> must = new HashSet<String>();
 
         // Loop on all objectclasses
         while ( objectClasses.hasMoreElements() )
@@ -943,9 +942,9 @@
         return must;
     }
 
-    private Set getAllAllowed( NamingEnumeration objectClasses, Set must ) throws NamingException
+    private Set<String> getAllAllowed( NamingEnumeration objectClasses, Set<String> must ) throws NamingException
     {
-        Set allowed = new HashSet( must );
+        Set<String> allowed = new HashSet<String>( must );
 
         // Add the 'ObjectClass' attribute ID
         allowed.add( registries.getOidRegistry().getOid( "ObjectClass" ) );
@@ -1007,7 +1006,7 @@
                     objectClasses.add( ocLowerName );
                 }
 
-                List ocSuperiors = (List)superiors.get( objectClass.getOid() );
+                List ocSuperiors = superiors.get( objectClass.getOid() );
 
                 if ( ocSuperiors != null )
                 {
@@ -1029,7 +1028,7 @@
         // Now, reset the ObjectClass attribute and put the new list into it
         objectClassAttr.clear();
 
-        Iterator iter = objectClasses.iterator();
+        Iterator<String> iter = objectClasses.iterator();
 
         while ( iter.hasNext() )
         {
@@ -1508,7 +1507,7 @@
 
     private void filterObjectClass( Attributes entry ) throws NamingException
     {
-        List objectClasses = new ArrayList();
+        List<ObjectClass> objectClasses = new ArrayList<ObjectClass>();
         Attribute oc = entry.get( "objectClass" );
         
         if ( oc != null )
@@ -1650,12 +1649,12 @@
         // 3-1) Except if the extensibleObject ObjectClass is used
         // 3-2) or if the AttributeType is COLLECTIVE
         Attribute objectClassAttr = entry.get( "objectClass" );
-        List ocs = new ArrayList();
+        List<ObjectClass> ocs = new ArrayList<ObjectClass>();
 
         alterObjectClasses( objectClassAttr );
 
-        Set must = getAllMust( objectClassAttr.getAll() );
-        Set allowed = getAllAllowed( objectClassAttr.getAll(), must );
+        Set<String> must = getAllMust( objectClassAttr.getAll() );
+        Set<String> allowed = getAllAllowed( objectClassAttr.getAll(), must );
 
         boolean hasExtensibleObject = getObjectClasses( objectClassAttr, ocs );
 
@@ -1693,7 +1692,7 @@
      * @return true if the objectClass values require the attribute, false otherwise
      * @throws NamingException if the attribute is not recognized
      */
-    private void assertAllAttributesAllowed( Attributes attributes, Set allowed ) throws NamingException
+    private void assertAllAttributesAllowed( Attributes attributes, Set<String> allowed ) throws NamingException
     {
         // Never check the attributes if the extensibleObject objectClass is
         // declared for this entry
@@ -1770,7 +1769,7 @@
     /**
      * Checks to see the presence of all required attributes within an entry.
      */
-    private void assertRequiredAttributesPresent( Attributes entry, Set must )
+    private void assertRequiredAttributesPresent( Attributes entry, Set<String> must )
         throws NamingException
     {
         NamingEnumeration attributes = entry.getAll();

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java Thu Jan 25 08:45:40 2007
@@ -35,7 +35,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface AttributeTypeRegistry
+public interface AttributeTypeRegistry extends SchemaObjectRegistry
 {
     /**
      * Registers a new AttributeType with this registry.
@@ -59,16 +59,6 @@
 
 
     /**
-     * Gets the name of the schema this schema object is associated with.
-     *
-     * @param id the object identifier or the name
-     * @return the schema name
-     * @throws NamingException if the schema object does not exist
-     */
-    String getSchemaName( String id ) throws NamingException;
-
-
-    /**
      * Checks to see if an AttributeType exists.
      * 
      * @param id the object identifier or name of the AttributeType
@@ -83,7 +73,7 @@
      *
      * @return an iterator over all AttributeTypes in registry
      */
-    Iterator list();
+    Iterator<AttributeType> iterator();
     
     
     /**
@@ -114,20 +104,4 @@
      * discerned from the ancestorId supplied
      */
     Iterator descendants( String ancestorId ) throws NamingException;
-
-    /**
-     * Gets an Iterator over the attributeTypes in this registry.
-     * 
-     * @return Iterator over attributeTypes
-     */
-    Iterator<AttributeType> iterator();
-
-
-    /**
-     * Removes the AttributeType registered with this registry.
-     * 
-     * @param numericOid the numeric identifier
-     * @throws NamingException if the numeric identifier is invalid
-     */
-    void unregister( String numericOid ) throws NamingException;
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ComparatorRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ComparatorRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ComparatorRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ComparatorRegistry.java Thu Jan 25 08:45:40 2007
@@ -85,6 +85,7 @@
      */
     Iterator<String> oidIterator();
 
+    
     /**
      * Removes a registered comparator from this registry.
      * 
@@ -92,4 +93,13 @@
      * @throws NamingException if the oid is not a numeric id
      */
     void unregister( String oid ) throws NamingException;
+    
+    
+    /**
+     * Unregisters comparators from this registry associated with a schema.
+     *
+     * @param schemaName the name of the schema whose comparators are removed 
+     * from this registry
+     */
+    void unregisterSchemaElements( String schemaName );
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITContentRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITContentRuleRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITContentRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITContentRuleRegistry.java Thu Jan 25 08:45:40 2007
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface DITContentRuleRegistry
+public interface DITContentRuleRegistry extends SchemaObjectRegistry
 {
     /**
      * Registers a DITContentRule with this registry.
@@ -56,16 +56,6 @@
 
 
     /**
-     * Gets the name of the schema this schema object is associated with.
-     *
-     * @param id the object identifier or the name
-     * @return the schema name
-     * @throws NamingException if the schema object does not exist
-     */
-    String getSchemaName( String id ) throws NamingException;
-
-
-    /**
      * Checks to see if a DITContentRule exists.
      * 
      * @param id the object identifier or name of the DITContentRule
@@ -73,12 +63,11 @@
      * otherwise
      */
     boolean hasDITContentRule( String id );
-
-
+    
     /**
-     * Lists all the DITContentRules within this registry.
+     * Lists the DITContentRules registered in this registry.
      *
-     * @return Iterator over all the DITContentRules within this registry
+     * @return an Iterator of DITContentRules
      */
-    Iterator list();
+    Iterator<DITContentRule> iterator();
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITStructureRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITStructureRuleRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITStructureRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DITStructureRuleRegistry.java Thu Jan 25 08:45:40 2007
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface DITStructureRuleRegistry
+public interface DITStructureRuleRegistry extends SchemaObjectRegistry
 {
     /**
      * Registers a DITStructureRule with this registry.
@@ -57,16 +57,6 @@
 
 
     /**
-     * Gets the name of the schema this schema object is associated with.
-     *
-     * @param id the object identifier or the name
-     * @return the schema name
-     * @throws NamingException if the schema object does not exist
-     */
-    String getSchemaName( String id ) throws NamingException;
-
-
-    /**
      * Checks to see if an dITStructureRule exists.
      * 
      * @param id the object identifier, or the name
@@ -81,5 +71,5 @@
      *
      * @return an Iterator over all the DITStructureRules within this registry
      */
-    Iterator list();
+    Iterator<DITStructureRule> iterator();
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java Thu Jan 25 08:45:40 2007
@@ -20,9 +20,11 @@
 package org.apache.directory.server.schema.registries;
 
 
+import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 import javax.naming.NamingException;
@@ -42,7 +44,7 @@
     /** static class logger */
     private final static Logger log = LoggerFactory.getLogger( DefaultComparatorRegistry.class );
     /** the comparators in this registry */
-    private final Map<String,Comparator> comparators;
+    private final Map<String,Comparator> byOid;
     /** maps an OID to a schema name*/
     private final Map<String,String> oidToSchema;
 
@@ -58,7 +60,7 @@
     public DefaultComparatorRegistry()
     {
         this.oidToSchema = new HashMap<String,String>();
-        this.comparators = new HashMap<String, Comparator>();
+        this.byOid = new HashMap<String, Comparator>();
     }
 
 
@@ -69,14 +71,14 @@
     
     public void register( String schema, String oid, Comparator comparator ) throws NamingException
     {
-        if ( comparators.containsKey( oid ) )
+        if ( byOid.containsKey( oid ) )
         {
             NamingException e = new NamingException( "Comparator with OID " + oid + " already registered!" );
             throw e;
         }
 
         oidToSchema.put( oid, schema );
-        comparators.put( oid, comparator );
+        byOid.put( oid, comparator );
         if ( log.isDebugEnabled() )
         {
             log.debug( "registed comparator with OID: " + oid );
@@ -86,9 +88,9 @@
 
     public Comparator lookup( String oid ) throws NamingException
     {
-        if ( comparators.containsKey( oid ) )
+        if ( byOid.containsKey( oid ) )
         {
-            Comparator c = ( Comparator ) comparators.get( oid );
+            Comparator c = ( Comparator ) byOid.get( oid );
             if ( log.isDebugEnabled() )
             {
                 log.debug( "looked up comparator with OID: " + oid );
@@ -103,7 +105,7 @@
 
     public boolean hasComparator( String oid )
     {
-        return comparators.containsKey( oid );
+        return byOid.containsKey( oid );
     }
 
 
@@ -125,7 +127,7 @@
 
     public Iterator<String> oidIterator()
     {
-        return comparators.keySet().iterator();
+        return byOid.keySet().iterator();
     }
 
 
@@ -136,7 +138,22 @@
             throw new NamingException( "OID " + oid + " is not a numeric OID" );
         }
 
-        this.comparators.remove( oid );
+        this.byOid.remove( oid );
         this.oidToSchema.remove( oid );
+    }
+    
+    
+    public void unregisterSchemaElements( String schemaName )
+    {
+        List<String> oids = new ArrayList<String>( byOid.keySet() );
+        for ( String oid : oids )
+        {
+            String schemaNameForOid = oidToSchema.get( oid );
+            if ( schemaNameForOid.equalsIgnoreCase( schemaName ) )
+            {
+                byOid.remove( oid );
+                oidToSchema.remove( oid );
+            }
+        }
     }
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitContentRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitContentRuleRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitContentRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitContentRuleRegistry.java Thu Jan 25 08:45:40 2007
@@ -134,8 +134,19 @@
     }
 
 
-    public Iterator list()
+    public Iterator<DITContentRule> iterator()
     {
         return byOid.values().iterator();
+    }
+
+
+    public void unregister( String numericOid ) throws NamingException
+    {
+        if ( ! Character.isDigit( numericOid.charAt( 0 ) ) )
+        {
+            throw new NamingException( "Looks like the arg is not a numeric OID" );
+        }
+
+        byOid.remove( numericOid );
     }
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitStructureRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitStructureRuleRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitStructureRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultDitStructureRuleRegistry.java Thu Jan 25 08:45:40 2007
@@ -134,8 +134,19 @@
     }
 
 
-    public Iterator list()
+    public Iterator<DITStructureRule> iterator()
     {
         return byOid.values().iterator();
+    }
+    
+    
+    public void unregister( String numericOid ) throws NamingException
+    {
+        if ( ! Character.isDigit( numericOid.charAt( 0 ) ) )
+        {
+            throw new NamingException( "Looks like the arg is not a numeric OID" );
+        }
+
+        byOid.remove( numericOid );
     }
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleUseRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleUseRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleUseRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleUseRegistry.java Thu Jan 25 08:45:40 2007
@@ -117,8 +117,14 @@
     }
 
 
-    public Iterator list()
+    public Iterator<MatchingRuleUse> iterator()
     {
         return byName.values().iterator();
+    }
+    
+    
+    public void unregister( String name ) throws NamingException
+    {
+        byName.remove( name );
     }
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNameFormRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNameFormRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNameFormRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNameFormRegistry.java Thu Jan 25 08:45:40 2007
@@ -133,8 +133,19 @@
     }
 
 
-    public Iterator list()
+    public Iterator<NameForm> iterator()
     {
         return byOid.values().iterator();
+    }
+    
+    
+    public void unregister( String numericOid ) throws NamingException
+    {
+        if ( ! Character.isDigit( numericOid.charAt( 0 ) ) )
+        {
+            throw new NamingException( "Looks like the arg is not a numeric OID" );
+        }
+
+        byOid.remove( numericOid );
     }
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java Thu Jan 25 08:45:40 2007
@@ -20,8 +20,10 @@
 package org.apache.directory.server.schema.registries;
 
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 import javax.naming.NamingException;
@@ -137,5 +139,20 @@
 
         this.byOid.remove( oid );
         this.oidToSchema.remove( oid );
+    }
+    
+    
+    public void unregisterSchemaElements( String schemaName )
+    {
+        List<String> oids = new ArrayList<String>( byOid.keySet() );
+        for ( String oid : oids )
+        {
+            String schemaNameForOid = oidToSchema.get( oid );
+            if ( schemaNameForOid.equalsIgnoreCase( schemaName ) )
+            {
+                byOid.remove( oid );
+                oidToSchema.remove( oid );
+            }
+        }
     }
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxCheckerRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxCheckerRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxCheckerRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxCheckerRegistry.java Thu Jan 25 08:45:40 2007
@@ -20,8 +20,10 @@
 package org.apache.directory.server.schema.registries;
 
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 import javax.naming.NamingException;
@@ -138,5 +140,20 @@
 
         byOid.remove( numericOid );
         oidToSchema.remove( numericOid );
+    }
+    
+    
+    public void unregisterSchemaElements( String schemaName )
+    {
+        List<String> oids = new ArrayList<String>( byOid.keySet() );
+        for ( String oid : oids )
+        {
+            String schemaNameForOid = oidToSchema.get( oid );
+            if ( schemaNameForOid.equalsIgnoreCase( schemaName ) )
+            {
+                byOid.remove( oid );
+                oidToSchema.remove( oid );
+            }
+        }
     }
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java Thu Jan 25 08:45:40 2007
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface MatchingRuleRegistry
+public interface MatchingRuleRegistry extends SchemaObjectRegistry
 {
     /**
      * Registers a MatchingRule with this registry.
@@ -57,16 +57,6 @@
 
 
     /**
-     * Gets the name of the schema this schema object is associated with.
-     *
-     * @param id the object identifier or the name
-     * @return the schema name
-     * @throws NamingException if the schema object does not exist
-     */
-    String getSchemaName( String id ) throws NamingException;
-
-
-    /**
      * Checks to see if a MatchingRule exists.  Backing store failures simply 
      * return false.
      * 
@@ -83,13 +73,4 @@
      * @return an iterator over all MatchingRules in registry
      */
     Iterator<MatchingRule> iterator();
-    
-    
-    /**
-     * Removes a registered matchingRule from this registry.
-     * 
-     * @param numericOid the numeric object identifier for the matchingRule to remove
-     * @throws NamingException if the numericOid is invalid
-     */
-    void unregister( String numericOid ) throws NamingException;
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleUseRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleUseRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleUseRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleUseRegistry.java Thu Jan 25 08:45:40 2007
@@ -35,7 +35,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface MatchingRuleUseRegistry
+public interface MatchingRuleUseRegistry extends SchemaObjectRegistry
 {
     /**
      * Registers a MatchingRuleUse with this registry.
@@ -56,17 +56,7 @@
      */
     MatchingRuleUse lookup( String name ) throws NamingException;
 
-
-    /**
-     * Gets the name of the schema this schema object is associated with.
-     *
-     * @param name the name String
-     * @return the schema name
-     * @throws NamingException if the schema object does not exist
-     */
-    String getSchemaName( String name ) throws NamingException;
-
-
+    
     /**
      * Checks to see if an matchingRuleUse exists.
      * 
@@ -82,5 +72,5 @@
      *
      * @return an Iterator over all the MatchingRuleUses within this registry
      */
-    Iterator list();
+    Iterator<MatchingRuleUse> iterator();
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NameFormRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NameFormRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NameFormRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NameFormRegistry.java Thu Jan 25 08:45:40 2007
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface NameFormRegistry
+public interface NameFormRegistry extends SchemaObjectRegistry
 {
     /**
      * Registers a NameForm with this registry.
@@ -56,16 +56,6 @@
 
 
     /**
-     * Gets the name of the schema this schema object is associated with.
-     *
-     * @param id the object identifier or the name
-     * @return the schema name
-     * @throws NamingException if the schema object does not exist
-     */
-    String getSchemaName( String id ) throws NamingException;
-
-
-    /**
      * Checks to see if an nameForm exists.
      * 
      * @param id the object identifier or name
@@ -80,5 +70,5 @@
      *
      * @return an Iterator over all the NameForms within this registry
      */
-    Iterator list();
+    Iterator<NameForm> iterator();
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NormalizerRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NormalizerRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NormalizerRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NormalizerRegistry.java Thu Jan 25 08:45:40 2007
@@ -93,4 +93,12 @@
      * @throws NamingException if the provided argument is not a numeric OID
      */
     void unregister( String oid ) throws NamingException;
+    
+    /**
+     * Unregisters normalizers from this registry associated with a schema.
+     *
+     * @param schemaName the name of the schema whose normalizers are 
+     * removed from this registry
+     */
+    void unregisterSchemaElements( String schemaName );
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java Thu Jan 25 08:45:40 2007
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface ObjectClassRegistry
+public interface ObjectClassRegistry extends SchemaObjectRegistry
 {
     /**
      * Registers an ObjectClass with this registry.
@@ -56,16 +56,6 @@
 
 
     /**
-     * Gets the name of the schema this schema object is associated with.
-     *
-     * @param id the object identifier or the name
-     * @return the schema name
-     * @throws NamingException if the schema object does not exist
-     */
-    String getSchemaName( String id ) throws NamingException;
-
-
-    /**
      * Checks to see if an objectClass exists.
      *
      * @param id the object identifier or name
@@ -81,13 +71,4 @@
      * @return an iterator over all ObjectClasses in registry
      */
     Iterator<ObjectClass> iterator();
-
-
-    /**
-     * Removes the ObjectClass corresponding to the numeric identifier form this registry.
-     * 
-     * @param numericOid the numeric identifier for the ObjectClass to remove
-     * @throws NamingException if the numeric identifier is not valid
-     */
-    void unregister( String numericOid ) throws NamingException;
 }

Added: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SchemaObjectRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SchemaObjectRegistry.java?view=auto&rev=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SchemaObjectRegistry.java (added)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SchemaObjectRegistry.java Thu Jan 25 08:45:40 2007
@@ -0,0 +1,63 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.server.schema.registries;
+
+
+import java.util.Iterator;
+
+import javax.naming.NamingException;
+
+import org.apache.directory.shared.ldap.schema.SchemaObject;
+
+
+/**
+ * Common schema object registry interface.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public interface SchemaObjectRegistry
+{
+    /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param id the object identifier or the name
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist
+     */
+    String getSchemaName( String id ) throws NamingException;
+
+    
+    /**
+     * Gets an iterator over the registered schema objects in the registry.
+     *
+     * @return an Iterator of homogenious schema objects
+     */
+    Iterator<? extends SchemaObject> iterator();
+
+
+    /**
+     * Removes the SchemaObject registered with this registry.
+     * 
+     * @param numericOid the numeric identifier
+     * @throws NamingException if the numeric identifier is invalid
+     */
+    void unregister( String numericOid ) throws NamingException;
+}

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxCheckerRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxCheckerRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxCheckerRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxCheckerRegistry.java Thu Jan 25 08:45:40 2007
@@ -93,4 +93,13 @@
      * @throws NamingException if the numericOid is not valid
      */
     void unregister( String numericOid ) throws NamingException;
+    
+    
+    /**
+     * Unregisters all syntaxCheckers defined for a specific schema from
+     * this registry.
+     * 
+     * @param schemaName the name of the schema whose syntaxCheckers will be removed
+     */
+    void unregisterSchemaElements( String schemaName );
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java?view=diff&rev=499844&r1=499843&r2=499844
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java Thu Jan 25 08:45:40 2007
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface SyntaxRegistry
+public interface SyntaxRegistry extends SchemaObjectRegistry
 {
     /**
      * Looks up a Syntax by its unique Object Identifier or by name.
@@ -57,16 +57,6 @@
 
 
     /**
-     * Gets the name of the schema this schema object is associated with.
-     *
-     * @param id the object identifier or the name
-     * @return the schema name
-     * @throws NamingException if the schema object does not exist
-     */
-    String getSchemaName( String id ) throws NamingException;
-
-
-    /**
      * Checks to see if a Syntax exists.  Backing store failures simply return
      * false.
      * 
@@ -82,13 +72,4 @@
      * @return an Iterator over all the Syntaxes within this registry
      */
     Iterator<Syntax> iterator();
-
-
-    /**
-     * Removes a registered syntax from this registry.
-     *
-     * @param numericOid the numerid id of the syntax being removed
-     * @throws NamingException if the id is not numeric
-     */
-    void unregister( String numericOid ) throws NamingException;
 }



Mime
View raw message