You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2007/08/24 20:47:48 UTC

svn commit: r569478 - in /directory/apacheds/trunk: core/src/main/java/org/apache/directory/server/core/interceptor/context/ core/src/main/java/org/apache/directory/server/core/schema/ server-unit/src/test/java/org/apache/directory/server/

Author: akarasulu
Date: Fri Aug 24 11:47:47 2007
New Revision: 569478

URL: http://svn.apache.org/viewvc?rev=569478&view=rev
Log:
Changes for DIRSERVER-1030:

 o adding root for cascade option to methods in schema subsystem
 o increased size of controls in opCtx to avoid allocation
 o changed test case for cascade control to use rename since modify is not
   allowed by RFC on rdn attributes 

Nothing in terms of logic and functionality has been implemented for the core
cascading capability.  I will start adding these one by one as I setup test 
cases to confirm their operation.


Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.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/MetaSyntaxCheckerHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChangeHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
    directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/CascadeControlITest.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java Fri Aug 24 11:47:47 2007
@@ -41,8 +41,8 @@
 
     /** The DN associated with the context */
     private LdapDN dn;
-    private Map<String, Control> requestControls = new HashMap<String, Control>(2);
-    private Map<String, Control> responseControls = new HashMap<String, Control>(2);
+    private Map<String, Control> requestControls = new HashMap<String, Control>(4);
+    private Map<String, Control> responseControls = new HashMap<String, Control>(4);
     
     
     /**

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java Fri Aug 24 11:47:47 2007
@@ -61,20 +61,21 @@
     }
     
     
-    protected abstract void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException;
+    protected abstract void modify( LdapDN name, Attributes entry, Attributes targetEntry, boolean cascade ) 
+        throws NamingException;
     
     
-    public final void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, Attributes targetEntry )
-        throws NamingException
+    public final void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, Attributes targetEntry, 
+        boolean cascade ) throws NamingException
     {
-        modify( name, entry, targetEntry );
+        modify( name, entry, targetEntry, cascade );
     }
 
 
-    public final void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, Attributes targetEntry )
-        throws NamingException
+    public final void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, 
+        Attributes targetEntry, boolean cascade ) throws NamingException
     {
-        modify( name, entry, targetEntry );
+        modify( name, entry, targetEntry, cascade );
     }
 
     

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java Fri Aug 24 11:47:47 2007
@@ -65,7 +65,8 @@
     }
 
 
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
+    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, boolean cascade ) 
+        throws NamingException
     {
         String oldOid = getOid( entry );
         Schema schema = getSchema( name );
@@ -105,7 +106,7 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
         String schemaName = getSchemaName( name );
         AttributeType at = factory.getAttributeType( entry, targetRegistries, schemaName );
@@ -119,11 +120,11 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
         
-        delete( at );
+        delete( at, cascade );
     }
 
 
-    public void delete( AttributeType at ) throws NamingException
+    public void delete( AttributeType at, boolean cascade ) throws NamingException
     {
         Schema schema = loader.getSchema( at.getSchema() );
         if ( ! schema.isDisabled() )
@@ -134,7 +135,7 @@
     }
 
 
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         Schema schema = getSchema( name );
         AttributeType oldAt = factory.getAttributeType( entry, targetRegistries, schema.getSchemaName() );
@@ -167,8 +168,8 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry ) 
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         Schema oldSchema = getSchema( oriChildName );
@@ -206,7 +207,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java Fri Aug 24 11:47:47 2007
@@ -99,7 +99,7 @@
     }
     
     
-    private void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
+    private void modify( LdapDN name, Attributes entry, Attributes targetEntry, boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
         Comparator comparator = factory.getComparator( targetEntry, targetRegistries );
@@ -140,17 +140,17 @@
     }
     
 
-    public void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, Attributes targetEntry )
-        throws NamingException
+    public void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, Attributes targetEntry, 
+        boolean cascade ) throws NamingException
     {
-        modify( name, entry, targetEntry );
+        modify( name, entry, targetEntry, cascade );
     }
 
 
-    public void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, Attributes targetEntry )
-        throws NamingException
+    public void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, Attributes targetEntry, 
+        boolean cascade ) throws NamingException
     {
-        modify( name, entry, targetEntry );
+        modify( name, entry, targetEntry, cascade );
     }
 
 
@@ -190,14 +190,14 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
         String oid = getOid( entry );
-        delete( oid );
+        delete( oid, cascade );
     }
 
 
-    public void delete( String oid ) throws NamingException
+    public void delete( String oid, boolean cascade ) throws NamingException
     {
         if ( matchingRuleRegistry.hasMatchingRule( oid ) )
         {
@@ -214,7 +214,7 @@
     }
 
     
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
 
@@ -240,8 +240,8 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry ) 
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         String oldOid = getOid( entry );
@@ -275,7 +275,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java Fri Aug 24 11:47:47 2007
@@ -48,7 +48,8 @@
      * @see org.apache.directory.server.core.schema.AbstractSchemaChangeHandler#modify(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, javax.naming.directory.Attributes)
      */
     @Override
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
+    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, boolean cascade ) 
+        throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -68,7 +69,7 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#delete(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -78,8 +79,8 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, java.lang.String, boolean, javax.naming.directory.Attributes)
      */
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry )
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -89,7 +90,8 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) throws NamingException
+    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, 
+        boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -99,7 +101,7 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#rename(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, java.lang.String)
      */
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -112,7 +114,7 @@
     }
 
 
-    public void delete( DITContentRule dcr ) throws NamingException
+    public void delete( DITContentRule dcr, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java Fri Aug 24 11:47:47 2007
@@ -45,10 +45,13 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.AbstractSchemaChangeHandler#modify(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.AbstractSchemaChangeHandler#modify(
+     * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, 
+     * javax.naming.directory.Attributes)
      */
     @Override
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
+    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, 
+        boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -56,7 +59,8 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#add(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#add(
+     * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
     public void add( LdapDN name, Attributes entry ) throws NamingException
     {
@@ -66,9 +70,10 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#delete(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#delete(
+     * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -76,10 +81,13 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, java.lang.String, boolean, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(
+     * org.apache.directory.shared.ldap.name.LdapDN, 
+     * org.apache.directory.shared.ldap.name.LdapDN, 
+     * java.lang.String, boolean, javax.naming.directory.Attributes)
      */
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry )
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -87,9 +95,13 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(
+     * org.apache.directory.shared.ldap.name.LdapDN, 
+     * org.apache.directory.shared.ldap.name.LdapDN, 
+     * javax.naming.directory.Attributes)
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) throws NamingException
+    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, 
+        boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -97,9 +109,10 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#rename(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, java.lang.String)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#rename(
+     * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, java.lang.String)
      */
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -112,7 +125,7 @@
     }
 
 
-    public void delete( DITStructureRule dsr ) throws NamingException
+    public void delete( DITStructureRule dsr, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java Fri Aug 24 11:47:47 2007
@@ -64,7 +64,8 @@
     }
 
 
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
+    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, 
+        boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
         Schema schema = getSchema( name );
@@ -90,7 +91,7 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
         String schemaName = getSchemaName( name );
         MatchingRule mr = factory.getMatchingRule( entry, targetRegistries, schemaName );
@@ -104,11 +105,11 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
         
-        delete( mr );
+        delete( mr, cascade );
     }
 
 
-    public void delete( MatchingRule mr ) throws NamingException
+    public void delete( MatchingRule mr, boolean cascade ) throws NamingException
     {
         Schema schema = loader.getSchema( mr.getSchema() );
         if ( ! schema.isDisabled() )
@@ -119,7 +120,7 @@
     }
 
     
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         Schema schema = getSchema( name );
         MatchingRule oldMr = factory.getMatchingRule( entry, targetRegistries, schema.getSchemaName() );
@@ -152,8 +153,8 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry ) 
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         Schema oldSchema = getSchema( oriChildName );
@@ -191,7 +192,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java Fri Aug 24 11:47:47 2007
@@ -45,17 +45,21 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.AbstractSchemaChangeHandler#modify(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.AbstractSchemaChangeHandler#modify(
+     * org.apache.directory.shared.ldap.name.LdapDN, 
+     * javax.naming.directory.Attributes, javax.naming.directory.Attributes)
      */
     @Override
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
+    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, 
+        boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#add(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#add(
+     * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
     public void add( LdapDN name, Attributes entry ) throws NamingException
     {
@@ -64,37 +68,47 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#delete(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#delete(
+     * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, java.lang.String, boolean, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(
+     * org.apache.directory.shared.ldap.name.LdapDN, 
+     * org.apache.directory.shared.ldap.name.LdapDN, 
+     * java.lang.String, boolean, javax.naming.directory.Attributes)
      */
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry )
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(
+     * org.apache.directory.shared.ldap.name.LdapDN, 
+     * org.apache.directory.shared.ldap.name.LdapDN, 
+     * javax.naming.directory.Attributes)
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) throws NamingException
+    public void replace( LdapDN oriChildName, LdapDN newParentName, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#rename(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, java.lang.String)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#rename(
+     * org.apache.directory.shared.ldap.name.LdapDN, 
+     * javax.naming.directory.Attributes, java.lang.String)
      */
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
@@ -106,7 +120,7 @@
     }
 
 
-    public void delete( MatchingRuleUse mru ) throws NamingException
+    public void delete( MatchingRuleUse mru, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java Fri Aug 24 11:47:47 2007
@@ -45,10 +45,13 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.AbstractSchemaChangeHandler#modify(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.AbstractSchemaChangeHandler#modify(
+     * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, 
+     * javax.naming.directory.Attributes)
      */
     @Override
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
+    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, 
+        boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -56,7 +59,8 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#add(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#add(
+     * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
     public void add( LdapDN name, Attributes entry ) throws NamingException
     {
@@ -66,9 +70,10 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#delete(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#delete(
+     * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -76,10 +81,12 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, java.lang.String, boolean, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(
+     * org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, 
+     * java.lang.String, boolean, javax.naming.directory.Attributes)
      */
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry )
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, 
+        boolean deleteOldRn, Attributes entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -87,9 +94,12 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(
+     * org.apache.directory.shared.ldap.name.LdapDN, 
+     * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) throws NamingException
+    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, 
+        boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -97,9 +107,10 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#rename(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, java.lang.String)
+     * @see org.apache.directory.server.core.schema.SchemaChangeHandler#rename(
+     * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, java.lang.String)
      */
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -112,7 +123,7 @@
     }
 
 
-    public void delete( NameForm nf ) throws NamingException
+    public void delete( NameForm nf, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java Fri Aug 24 11:47:47 2007
@@ -124,7 +124,7 @@
     }
     
     
-    private void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
+    private void modify( LdapDN name, Attributes entry, Attributes targetEntry, boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
         Normalizer normalizer = factory.getNormalizer( targetEntry, targetRegistries );
@@ -140,17 +140,17 @@
     }
 
 
-    public void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, Attributes targetEntry )
-        throws NamingException
+    public void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, 
+        Attributes targetEntry, boolean cascade ) throws NamingException
     {
-        modify( name, entry, targetEntry );
+        modify( name, entry, targetEntry, cascade );
     }
 
 
-    public void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, Attributes targetEntry )
-        throws NamingException
+    public void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, Attributes targetEntry, 
+        boolean cascade ) throws NamingException
     {
-        modify( name, entry, targetEntry );
+        modify( name, entry, targetEntry, cascade );
     }
 
 
@@ -190,13 +190,13 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
-        delete( getOid( entry ) );
+        delete( getOid( entry ), cascade );
     }
 
 
-    public void delete( String oid ) throws NamingException
+    public void delete( String oid, boolean cascade ) throws NamingException
     {
         if ( matchingRuleRegistry.hasMatchingRule( oid ) )
         {
@@ -213,7 +213,7 @@
     }
     
 
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
 
@@ -240,8 +240,8 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry ) 
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         String oldOid = getOid( entry );
@@ -275,7 +275,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java Fri Aug 24 11:47:47 2007
@@ -64,7 +64,8 @@
     }
 
 
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
+    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, 
+        boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
         Schema schema = getSchema( name );
@@ -90,7 +91,7 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
         String schemaName = getSchemaName( name );
         ObjectClass oc = factory.getObjectClass( entry, targetRegistries, schemaName );
@@ -104,11 +105,11 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        delete( oc );
+        delete( oc, cascade );
     }
 
 
-    public void delete( ObjectClass oc ) throws NamingException
+    public void delete( ObjectClass oc, boolean cascade ) throws NamingException
     {
         Schema schema = loader.getSchema( oc.getSchema() );
         
@@ -121,7 +122,7 @@
     }
 
 
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         Schema schema = getSchema( name );
         ObjectClass oldOc = factory.getObjectClass( entry, targetRegistries, schema.getSchemaName() );
@@ -154,8 +155,8 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry ) 
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         Schema oldSchema = getSchema( oriChildName );
@@ -193,7 +194,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );

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?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- 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 Fri Aug 24 11:47:47 2007
@@ -85,8 +85,8 @@
      * @param mods the attribute modifications as an Attributes object
      * @param entry the entry after the modifications have been applied
      */
-    public void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, Attributes targetEntry )
-        throws NamingException
+    public void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, 
+        Attributes targetEntry, boolean cascade ) throws NamingException
     {
         Attribute disabledInMods = AttributeUtils.getAttribute( mods, disabledAT );
         if ( disabledInMods != null )
@@ -123,8 +123,8 @@
      * @param mods the attribute modifications as an ModificationItem arry
      * @param entry the entry after the modifications have been applied
      */
-    public void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, Attributes targetEntry )
-        throws NamingException
+    public void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, 
+        Attributes targetEntry, boolean cascade ) throws NamingException
     {
         Attribute disabledInEntry = AttributeUtils.getAttribute( entry, disabledAT );
         ModificationItemImpl disabledModification = AttributeUtils.getModificationItem( mods, disabledAT );
@@ -226,7 +226,7 @@
      * @param name the dn of the metaSchema object being deleted
      * @param entry the attributes of the metaSchema object 
      */
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
         Attribute cn = AttributeUtils.getAttribute( entry, cnAT );
         String schemaName = ( String ) cn.get();
@@ -256,7 +256,7 @@
      * @param entry the entry of the metaSchema object before the rename
      * @param newRdn the new commonName of the metaSchema object
      */
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         String rdnAttribute = NamespaceTools.getRdnAttribute( newRdn );
         String rdnAttributeOid = globalRegistries.getOidRegistry().getOid( rdnAttribute );
@@ -336,8 +336,8 @@
      * Moves are not allowed for metaSchema objects so this always throws an
      * UNWILLING_TO_PERFORM LdapException.
      */
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry )
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         throw new LdapOperationNotSupportedException( "Moving around schemas is not allowed.",
             ResultCodeEnum.UNWILLING_TO_PERFORM );
@@ -348,7 +348,8 @@
      * Moves are not allowed for metaSchema objects so this always throws an
      * UNWILLING_TO_PERFORM LdapException.
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) throws NamingException
+    public void replace( LdapDN oriChildName, LdapDN newParentName, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         throw new LdapOperationNotSupportedException( "Moving around schemas is not allowed.",
             ResultCodeEnum.UNWILLING_TO_PERFORM );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java Fri Aug 24 11:47:47 2007
@@ -126,7 +126,7 @@
     }
     
     
-    private void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
+    private void modify( LdapDN name, Attributes entry, Attributes targetEntry, boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
         SyntaxChecker syntaxChecker = factory.getSyntaxChecker( targetEntry, targetRegistries );
@@ -142,17 +142,17 @@
     }
 
 
-    public void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, Attributes targetEntry )
-        throws NamingException
+    public void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, 
+        Attributes targetEntry, boolean cascade ) throws NamingException
     {
-        modify( name, entry, targetEntry );
+        modify( name, entry, targetEntry, cascade );
     }
 
 
-    public void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, Attributes targetEntry )
-        throws NamingException
+    public void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, 
+        Attributes targetEntry, boolean cascade ) throws NamingException
     {
-        modify( name, entry, targetEntry );
+        modify( name, entry, targetEntry, cascade );
     }
 
 
@@ -194,13 +194,13 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
-        delete( getOid( entry ) );
+        delete( getOid( entry ), cascade );
     }
 
 
-    public void delete( String oid ) throws NamingException
+    public void delete( String oid, boolean cascade ) throws NamingException
     {
         if ( syntaxRegistry.hasSyntax( oid ) )
         {
@@ -217,7 +217,7 @@
     }
 
 
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
 
@@ -245,8 +245,8 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry ) 
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         String oldOid = getOid( entry );
@@ -281,7 +281,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java Fri Aug 24 11:47:47 2007
@@ -64,7 +64,8 @@
     }
 
     
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry ) throws NamingException
+    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, 
+        boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
         Schema schema = getSchema( name );
@@ -90,7 +91,7 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry ) throws NamingException
+    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
     {
         String oid = getOid( entry );
         
@@ -107,11 +108,11 @@
         
         String schemaName = getSchemaName( name );
         Syntax syntax = factory.getSyntax( entry, targetRegistries, schemaName );
-        delete( syntax );
+        delete( syntax, cascade );
     }
 
 
-    public void delete( Syntax syntax ) throws NamingException
+    public void delete( Syntax syntax, boolean cascade ) throws NamingException
     {
         Schema schema = loader.getSchema( syntax.getSchema() );
         if ( ! schema.isDisabled() )
@@ -124,7 +125,7 @@
     }
 
     
-    public void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException
+    public void rename( LdapDN name, Attributes entry, String newRdn, boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
 
@@ -160,8 +161,8 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry ) 
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         String oldOid = getOid( entry );
@@ -202,7 +203,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChangeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChangeHandler.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChangeHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChangeHandler.java Fri Aug 24 11:47:47 2007
@@ -37,10 +37,13 @@
 public interface SchemaChangeHandler
 {
     void add( LdapDN name, Attributes entry ) throws NamingException;
-    void delete( LdapDN name, Attributes entry ) throws NamingException;
-    void rename( LdapDN name, Attributes entry, String newRdn ) throws NamingException;
-    void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, Attributes targetEntry ) throws NamingException;
-    void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, Attributes targetEntry ) throws NamingException;
-    void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry ) throws NamingException;
-    void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) throws NamingException;
+    void delete( LdapDN name, Attributes entry, boolean cascaded ) throws NamingException;
+    void rename( LdapDN name, Attributes entry, String newRdn, boolean cascaded ) throws NamingException;
+    void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, Attributes targetEntry, boolean cascaded ) 
+        throws NamingException;
+    void modify( LdapDN name, ModificationItemImpl[] mods, Attributes entry, Attributes targetEntry, boolean cascaded ) 
+        throws NamingException;
+    void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry, 
+        boolean cascaded ) throws NamingException;
+    void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascaded ) throws NamingException;
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java Fri Aug 24 11:47:47 2007
@@ -335,7 +335,7 @@
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
                 SchemaChangeHandler handler = objectClass2handlerMap.get( oid );
-                handler.delete( name, entry );
+                handler.delete( name, entry, doCascadeDelete );
                 updateSchemaModificationAttributes();
                 return;
             }
@@ -343,7 +343,7 @@
 
         if ( AttributeUtils.containsValue( oc, MetaSchemaConstants.META_SCHEMA_OC, objectClassAT ) )
         {
-            metaSchemaHandler.delete( name, entry );
+            metaSchemaHandler.delete( name, entry, doCascadeDelete );
             updateSchemaModificationAttributes();
             return;
         }
@@ -372,8 +372,8 @@
     }
     
 
-    public void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, Attributes targetEntry ) 
-        throws NamingException
+    public void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, 
+        Attributes targetEntry, boolean cascade ) throws NamingException
     {
         Attribute oc = AttributeUtils.getAttribute( entry, objectClassAT );
         
@@ -383,7 +383,7 @@
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
                 SchemaChangeHandler handler = objectClass2handlerMap.get( oid );
-                handler.modify( name, modOp, mods, entry, targetEntry );
+                handler.modify( name, modOp, mods, entry, targetEntry, cascade );
                 updateSchemaModificationAttributes();
                 return;
             }
@@ -391,7 +391,7 @@
 
         if ( AttributeUtils.containsValue( oc, MetaSchemaConstants.META_SCHEMA_OC, objectClassAT ) )
         {
-            metaSchemaHandler.modify( name, modOp, mods, entry, targetEntry );
+            metaSchemaHandler.modify( name, modOp, mods, entry, targetEntry, cascade );
             updateSchemaModificationAttributes();
             return;
         }
@@ -411,7 +411,7 @@
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
                 SchemaChangeHandler handler = objectClass2handlerMap.get( oid );
-                handler.modify( name, mods, entry, targetEntry );
+                handler.modify( name, mods, entry, targetEntry, doCascadeModify );
                 updateSchemaModificationAttributes();
                 return;
             }
@@ -419,7 +419,7 @@
 
         if ( AttributeUtils.containsValue( oc, MetaSchemaConstants.META_SCHEMA_OC, objectClassAT ) )
         {
-            metaSchemaHandler.modify( name, mods, entry, targetEntry );
+            metaSchemaHandler.modify( name, mods, entry, targetEntry, doCascadeModify );
             updateSchemaModificationAttributes();
             return;
         }
@@ -439,7 +439,7 @@
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
                 SchemaChangeHandler handler = objectClass2handlerMap.get( oid );
-                handler.rename( name, entry, newRdn );
+                handler.rename( name, entry, newRdn, doCascadeModify );
                 updateSchemaModificationAttributes();
                 return;
             }
@@ -447,7 +447,7 @@
 
         if ( AttributeUtils.containsValue( oc, MetaSchemaConstants.META_SCHEMA_OC, objectClassAT ) )
         {
-            metaSchemaHandler.rename( name, entry, newRdn );
+            metaSchemaHandler.rename( name, entry, newRdn, doCascadeModify );
             updateSchemaModificationAttributes();
             return;
         }
@@ -456,7 +456,8 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry ) throws NamingException
+    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, 
+        boolean cascade ) throws NamingException
     {
         Attribute oc = AttributeUtils.getAttribute( entry, objectClassAT );
         
@@ -467,7 +468,7 @@
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
                 SchemaChangeHandler handler = objectClass2handlerMap.get( oid );
-                handler.replace( oriChildName, newParentName, entry );
+                handler.replace( oriChildName, newParentName, entry, cascade );
                 updateSchemaModificationAttributes();
                 return;
             }
@@ -475,7 +476,7 @@
 
         if ( AttributeUtils.containsValue( oc, MetaSchemaConstants.META_SCHEMA_OC, objectClassAT ) )
         {
-            metaSchemaHandler.replace( oriChildName, newParentName, entry );
+            metaSchemaHandler.replace( oriChildName, newParentName, entry, cascade );
             updateSchemaModificationAttributes();
             return;
         }
@@ -484,8 +485,8 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, Attributes entry )
-        throws NamingException
+    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
+        Attributes entry, boolean cascade ) throws NamingException
     {
         Attribute oc = AttributeUtils.getAttribute( entry, objectClassAT );
         
@@ -495,7 +496,7 @@
             if ( objectClass2handlerMap.containsKey( oid ) )
             {
                 SchemaChangeHandler handler = objectClass2handlerMap.get( oid );
-                handler.move( oriChildName, newParentName, newRn, deleteOldRn, entry );
+                handler.move( oriChildName, newParentName, newRn, deleteOldRn, entry, cascade );
                 updateSchemaModificationAttributes();
                 return;
             }
@@ -503,7 +504,7 @@
 
         if ( AttributeUtils.containsValue( oc, MetaSchemaConstants.META_SCHEMA_OC, objectClassAT ) )
         {
-            metaSchemaHandler.move( oriChildName, newParentName, newRn, deleteOldRn, entry );
+            metaSchemaHandler.move( oriChildName, newParentName, newRn, deleteOldRn, entry, cascade );
             updateSchemaModificationAttributes();
             return;
         }
@@ -636,7 +637,7 @@
                 
                 for ( ComparatorDescription comparatorDescription : comparatorDescriptions )
                 {
-                    comparatorHandler.delete( comparatorDescription.getNumericOid() );
+                    comparatorHandler.delete( comparatorDescription.getNumericOid(), doCascadeModify );
                     subentryModifier.delete( comparatorDescription );
                 }
                 break;
@@ -646,7 +647,7 @@
                 
                 for ( NormalizerDescription normalizerDescription : normalizerDescriptions )
                 {
-                    normalizerHandler.delete( normalizerDescription.getNumericOid() );
+                    normalizerHandler.delete( normalizerDescription.getNumericOid(), doCascadeModify );
                     subentryModifier.delete( normalizerDescription );
                 }
                 break;
@@ -656,7 +657,7 @@
                 
                 for ( SyntaxCheckerDescription syntaxCheckerDescription : syntaxCheckerDescriptions )
                 {
-                    syntaxCheckerHandler.delete( syntaxCheckerDescription.getNumericOid() );
+                    syntaxCheckerHandler.delete( syntaxCheckerDescription.getNumericOid(), doCascadeModify );
                     subentryModifier.delete( syntaxCheckerDescription );
                 }
                 break;
@@ -666,7 +667,7 @@
                 
                 for ( Syntax syntax : syntaxes )
                 {
-                    syntaxHandler.delete( syntax );
+                    syntaxHandler.delete( syntax, doCascadeModify );
                     subentryModifier.deleteSchemaObject( syntax );
                 }
                 break;
@@ -676,7 +677,7 @@
                 
                 for ( MatchingRule mr : mrs )
                 {
-                    matchingRuleHandler.delete( mr );
+                    matchingRuleHandler.delete( mr, doCascadeModify );
                     subentryModifier.deleteSchemaObject( mr );
                 }
                 break;
@@ -686,7 +687,7 @@
                 
                 for ( AttributeType at : ats )
                 {
-                    atHandler.delete( at );
+                    atHandler.delete( at, doCascadeModify );
                     subentryModifier.deleteSchemaObject( at );
                 }
                 break;
@@ -696,7 +697,7 @@
 
                 for ( ObjectClass oc : ocs )
                 {
-                    ocHandler.delete( oc );
+                    ocHandler.delete( oc, doCascadeModify );
                     subentryModifier.deleteSchemaObject( oc );
                 }
                 break;
@@ -706,7 +707,7 @@
                 
                 for ( MatchingRuleUse mru : mrus )
                 {
-                    mruHandler.delete( mru );
+                    mruHandler.delete( mru, doCascadeModify );
                     subentryModifier.deleteSchemaObject( mru );
                 }
                 break;
@@ -716,7 +717,7 @@
                 
                 for ( DITStructureRule dsr : dsrs )
                 {
-                    dsrHandler.delete( dsr );
+                    dsrHandler.delete( dsr, doCascadeModify );
                     subentryModifier.deleteSchemaObject( dsr );
                 }
                 break;
@@ -726,7 +727,7 @@
                 
                 for ( DITContentRule dcr : dcrs )
                 {
-                    dcrHandler.delete( dcr );
+                    dcrHandler.delete( dcr, doCascadeModify );
                     subentryModifier.deleteSchemaObject( dcr );
                 }
                 break;
@@ -736,7 +737,7 @@
                 
                 for ( NameForm nf : nfs )
                 {
-                    nfHandler.delete( nf );
+                    nfHandler.delete( nf, doCascadeModify );
                     subentryModifier.deleteSchemaObject( nf );
                 }
                 break;

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?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- 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 Fri Aug 24 11:47:47 2007
@@ -1190,7 +1190,8 @@
             schemaManager.move( oriChildName, 
                 opContext.getParent(), 
                 opContext.getNewRdn(), 
-                opContext.getDelOldDn(), entry );
+                opContext.getDelOldDn(), entry,
+                opContext.hasRequestControl( CascadeControl.CONTROL_OID ) );
         }
         
         next.moveAndRename( opContext );
@@ -1205,7 +1206,8 @@
 
         if ( oriChildName.startsWith( schemaBaseDN ) )
         {
-            schemaManager.replace( oriChildName, opContext.getParent(), entry );
+            schemaManager.replace( oriChildName, opContext.getParent(), entry, 
+                opContext.hasRequestControl( CascadeControl.CONTROL_OID ) );
         }
         
         next.move( opContext );

Modified: directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/CascadeControlITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/CascadeControlITest.java?rev=569478&r1=569477&r2=569478&view=diff
==============================================================================
--- directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/CascadeControlITest.java (original)
+++ directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/CascadeControlITest.java Fri Aug 24 11:47:47 2007
@@ -81,26 +81,24 @@
      * Tests the behavior of the server with a SearchRequest including
      * the CascadeControl.
      */
-    public void testCascadeControl()
+    public void testCascadeControl() throws NamingException
     {
+        LdapContext containerCtx = ( LdapContext ) ctx.lookup( "ou=attributeTypes, cn=apachemeta, ou=schema" );
+        
         try
         {
-            ctx.setRequestControls( new Control[]
-                { new CascadeControl() } );
+            containerCtx.setRequestControls( new Control[] { new CascadeControl() } );
         }
         catch ( NamingException e )
         {
             fail( e.getMessage() );
         }
 
-        Attribute attr = new AttributeImpl( "m-oid", "1.2.3.4.5.6.7.8.9.0" );
-        ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
-
-        String rdn = "m-oid=1.3.6.1.4.1.18060.0.4.0.2.1, ou=attributeTypes, cn=apachemeta, ou=schema";
+        String oldRdn = "m-oid=1.3.6.1.4.1.18060.0.4.0.2.1";
+        String newRdn = "m-oid=1.3.6.1.4.1.18060.0.4.0.2.1000";
         try
         {
-            ctx.modifyAttributes( rdn, new ModificationItemImpl[]
-                { item } );
+            containerCtx.rename( oldRdn, newRdn );
         }
         catch ( NamingException e )
         {