directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1053962 - in /directory/apacheds/branches/apacheds-AP: core-api/src/main/java/org/apache/directory/server/core/interceptor/ core-integ/src/test/java/org/apache/directory/server/core/subtree/ core/src/main/java/org/apache/directory/server/c...
Date Thu, 30 Dec 2010 18:21:49 GMT
Author: elecharny
Date: Thu Dec 30 18:21:48 2010
New Revision: 1053962

URL: http://svn.apache.org/viewvc?rev=1053962&view=rev
Log:
o Corrected the ref to subentry into added entries
o Created some helper methods in tests
o Some dead code removal

Modified:
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
    directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/AbstractSubentryUnitTest.java
    directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java
    directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryLookupOperationIT.java
    directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?rev=1053962&r1=1053961&r2=1053962&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java Thu Dec 30 18:21:48 2010
@@ -64,6 +64,9 @@ public abstract class BaseInterceptor im
     /** Set of operational attribute types used to manage the AdmnistrativePoint SequenceNumbers  */
     protected static final Set<AttributeType> AP_SEQUENCE_NUMBER_ATTRIBUTE_TYPES = new HashSet<AttributeType>();
 
+    /** Set of operational attribute types used to manage the subentry references in entries */
+    protected static final Set<AttributeType> SUBENTRIES_UUID_ATTRIBUTE_TYPES = new HashSet<AttributeType>();
+
     /**
      * default interceptor name is its class, preventing accidental duplication of interceptors by naming
      * instances differently

Modified: directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/AbstractSubentryUnitTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/AbstractSubentryUnitTest.java?rev=1053962&r1=1053961&r2=1053962&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/AbstractSubentryUnitTest.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/AbstractSubentryUnitTest.java Thu Dec 30 18:21:48 2010
@@ -145,7 +145,6 @@ public class AbstractSubentryUnitTest ex
             dn, 
             "ObjectClass: top",
             "ObjectClass: organizationalUnit", 
-            "administrativeRole: accessControlSpecificArea",
             "administrativeRole: autonomousArea"
             );
 
@@ -157,6 +156,44 @@ public class AbstractSubentryUnitTest ex
     
     
     /**
+     * Creates a CA SAP 
+     */
+    protected void createCaSAP( String dn ) throws LdapException
+    {
+        Entry autonomousArea = LdifUtils.createEntry( 
+            dn, 
+            "ObjectClass: top",
+            "ObjectClass: organizationalUnit", 
+            "administrativeRole: collectiveAttributeSpecificArea"
+            );
+
+        // It should succeed
+        AddResponse response = adminConnection.add( autonomousArea );
+
+        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+    }
+    
+    
+    /**
+     * Creates an AC SAP 
+     */
+    protected void createAcSAP( String dn ) throws LdapException
+    {
+        Entry autonomousArea = LdifUtils.createEntry( 
+            dn, 
+            "ObjectClass: top",
+            "ObjectClass: organizationalUnit", 
+            "administrativeRole: accessControlSpecificArea"
+            );
+
+        // It should succeed
+        AddResponse response = adminConnection.add( autonomousArea );
+
+        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+    }
+    
+    
+    /**
      * Creates a CollectiveAttribute subentry
      */
     protected void createCASubentry( String dn ) throws LdapException

Modified: directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java?rev=1053962&r1=1053961&r2=1053962&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryAddOperationIT.java Thu Dec 30 18:21:48 2010
@@ -259,19 +259,11 @@ public class SubentryAddOperationIT exte
     public void testAddAPUnderSubentry() throws Exception
     {
         // First add an AAP
-        Entry autonomousArea = LdifUtils.createEntry( 
-            "ou=SAP,ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: SAP", 
-            "administrativeRole: autonomousArea" );
-
-        AddResponse response = adminConnection.add( autonomousArea );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        createAAP( "ou=AAP,ou=system" );
         
         // Add a subentry now
         Entry subentry = LdifUtils.createEntry( 
-            "cn=test,ou=SAP,ou=system", 
+            "cn=test,ou=AAP,ou=system", 
             "ObjectClass: top",
             "ObjectClass: subentry", 
             "ObjectClass: collectiveAttributeSubentry",
@@ -279,20 +271,20 @@ public class SubentryAddOperationIT exte
             "subtreeSpecification: {}", 
             "c-o: Test Org" );
 
-        response = adminConnection.add( subentry );
+        AddResponse response = adminConnection.add( subentry );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
         
-        Entry subentryEntry = adminConnection.lookup( "cn=test,ou=SAP,ou=system", "+", "*" );
+        Entry subentryEntry = adminConnection.lookup( "cn=test,ou=AAP,ou=system", "+", "*" );
         assertNotNull( subentryEntry );
 
-        Entry ap = adminConnection.lookup( "ou=SAP,ou=system", "+", "*" );
+        Entry ap = adminConnection.lookup( "ou=AAP,ou=system", "+", "*" );
         assertNotNull( ap );
         assertEquals( "1", ap.get( "CollectiveAttributeSeqNumber" ).getString() );
         
         // Now, try to inject an AP under the subentry
         // First add an AAP
         Entry badAP = LdifUtils.createEntry( 
-            "ou=BADAP,cn=test,ou=SAP,ou=system", 
+            "ou=BADAP,cn=test,ou=AAP,ou=system", 
             "ObjectClass: top",
             "ObjectClass: organizationalUnit", 
             "ou: BADAP", 
@@ -310,10 +302,10 @@ public class SubentryAddOperationIT exte
     public void testAddSAPWithNonAdmin() throws Exception
     {
         Entry sap = LdifUtils.createEntry( 
-            "ou=IAP,ou=system", 
+            "ou=SAP,ou=system", 
             "ObjectClass: top",
             "ObjectClass: organizationalUnit", 
-            "ou: IAP", 
+            "ou: SAP", 
             "administrativeRole: accessControlSpecificArea" );
 
         // It should fail
@@ -373,25 +365,17 @@ public class SubentryAddOperationIT exte
     public void testAddIAPUnderSAPDifferentRole() throws Exception
     {
         // First add an SAP
-        Entry sap = LdifUtils.createEntry( 
-            "ou=SAP1,ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: SAP", 
-            "administrativeRole: accessControlSpecificArea" );
-
-        AddResponse response = adminConnection.add( sap );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        createAcSAP( "ou=SAP,ou=system" ); 
         
         // Add a IAP now
         Entry iap = LdifUtils.createEntry( 
-            "ou=IAP,ou=SAP1,ou=system", 
+            "ou=IAP,ou=SAP,ou=system", 
             "ObjectClass: top",
             "ObjectClass: organizationalUnit", 
             "ou: IAP",
             "administrativeRole: collectiveATtributeInnerArea" );
 
-        response = adminConnection.add( iap );
+        AddResponse response = adminConnection.add( iap );
         assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode() );
     }
     
@@ -437,17 +421,7 @@ public class SubentryAddOperationIT exte
     @Test
     public void testAddAutonomousArea() throws Exception
     {
-        Entry autonomousArea = LdifUtils.createEntry( 
-            "ou=autonomousArea, ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: autonomousArea", 
-            "administrativeRole: autonomousArea" );
-
-        // It should succeed
-        AddResponse response = adminConnection.add( autonomousArea );
-
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        createAAP( "ou=autonomousArea, ou=system" );
         
         Entry adminPoint = adminConnection.lookup( "ou=autonomousArea, ou=system", "+" );
         assertNotNull( adminPoint );
@@ -465,7 +439,7 @@ public class SubentryAddOperationIT exte
         assertTrue( entry.contains( "administrativeRole", "subschemaSpecificArea" ) );
         assertTrue( entry.contains( "administrativeRole", "triggerExecutionSpecificArea" ) );
 
-        autonomousArea = LdifUtils.createEntry( 
+        Entry autonomousArea = LdifUtils.createEntry( 
             "ou=autonomousArea2, ou=system", 
             "ObjectClass: top",
             "ObjectClass: organizationalUnit", 
@@ -477,7 +451,7 @@ public class SubentryAddOperationIT exte
             "administrativeRole: TRIGGEREXECUTIONSPECIFICAREA" );
 
         // It should fail, as an autonomous area is already defining the specific areas
-        response = adminConnection.add( autonomousArea );
+        AddResponse response = adminConnection.add( autonomousArea );
 
         assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode() );
     }
@@ -520,19 +494,7 @@ public class SubentryAddOperationIT exte
     @Test
     public void testAddInnerAreas() throws Exception
     {
-        Entry autonomousArea = LdifUtils.createEntry( 
-            "ou=AAP,ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: AAP", 
-            "administrativeRole: accessControlSpecificArea",
-            "administrativeRole: autonomousArea"
-            );
-
-        // It should succeed
-        AddResponse response = adminConnection.add( autonomousArea );
-
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        createAAP( "ou=AAP,ou=system" );
         
         // Now add the IAPs
         Entry innerAreas = LdifUtils.createEntry( 
@@ -543,7 +505,7 @@ public class SubentryAddOperationIT exte
             "administrativeRole: accessControlINNERArea",
             "administrativeRole: TRIGGEREXECUTIONINNERAREA" );
 
-        response = adminConnection.add( innerAreas );
+        AddResponse response = adminConnection.add( innerAreas );
 
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
 
@@ -563,25 +525,17 @@ public class SubentryAddOperationIT exte
     public void testAddIAPUnderSAP() throws Exception
     {
         // First add an SAP
-        Entry sap = LdifUtils.createEntry( 
-            "ou=SAP1,ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: SAP", 
-            "administrativeRole: accessControlSpecificArea" );
-
-        AddResponse response = adminConnection.add( sap );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        createAcSAP( "ou=SAP,ou=system" );
         
         // Add a IAP now
         Entry iap = LdifUtils.createEntry( 
-            "ou=IAP,ou=SAP1,ou=system", 
+            "ou=IAP,ou=SAP,ou=system", 
             "ObjectClass: top",
             "ObjectClass: organizationalUnit", 
             "ou: IAP",
             "administrativeRole: accessControlInnerArea" );
 
-        response = adminConnection.add( iap );
+        AddResponse response = adminConnection.add( iap );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
     }
     
@@ -598,19 +552,11 @@ public class SubentryAddOperationIT exte
     public void testAddSubentryDifferentRole() throws Exception
     {
         // First add an SAP
-        Entry sap1 = LdifUtils.createEntry( 
-            "ou=SAP1,ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: SAP1", 
-            "administrativeRole: accessControlSpecificArea" );
-
-        AddResponse response = adminConnection.add( sap1 );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        createAcSAP( "ou=SAP,ou=system" ); 
         
         // Add a subentry now with a different role
         Entry subentry = LdifUtils.createEntry( 
-            "cn=test,ou=SAP1,ou=system", 
+            "cn=test,ou=SAP,ou=system", 
             "ObjectClass: top",
             "ObjectClass: subentry", 
             "ObjectClass: collectiveAttributeSubentry",
@@ -618,7 +564,7 @@ public class SubentryAddOperationIT exte
             "subtreeSpecification: {}", 
             "c-o: Test Org" );
 
-        response = adminConnection.add( subentry );
+        AddResponse response = adminConnection.add( subentry );
         assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, response.getLdapResult().getResultCode() );
     }
     
@@ -654,15 +600,7 @@ public class SubentryAddOperationIT exte
     public void testAddSubentryUnderAAP() throws Exception
     {
         // First add an AAP
-        Entry autonomousArea = LdifUtils.createEntry( 
-            "ou=AAP,ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: AAP", 
-            "administrativeRole: autonomousArea" );
-
-        AddResponse response = adminConnection.add( autonomousArea );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        createAAP( "ou=AAP,ou=system" );
         
         // Add a subentry now
         Entry subentry = LdifUtils.createEntry( 
@@ -674,7 +612,7 @@ public class SubentryAddOperationIT exte
             "subtreeSpecification: {}", 
             "c-o: Test Org" );
 
-        response = adminConnection.add( subentry );
+        AddResponse response = adminConnection.add( subentry );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
     }
     
@@ -686,19 +624,11 @@ public class SubentryAddOperationIT exte
     public void testAddSubentryUnderSAP() throws Exception
     {
         // First add an SAP
-        Entry sap = LdifUtils.createEntry( 
-            "ou=SAP1,ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: SAP1", 
-            "administrativeRole: collectiveAttributeSpecificArea" );
-
-        AddResponse response = adminConnection.add( sap );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        createCaSAP( "ou=SAP,ou=system" ); 
         
         // Add a subentry now
         Entry subentry = LdifUtils.createEntry( 
-            "cn=test,ou=SAP1,ou=system", 
+            "cn=test,ou=SAP,ou=system", 
             "ObjectClass: top",
             "ObjectClass: subentry", 
             "ObjectClass: collectiveAttributeSubentry",
@@ -706,7 +636,7 @@ public class SubentryAddOperationIT exte
             "subtreeSpecification: {}", 
             "c-o: Test Org" );
 
-        response = adminConnection.add( subentry );
+        AddResponse response = adminConnection.add( subentry );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
     }
     
@@ -718,30 +648,22 @@ public class SubentryAddOperationIT exte
     public void testAddSubentryUnderIAP() throws Exception
     {
         // First add an SAP
-        Entry sap = LdifUtils.createEntry( 
-            "ou=SAP2,ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: SAP2", 
-            "administrativeRole: collectiveAttributeSpecificArea" );
-
-        AddResponse response = adminConnection.add( sap );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        createCaSAP( "ou=SAP,ou=system" ); 
         
         // Add a IAP now
         Entry iap = LdifUtils.createEntry( 
-            "ou=IAP2,ou=SAP2,ou=system", 
+            "ou=IAP,ou=SAP,ou=system", 
             "ObjectClass: top",
             "ObjectClass: organizationalUnit", 
-            "ou: IAP2",
+            "ou: IAP",
             "administrativeRole: collectiveAttributeInnerArea" );
 
-        response = adminConnection.add( iap );
+        AddResponse response = adminConnection.add( iap );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
         
         // Add a subentry now
         Entry subentry = LdifUtils.createEntry( 
-            "cn=test,ou=SAP2,ou=system", 
+            "cn=test,ou=SAP,ou=system", 
             "ObjectClass: top",
             "ObjectClass: subentry", 
             "ObjectClass: collectiveAttributeSubentry",
@@ -761,19 +683,11 @@ public class SubentryAddOperationIT exte
     public void testAddSubentryWith2Roles() throws Exception
     {
         // First add an AAP
-        Entry aap = LdifUtils.createEntry( 
-            "ou=AAP2,ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: AAP2", 
-            "administrativeRole: autonomousArea" );
-
-        AddResponse response = adminConnection.add( aap );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        createAAP( "ou=AAP,ou=system" ); 
         
         // Add a subentry now
         Entry subentry = LdifUtils.createEntry( 
-            "cn=test,ou=AAP2,ou=system", 
+            "cn=test,ou=AAP,ou=system", 
             "ObjectClass: top",
             "ObjectClass: subentry", 
             "ObjectClass: collectiveAttributeSubentry",
@@ -798,16 +712,16 @@ public class SubentryAddOperationIT exte
             + "  } "
             + "}" );
 
-        response = adminConnection.add( subentry );
+        AddResponse response = adminConnection.add( subentry );
         assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
         
-        DN subentryDN = new DN( "cn=test, ou=AAP2,ou=system" );
+        DN subentryDN = new DN( "cn=test, ou=AAP,ou=system" );
         
         // Get back the subentry
         Entry addedSE = adminConnection.lookup( subentryDN, "+" );
         String subentryUUID = addedSE.get( "entryUUID" ).getString();
         
-        DN apDn = new DN( "ou=AAP2,ou=system" );
+        DN apDn = new DN( "ou=AAP,ou=system" );
         apDn.normalize( service.getSchemaManager() );
         
         // Check that we have a ref to the added subentry in the two APs (AC and CA)
@@ -845,15 +759,7 @@ public class SubentryAddOperationIT exte
     public void testAdd2Entries() throws Exception
     {
         // First add an SAP
-        Entry sap = LdifUtils.createEntry( 
-            "ou=SAP,ou=system", 
-            "ObjectClass: top",
-            "ObjectClass: organizationalUnit", 
-            "ou: SAP", 
-            "administrativeRole: collectiveAttributeSpecificArea" );
-
-        AddResponse response = adminConnection.add( sap );
-        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+        createCaSAP( "ou=SAP,ou=system" );
         assertEquals( -1L, getCASeqNumber( "ou=SAP,ou=system" ) );
         
         // Create a first entry
@@ -864,7 +770,7 @@ public class SubentryAddOperationIT exte
             "cn: e1", 
             "sn: entry 1" );
         
-        response = adminConnection.add( e1 );
+        AddResponse response = adminConnection.add( e1 );
 
         assertEquals( -1L, getCASeqNumber( "cn=e1,ou=SAP,ou=system" ) );
         

Modified: directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryLookupOperationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryLookupOperationIT.java?rev=1053962&r1=1053961&r2=1053962&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryLookupOperationIT.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryLookupOperationIT.java Thu Dec 30 18:21:48 2010
@@ -28,6 +28,9 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.apache.directory.shared.ldap.message.AddResponse;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -166,7 +169,18 @@ public class SubentryLookupOperationIT e
     @Test
     public void testLookupEntryNoAp() throws Exception
     {
-        // TODO
+        // Create a first entry
+        Entry e1 = LdifUtils.createEntry( 
+            "cn=e1,ou=system", 
+            "ObjectClass: top",
+            "ObjectClass: person", 
+            "cn: e1", 
+            "sn: entry 1" );
+        
+        AddResponse response = adminConnection.add( e1 );
+        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+
+        assertEquals( Long.MIN_VALUE, getCASeqNumber( "cn=e1,ou=system" ) );
     }
 
 
@@ -177,7 +191,21 @@ public class SubentryLookupOperationIT e
     @Test
     public void testLookupEntryUnderApNoSubentry() throws Exception
     {
-        // TODO
+        // Create an AP
+        createAAP( "ou=AAP,ou=system" );
+        
+        // Create a first entry
+        Entry e1 = LdifUtils.createEntry( 
+            "cn=e1,ou=AAP,ou=system", 
+            "ObjectClass: top",
+            "ObjectClass: person", 
+            "cn: e1", 
+            "sn: entry 1" );
+        
+        AddResponse response = adminConnection.add( e1 );
+        assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
+
+        assertEquals( -1L, getCASeqNumber( "cn=e1,ou=AAP,ou=system" ) );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1053962&r1=1053961&r2=1053962&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Thu Dec 30 18:21:48 2010
@@ -147,18 +147,26 @@ public class OperationalAttributeInterce
         MODIFY_TIMESTAMP_AT = schemaManager.getAttributeType( SchemaConstants.MODIFY_TIMESTAMP_AT );
         ENTRY_CSN_AT = schemaManager.getAttributeType( SchemaConstants.ENTRY_CSN_AT );
         
-        // Init the ApSeqNuber ATs
-        AttributeType seqNumberAT = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.ACCESS_CONTROL_SEQ_NUMBER_AT );
-        AP_SEQUENCE_NUMBER_ATTRIBUTE_TYPES.add( seqNumberAT );
-
-        seqNumberAT = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT );
-        AP_SEQUENCE_NUMBER_ATTRIBUTE_TYPES.add( seqNumberAT );
+        // Init the ApSeqNuber ATs and SubentriesUUID AT
+        AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.ACCESS_CONTROL_SEQ_NUMBER_AT );
+        AP_SEQUENCE_NUMBER_ATTRIBUTE_TYPES.add( attributeType );
+        attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.ACCESS_CONTROL_SUBENTRIES_UUID_AT );
+        SUBENTRIES_UUID_ATTRIBUTE_TYPES.add( attributeType );
+
+        attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT );
+        AP_SEQUENCE_NUMBER_ATTRIBUTE_TYPES.add( attributeType );
+        attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_UUID_AT );
+        SUBENTRIES_UUID_ATTRIBUTE_TYPES.add( attributeType );
         
-        seqNumberAT = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.SUB_SCHEMA_SEQ_NUMBER_AT );
-        AP_SEQUENCE_NUMBER_ATTRIBUTE_TYPES.add( seqNumberAT );
-
-        seqNumberAT = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.TRIGGER_EXECUTION_SEQ_NUMBER_AT );
-        AP_SEQUENCE_NUMBER_ATTRIBUTE_TYPES.add( seqNumberAT );
+        attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.SUB_SCHEMA_SEQ_NUMBER_AT );
+        AP_SEQUENCE_NUMBER_ATTRIBUTE_TYPES.add( attributeType );
+        attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.SUB_SCHEMA_SUBENTRY_UUID_AT );
+        SUBENTRIES_UUID_ATTRIBUTE_TYPES.add( attributeType );
+
+        attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.TRIGGER_EXECUTION_SEQ_NUMBER_AT );
+        AP_SEQUENCE_NUMBER_ATTRIBUTE_TYPES.add( attributeType );
+        attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_UUID_AT );
+        SUBENTRIES_UUID_ATTRIBUTE_TYPES.add( attributeType );
     }
 
 
@@ -274,6 +282,13 @@ public class OperationalAttributeInterce
                 throw new LdapSchemaViolationException( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, message );
             }
 
+            if ( SUBENTRIES_UUID_ATTRIBUTE_TYPES.contains( modification.getAttribute().getAttributeType() ) && !isAdmin )
+            {
+                String message = I18n.err( I18n.ERR_32 );
+                LOG.error( message );
+                throw new LdapSchemaViolationException( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, message );
+            }
+
             if ( PWD_POLICY_STATE_ATTRIBUTE_TYPES.contains( modification.getAttribute().getAttributeType() ) && !isAdmin )
             {
                 String message = I18n.err( I18n.ERR_32 );

Modified: directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1053962&r1=1053961&r2=1053962&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Thu Dec 30 18:21:48 2010
@@ -1049,7 +1049,8 @@ public class SchemaInterceptor extends B
                 && ( !attributeType.equals( MODIFY_TIMESTAMP_ATTRIBUTE_TYPE ) )
                 && ( !attributeType.equals( ENTRY_CSN_ATTRIBUTE_TYPE ) )
                 && ( !PWD_POLICY_STATE_ATTRIBUTE_TYPES.contains( attributeType ) )
-                && ( !AP_SEQUENCE_NUMBER_ATTRIBUTE_TYPES.contains( attributeType ) ) ) )
+                && ( !AP_SEQUENCE_NUMBER_ATTRIBUTE_TYPES.contains( attributeType ) ) ) 
+                && ( !SUBENTRIES_UUID_ATTRIBUTE_TYPES.contains( attributeType ) ) )
             {
                 String msg = I18n.err( I18n.ERR_52, attributeType );
                 LOG.error( msg );

Modified: directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=1053962&r1=1053961&r2=1053962&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Thu Dec 30 18:21:48 2010
@@ -102,7 +102,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.exception.LdapOperationErrorException;
 import org.apache.directory.shared.ldap.exception.LdapOperationException;
-import org.apache.directory.shared.ldap.exception.LdapOtherException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
@@ -160,6 +159,9 @@ public class SubentryInterceptor extends
 
     /** A reference to the ObjectClass AT */
     private static AttributeType OBJECT_CLASS_AT;
+    
+    /** A reference to the EntryUUID AT */
+    private static AttributeType ENTRY_UUID_AT;
 
     /** A reference to the AdministrativeRole AT */
     private static AttributeType ADMINISTRATIVE_ROLE_AT;
@@ -167,32 +169,25 @@ public class SubentryInterceptor extends
     /** A reference to the SubtreeSpecification AT */
     private static AttributeType SUBTREE_SPECIFICATION_AT;
 
-    /** A reference to the AccessControlSubentries AT */
+    /** A reference to the AccessControl dedicated AT */
     private static AttributeType ACCESS_CONTROL_SUBENTRIES_AT;
-
-    /** A reference to the AccessControlSubentries AT */
-    private static AttributeType SUBSCHEMA_SUBENTRY_AT;
-
-    /** A reference to the CollectiveAttributeSubentries AT */
-    private static AttributeType COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT;
-
-    /** A reference to the EntryUUID AT */
-    private static AttributeType ENTRY_UUID_AT;
-    
-    /** A reference to the TriggerExecutionSubentries AT */
-    private static AttributeType TRIGGER_EXECUTION_SUBENTRIES_AT;
-    
-    /** A reference to the AccessControl SeqNumber AT */
     private static AttributeType ACCESS_CONTROL_SEQ_NUMBER_AT;
+    private static AttributeType ACCESS_CONTROL_SUBENTRIES_UUID_AT;
 
-    /** A reference to the CollectiveAttribute SeqNumber AT */
+    /** A reference to the CollectiveAttribute dedicated AT */
+    private static AttributeType COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT;
     private static AttributeType COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT;
+    private static AttributeType COLLECTIVE_ATTRIBUTE_SUBENTRIES_UUID_AT;
 
-    /** A reference to the SubSchema SeqNumber AT */
+    /** A reference to the Subschema dedicated AT */
+    private static AttributeType SUBSCHEMA_SUBENTRY_AT;
+    private static AttributeType SUBSCHEMA_SUBENTRY_UUID_AT;
     private static AttributeType SUB_SCHEMA_SEQ_NUMBER_AT;
 
-    /** A reference to the TriggerExecution SeqNumber AT */
+    /** A reference to the TriggerExecution dedicated AT */
+    private static AttributeType TRIGGER_EXECUTION_SUBENTRIES_AT;
     private static AttributeType TRIGGER_EXECUTION_SEQ_NUMBER_AT;
+    private static AttributeType TRIGGER_EXECUTION_SUBENTRIES_UUID_AT;
 
     /** An enum used for the entries update */
     private enum OperationEnum
@@ -343,7 +338,7 @@ public class SubentryInterceptor extends
     {
         public boolean accept( SearchingOperationContext searchContext, ClonedServerEntry entry ) throws Exception
         {
-            updateSeqNumber( entry );
+            updateEntry( entry );
 
             return true;
         }
@@ -369,15 +364,23 @@ public class SubentryInterceptor extends
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
         ADMINISTRATIVE_ROLE_AT = schemaManager.getAttributeType( SchemaConstants.ADMINISTRATIVE_ROLE_AT );
         SUBTREE_SPECIFICATION_AT = schemaManager.getAttributeType( SchemaConstants.SUBTREE_SPECIFICATION_AT );
-        ACCESS_CONTROL_SUBENTRIES_AT = schemaManager.getAttributeType( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT );
-        SUBSCHEMA_SUBENTRY_AT = schemaManager.getAttributeType( SchemaConstants.SUBSCHEMA_SUBENTRY_AT );
-        COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT = schemaManager.getAttributeType( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
-        TRIGGER_EXECUTION_SUBENTRIES_AT = schemaManager.getAttributeType( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT );
         ENTRY_UUID_AT = schemaManager.getAttributeType( SchemaConstants.ENTRY_UUID_AT );
+        
         ACCESS_CONTROL_SEQ_NUMBER_AT = schemaManager.getAttributeType( ApacheSchemaConstants.ACCESS_CONTROL_SEQ_NUMBER_AT );
+        ACCESS_CONTROL_SUBENTRIES_AT = schemaManager.getAttributeType( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT );
+        ACCESS_CONTROL_SUBENTRIES_UUID_AT = schemaManager.getAttributeType( ApacheSchemaConstants.ACCESS_CONTROL_SUBENTRIES_UUID_AT );
+
         COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT = schemaManager.getAttributeType( ApacheSchemaConstants.COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT );
+        COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT = schemaManager.getAttributeType( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+        COLLECTIVE_ATTRIBUTE_SUBENTRIES_UUID_AT = schemaManager.getAttributeType( ApacheSchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_UUID_AT );
+        
         SUB_SCHEMA_SEQ_NUMBER_AT = schemaManager.getAttributeType( ApacheSchemaConstants.SUB_SCHEMA_SEQ_NUMBER_AT );
+        SUBSCHEMA_SUBENTRY_AT = schemaManager.getAttributeType( SchemaConstants.SUB_SCHEMA_SUBENTRY_AT );
+        SUBSCHEMA_SUBENTRY_UUID_AT = schemaManager.getAttributeType( ApacheSchemaConstants.SUB_SCHEMA_SUBENTRY_UUID_AT );
+        
         TRIGGER_EXECUTION_SEQ_NUMBER_AT = schemaManager.getAttributeType( ApacheSchemaConstants.TRIGGER_EXECUTION_SEQ_NUMBER_AT );
+        TRIGGER_EXECUTION_SUBENTRIES_AT = schemaManager.getAttributeType( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT );
+        TRIGGER_EXECUTION_SUBENTRIES_UUID_AT = schemaManager.getAttributeType( ApacheSchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_UUID_AT );
 
         SUBENTRY_OPATTRS = new AttributeType[]
             {
@@ -521,35 +524,35 @@ public class SubentryInterceptor extends
      * Update the seqNumber for each kind of role. The entry will be updated in the backend only
      * if its seqNumbers are not up to date.
      */
-    private boolean updateSeqNumber( Entry entry ) throws LdapException
+    private boolean updateEntry( Entry entry ) throws LdapException
     {
-        Modification modificationAc = updateACSeqNumber( entry );
-        Modification modificationCa = updateCASeqNumber( entry );
-        Modification modificationSs = updateSSSeqNumber( entry );
-        Modification modificationTe = updateTESeqNumber( entry );
+        List<Modification> modificationAcs = updateEntry( entry, directoryService.getAccessControlAPCache(), ACCESS_CONTROL_SEQ_NUMBER_AT, ACCESS_CONTROL_SUBENTRIES_UUID_AT );
+        List<Modification> modificationCas = updateEntry( entry, directoryService.getCollectiveAttributeAPCache(), COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT, COLLECTIVE_ATTRIBUTE_SUBENTRIES_UUID_AT );
+        List<Modification> modificationSss = updateEntry( entry, directoryService.getSubschemaAPCache(), SUB_SCHEMA_SEQ_NUMBER_AT, SUBSCHEMA_SUBENTRY_UUID_AT );
+        List<Modification> modificationTes = updateEntry( entry, directoryService.getTriggerExecutionAPCache(), TRIGGER_EXECUTION_SEQ_NUMBER_AT, TRIGGER_EXECUTION_SUBENTRIES_UUID_AT );
         
-        if ( ( modificationAc != null ) || ( modificationCa != null ) || ( modificationSs != null ) || (modificationTe != null ) )
+        if ( ( modificationAcs != null ) || ( modificationCas != null ) || ( modificationSss != null ) || (modificationTes != null ) )
         {
             List<Modification> modifications = new ArrayList<Modification>();
             
-            if ( modificationAc != null )
+            if ( modificationAcs != null )
             {
-                modifications.add( modificationAc );
+                modifications.addAll( modificationAcs );
             }
             
-            if ( modificationCa != null )
+            if ( modificationCas != null )
             {
-                modifications.add( modificationCa );
+                modifications.addAll( modificationCas );
             }
             
-            if ( modificationSs != null )
+            if ( modificationSss != null )
             {
-                modifications.add( modificationSs );
+                modifications.addAll( modificationSss );
             }
             
-            if ( modificationTe != null )
+            if ( modificationTes != null )
             {
-                modifications.add( modificationTe );
+                modifications.addAll( modificationTes );
             }
             
             ModifyOperationContext modCtx = new ModifyOperationContext( directoryService.getAdminSession() );
@@ -568,384 +571,93 @@ public class SubentryInterceptor extends
 
     
     /**
-     * Update the AccessControl seqNumber for each kind of role. The entry will be updated in the backend only
-     * if its seqNumbers are not up to date.
-     */
-    private Modification updateACSeqNumber( Entry entry ) throws LdapException
-    {
-        DN entryDn = entry.getDn();
-        EntryAttribute newAcSeqNumberAT = null;
-        Modification modificationAc = null;
-
-        DnNode<AdministrativePoint> apNode = directoryService.getAccessControlAPCache().getParentWithElement( entryDn );
-        
-        if ( apNode != null )
-        {
-            AdministrativePoint adminPoint = apNode.getElement();
-            EntryAttribute acSeqNumberAT = entry.get( ACCESS_CONTROL_SEQ_NUMBER_AT );
-
-            if ( adminPoint.isSpecific() )
-            {
-                long apSeqNumber = adminPoint.getSeqNumber();
-                
-                if ( acSeqNumberAT != null )
-                {
-                    if ( apSeqNumber != Long.parseLong( acSeqNumberAT.getString() ) )
-                    {
-                        // The seqNumber is not up to date, we have to update it
-                        newAcSeqNumberAT = new DefaultEntryAttribute( ACCESS_CONTROL_SEQ_NUMBER_AT, Long.toString( apSeqNumber ) );
-                        modificationAc = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, newAcSeqNumberAT );
-                    }
-                }
-                else
-                {
-                    // We have to add a seqNumber in the entry
-                    newAcSeqNumberAT = new DefaultEntryAttribute( ACCESS_CONTROL_SEQ_NUMBER_AT, Long.toString( apSeqNumber ) );
-                    modificationAc = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, newAcSeqNumberAT );
-                }
-            }
-            else
-            {
-                // We have to recurse : starting from the IAP, we go up the AP tree
-                // until we find the SAP. For each AP we find, we compare the AP's seqNumber
-                // and if it's above the current SeqNumber (initialized to the entry value),
-                // we select this SeqNumber. When we are done, if the selected SeqNumber is
-                // greater than the initial entry seqNumber, then we update the entry
-                
-                // First, init the entry seqNumber. If we have no AT, then we initialize it to -1
-                long entrySeqNumber = -1L;
-                
-                if ( acSeqNumberAT != null )
-                {
-                    entrySeqNumber = Long.parseLong( acSeqNumberAT.getString() );
-                }
-                
-                boolean sapFound = false;
-                boolean seqNumberUpdated = false;
-
-                do
-                {
-                    if ( adminPoint.isSpecific() )
-                    {
-                        sapFound = true;
-                    }
-                    
-                    if ( entrySeqNumber < adminPoint.getSeqNumber() )
-                    {
-                        // Evaluate the current AP on the entry for each subentry
-                        for ( Subentry subentry : adminPoint.getSubentries() )
-                        {
-                            if ( evaluator.evaluate( subentry.getSubtreeSpecification(), apNode.getDn(), entryDn, entry ) )
-                            {
-                                entrySeqNumber = adminPoint.getSeqNumber();
-                                seqNumberUpdated = true;
-                                
-                                // No need to evaluate another subentry
-                                break;
-                            }
-                        }
-                    }
-                    
-                    // Go down one level
-                    apNode = apNode.getParentWithElement( apNode.getDn() );
-                } while ( !sapFound );
-                
-                if ( seqNumberUpdated )
-                {
-                    newAcSeqNumberAT = new DefaultEntryAttribute( ACCESS_CONTROL_SEQ_NUMBER_AT, Long.toString( entrySeqNumber ) );
-                    modificationAc = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, newAcSeqNumberAT );
-                }
-            }
-        }
-        
-        return modificationAc;
-    }
-    
-
-    
-    /**
      * Update the CollectiveAttribute seqNumber for each kind of role. The entry will be updated in the backend only
      * if its seqNumbers are not up to date.
      */
-    private Modification updateCASeqNumber( Entry entry ) throws LdapException
+    private List<Modification> updateEntry( Entry entry, DnNode<AdministrativePoint> apCache, AttributeType seqNumberAT,
+                AttributeType subentryUuidAT ) throws LdapException
     {
         DN entryDn = entry.getDn();
-        EntryAttribute newCaSeqNumberAT = null;
-        Modification modificationCa = null;
+        List<Modification> modifications = null;
         
-        DnNode<AdministrativePoint> apNode = directoryService.getCollectiveAttributeAPCache().getParentWithElement( entryDn );
+        
+        DnNode<AdministrativePoint> apNode = apCache.getParentWithElement( entryDn );
         
         if ( apNode != null )
         {
+            // We have an AdministrativePoint for this entry, get its SeqNumber
             AdministrativePoint adminPoint = apNode.getElement();
-            EntryAttribute caSeqNumberAT = entry.get( COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT );
+            EntryAttribute seqNumberAttribute = entry.get( seqNumberAT );
 
-            if ( adminPoint.isSpecific() )
+            // We have to recurse : starting from the IAP, we go up the AP tree
+            // until we find the SAP. For each AP we find, we compare the AP's seqNumber
+            // and if it's above the current SeqNumber (initialized to the entry value),
+            // we select this SeqNumber. When we are done, if the selected SeqNumber is
+            // greater than the initial entry seqNumber, then we update the entry
+            
+            // First, init the entry seqNumber. If we have no AT, then we initialize it to -1
+            long entrySeqNumber = Long.MIN_VALUE;
+            
+            if ( seqNumberAttribute != null )
             {
-                long apSeqNumber = adminPoint.getSeqNumber();
-                
-                if ( caSeqNumberAT != null )
-                {
-                    if ( apSeqNumber != Long.parseLong( caSeqNumberAT.getString() ) )
-                    {
-                        // The seqNumber is not up to date, we have to update it
-                        newCaSeqNumberAT = new DefaultEntryAttribute( COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT, Long.toString( apSeqNumber ) );
-                        modificationCa = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, newCaSeqNumberAT );
-                    }
-                }
-                else
-                {
-                    // We have to add a seqNumber in the entry
-                    newCaSeqNumberAT = new DefaultEntryAttribute( COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT, Long.toString( apSeqNumber ) );
-                    modificationCa = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, newCaSeqNumberAT );
-                }
+                entrySeqNumber = Long.parseLong( seqNumberAttribute.getString() );
             }
-            else
+            
+            boolean sapFound = false;
+            boolean seqNumberUpdated = false;
+            List<String> subentryUuids = null;
+
+            do
             {
-                // We have to recurse : starting from the IAP, we go up the AP tree
-                // until we find the SAP. For each AP we find, we compare the AP's seqNumber
-                // and if it's above the current SeqNumber (initialized to the entry value),
-                // we select this SeqNumber. When we are done, if the selected SeqNumber is
-                // greater than the initial entry seqNumber, then we update the entry
-                
-                // First, init the entry seqNumber. If we have no AT, then we initialize it to -1
-                long entrySeqNumber = -1L;
-                
-                if ( caSeqNumberAT != null )
+                if ( adminPoint.isSpecific() )
                 {
-                    entrySeqNumber = Long.parseLong( caSeqNumberAT.getString() );
+                    sapFound = true;
                 }
                 
-                boolean sapFound = false;
-                boolean seqNumberUpdated = false;
-
-                do
+                if ( entrySeqNumber < adminPoint.getSeqNumber() )
                 {
-                    if ( adminPoint.isSpecific() )
-                    {
-                        sapFound = true;
-                    }
-                    
-                    if ( entrySeqNumber < adminPoint.getSeqNumber() )
+                    seqNumberUpdated = true;
+                    subentryUuids = new ArrayList<String>();
+                    entrySeqNumber = adminPoint.getSeqNumber();
+
+                    // Evaluate the current AP on the entry for each subentry
+                    for ( Subentry subentry : adminPoint.getSubentries() )
                     {
-                        // Evaluate the current AP on the entry for each subentry
-                        for ( Subentry subentry : adminPoint.getSubentries() )
+                        if ( evaluator.evaluate( subentry.getSubtreeSpecification(), apNode.getDn(), entryDn, entry ) )
                         {
-                            if ( evaluator.evaluate( subentry.getSubtreeSpecification(), apNode.getDn(), entryDn, entry ) )
-                            {
-                                entrySeqNumber = adminPoint.getSeqNumber();
-                                seqNumberUpdated = true;
-                                
-                                // No need to evaluate another subentry
-                                break;
-                            }
+                            subentryUuids.add( subentry.getUuid() ); 
                         }
                     }
-                    
-                    // Go down one level
-                    apNode = apNode.getParentWithElement( apNode.getDn() );
-                } while ( !sapFound );
-                
-                if ( seqNumberUpdated )
-                {
-                    newCaSeqNumberAT = new DefaultEntryAttribute( COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT, Long.toString( entrySeqNumber ) );
-                    modificationCa = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, newCaSeqNumberAT );
                 }
-            }
-        }
-
-        return modificationCa;
-    }
-
-    
-    /**
-     * Update the SubSchema seqNumber for each kind of role. The entry will be updated in the backend only
-     * if its seqNumbers are not up to date.
-     */
-    private Modification updateSSSeqNumber( Entry entry ) throws LdapException
-    {
-        DN entryDn = entry.getDn();
-        EntryAttribute newSsSeqNumberAT = null;
-        Modification modificationSs = null;
-        
-        DnNode<AdministrativePoint> apNode = directoryService.getSubschemaAPCache().getParentWithElement( entryDn );
-        
-        if ( apNode != null )
-        {
-            AdministrativePoint adminPoint = apNode.getElement();
-            EntryAttribute ssSeqNumberAT = entry.get( SUB_SCHEMA_SEQ_NUMBER_AT );
-
-            long apSeqNumber = adminPoint.getSeqNumber();
+                
+                // Go down one level
+                apNode = apNode.getParentWithElement( apNode.getDn() );
+            } while ( !sapFound );
             
-            if ( ssSeqNumberAT != null )
-            {
-                if ( apSeqNumber != Long.parseLong( ssSeqNumberAT.getString() ) )
-                {
-                    // The seqNumber is not up to date, we have to update it
-                    newSsSeqNumberAT = new DefaultEntryAttribute( SUB_SCHEMA_SEQ_NUMBER_AT, Long.toString( apSeqNumber ) );
-                    modificationSs = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, newSsSeqNumberAT );
-                }
-            }
-            else
-            {
-                // We have to add a seqNumber in the entry
-                newSsSeqNumberAT = new DefaultEntryAttribute( SUB_SCHEMA_SEQ_NUMBER_AT, Long.toString( apSeqNumber ) );
-                modificationSs = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, newSsSeqNumberAT );
-            }
-        }
-
-        return modificationSs;
-    }
-
-    
-    /**
-     * Update the TriggerExecution seqNumber for each kind of role. The entry will be updated in the backend only
-     * if its seqNumbers are not up to date.
-     */
-    private Modification updateTESeqNumber( Entry entry ) throws LdapException
-    {
-        DN entryDn = entry.getDn();
-        EntryAttribute newTeSeqNumberAT = null;
-        Modification modificationTe = null;
-        
-        DnNode<AdministrativePoint> apNode = directoryService.getTriggerExecutionAPCache().getParentWithElement( entryDn );
-        
-        if ( apNode != null )
-        {
-            AdministrativePoint adminPoint = apNode.getElement();
-            EntryAttribute teSeqNumberAT = entry.get( TRIGGER_EXECUTION_SEQ_NUMBER_AT );
-
-            if ( adminPoint.isSpecific() )
+            // If we have updated the entry, create the list of modifications to apply
+            if ( seqNumberUpdated )
             {
-                long apSeqNumber = adminPoint.getSeqNumber();
+                // Create the list of modifications : we will inject REPLACE operations. 
+                modifications = new ArrayList<Modification>();
                 
-                if ( teSeqNumberAT != null )
-                {
-                    if ( apSeqNumber != Long.parseLong( teSeqNumberAT.getString() ) )
-                    {
-                        // The seqNumber is not up to date, we have to update it
-                        newTeSeqNumberAT = new DefaultEntryAttribute( TRIGGER_EXECUTION_SEQ_NUMBER_AT, Long.toString( apSeqNumber ) );
-                        modificationTe = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, newTeSeqNumberAT );
-                    }
-                }
-                else
-                {
-                    // We have to add a seqNumber in the entry
-                    newTeSeqNumberAT = new DefaultEntryAttribute( TRIGGER_EXECUTION_SEQ_NUMBER_AT, Long.toString( apSeqNumber ) );
-                    modificationTe = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, newTeSeqNumberAT );
-                }
-            }
-            else
-            {
-                // We have to recurse : starting from the IAP, we go up the AP tree
-                // until we find the SAP. For each AP we find, we compare the AP's seqNumber
-                // and if it's above the current SeqNumber (initialized to the entry value),
-                // we select this SeqNumber. When we are done, if the selected SeqNumber is
-                // greater than the initial entry seqNumber, then we update the entry
+                // The seqNubmer
+                EntryAttribute newSeqNumberAT = new DefaultEntryAttribute( seqNumberAT, Long.toString( entrySeqNumber ) );
+                Modification seqNumberModification = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, newSeqNumberAT );
                 
-                // First, init the entry seqNumber. If we have no AT, then we initialize it to -1
-                long entrySeqNumber = -1L;
+                modifications.add( seqNumberModification );
                 
-                if ( teSeqNumberAT != null )
+                // The subentry UUID, if any
+                if ( ( subentryUuids != null ) && ( subentryUuids.size() != 0 ) )
                 {
-                    entrySeqNumber = Long.parseLong( teSeqNumberAT.getString() );
-                }
-                
-                boolean sapFound = false;
-                boolean seqNumberUpdated = false;
+                    EntryAttribute newSubentryUuidAT = new DefaultEntryAttribute( subentryUuidAT, subentryUuids.toArray( new String[]{} ) );
+                    Modification subentryUuiMod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, newSubentryUuidAT );
 
-                do
-                {
-                    if ( adminPoint.isSpecific() )
-                    {
-                        sapFound = true;
-                    }
-                    
-                    if ( entrySeqNumber < adminPoint.getSeqNumber() )
-                    {
-                        // Evaluate the current AP on the entry for each subentry
-                        for ( Subentry subentry : adminPoint.getSubentries() )
-                        {
-                            if ( evaluator.evaluate( subentry.getSubtreeSpecification(), apNode.getDn(), entryDn, entry ) )
-                            {
-                                entrySeqNumber = adminPoint.getSeqNumber();
-                                seqNumberUpdated = true;
-                                
-                                // No need to evaluate another subentry
-                                break;
-                            }
-                        }
-                    }
-                    
-                    // Go down one level
-                    apNode = apNode.getParentWithElement( apNode.getDn() );
-                } while ( !sapFound );
-                
-                if ( seqNumberUpdated )
-                {
-                    newTeSeqNumberAT = new DefaultEntryAttribute( TRIGGER_EXECUTION_SEQ_NUMBER_AT, Long.toString( entrySeqNumber ) );
-                    modificationTe = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, newTeSeqNumberAT );
+                    modifications.add( subentryUuiMod );
                 }
             }
         }
 
-        return modificationTe;
-    }
-
-    /**
-     * Update all the entries under an AP adding the
-     */
-    private void updateEntries( OperationEnum operation, CoreSession session, DN subentryDn, DN apDn, SubtreeSpecification ss, DN baseDn, List<EntryAttribute> operationalAttributes  ) throws LdapException
-    {
-        ExprNode filter = new PresenceNode( OBJECT_CLASS_AT ); // (objectClass=*)
-        SearchControls controls = new SearchControls();
-        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-        controls.setReturningAttributes( new String[]
-            { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
-
-        SearchOperationContext searchOperationContext = new SearchOperationContext( session,
-            baseDn, filter, controls );
-        searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES );
-
-        EntryFilteringCursor subentries = nexus.search( searchOperationContext );
-
-        try
-        {
-            while ( subentries.next() )
-            {
-                Entry candidate = subentries.get();
-                DN candidateDn = candidate.getDn();
-
-                if ( evaluator.evaluate( ss, apDn, candidateDn, candidate ) )
-                {
-                    List<Modification> modifications = null;
-
-                    switch ( operation )
-                    {
-                        case ADD :
-                            modifications = getOperationalModsForAdd( candidate, operationalAttributes );
-                            break;
-
-                        case REMOVE :
-                            modifications = getOperationalModsForRemove( subentryDn, candidate );
-                            break;
-
-                            /*
-                        case REPLACE :
-                            modifications = getOperationalModsForReplace( subentryDn, candidate );
-                            break;
-                            */
-                    }
-
-                    LOG.debug( "The entry {} has been evaluated to true for subentry {}", candidate.getDn(), subentryDn );
-                    nexus.modify( new ModifyOperationContext( session, candidateDn, modifications ) );
-                }
-            }
-        }
-        catch ( Exception e )
-        {
-            throw new LdapOtherException( e.getMessage() );
-        }
+        return modifications;
     }
 
 
@@ -961,23 +673,6 @@ public class SubentryInterceptor extends
 
 
     /**
-     * Check that a subentry has the same role than it's parent AP
-     *
-    private void checkAdministrativeRole( Entry entry, DN apDn ) throws LdapException
-    {
-        // The administrativeRole AT must exist and not be null
-        EntryAttribute administrativeRole = administrationPoint.get( ADMINISTRATIVE_ROLE_AT );
-
-        // check that administrativeRole has something valid in it for us
-        if ( ( administrativeRole == null ) || ( administrativeRole.size() <= 0 ) )
-        {
-            LOG.error( "The entry on {} is not an AdministrativePoint", apDn );
-            throw new LdapNoSuchAttributeException( I18n.err( I18n.ERR_306, apDn ) );
-        }
-    }
-
-
-    /**
      * Get the SubtreeSpecification, parse it and stores it into the subentry
      */
     private void setSubtreeSpecification( Subentry subentry, Entry entry ) throws LdapException
@@ -1743,23 +1438,6 @@ public class SubentryInterceptor extends
 
 
     /**
-     * Update the Operational Attribute with the reference to the subentry
-     */
-    private void setOperationalAttribute( Entry entry, DN subentryDn, AttributeType opAttr) throws LdapException
-    {
-        EntryAttribute operational = entry.get( opAttr );
-
-        if ( operational == null )
-        {
-            operational = new DefaultEntryAttribute( opAttr );
-            entry.put( operational );
-        }
-
-        operational.add( subentryDn.getNormName() );
-    }
-
-
-    /**
      * Get a read-lock on the AP cache.
      * No read operation can be done on the AP cache if this
      * method is not called before.
@@ -1915,66 +1593,6 @@ public class SubentryInterceptor extends
         directoryService.getSubschemaAPCache().remove( dn );
         // If it's an AAP, we can get out immediately
         return;
-
-        /*
-        if ( isAAP( adminPoint ) )
-        {
-            // The AC AAP
-            directoryService.getAccessControlAPCache().remove( dn );
-
-            // The CA AAP
-            directoryService.getCollectiveAttributeAPCache().remove( dn );
-
-            // The TE AAP
-            directoryService.getTriggerExecutionAPCache().remove( dn );
-
-            // The SS AAP
-            directoryService.getSubschemaAPCache().remove( dn );
-
-            // If it's an AAP, we can get out immediately
-            return;
-        }
-
-        // Not an AAP
-        for ( Value<?> value : adminPoint )
-        {
-            String role = value.getString();
-
-            // Deal with AccessControl AP
-            if ( isAccessControlSpecificRole( role ) || isAccessControlInnerRole( role ) )
-            {
-                directoryService.getAccessControlAPCache().remove( dn );
-
-                continue;
-            }
-
-            // Deal with CollectiveAttribute AP
-            if ( isCollectiveAttributeSpecificRole( role ) || isCollectiveAttributeInnerRole( role ) )
-            {
-                directoryService.getCollectiveAttributeAPCache().remove( dn );
-
-                continue;
-            }
-
-            // Deal with SubSchema AP
-            if ( isSubschemaSpecficRole( role ) )
-            {
-                directoryService.getSubschemaAPCache().remove( dn );
-
-                continue;
-            }
-
-            // Deal with TriggerExecution AP
-            if ( isTriggerExecutionSpecificRole( role ) || isTriggerExecutionInnerRole( role ) )
-            {
-                directoryService.getTriggerExecutionAPCache().remove( dn );
-
-                continue;
-            }
-        }
-
-        return;
-        */
     }
     
     
@@ -2058,9 +1676,9 @@ public class SubentryInterceptor extends
     
     
     /**
-     * Inject a new seqNumber in an AP
+     * Inject the seqNumbers in an AP
      */
-    private long updateSeqNumber( DN apDn, Set<AdministrativeRoleEnum> subentryRoles ) throws LdapException
+    private long updateAPSeqNumbers( DN apDn, Set<AdministrativeRoleEnum> subentryRoles ) throws LdapException
     {
         long seqNumber = directoryService.getNewApSeqNumber();
         String seqNumberStr = Long.toString( seqNumber );
@@ -2092,7 +1710,6 @@ public class SubentryInterceptor extends
             
             Modification modification = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, newSeqNumber );
             modifications.add( modification );
-            
         }
         
         ModifyOperationContext modCtx = new ModifyOperationContext( directoryService.getAdminSession() );
@@ -2107,155 +1724,44 @@ public class SubentryInterceptor extends
     
     
     /**
-     * Process the addition of a standard entry
+     * Process the addition of a standard entry, adding the SeqNumber and references
+     * to the subentries.
      */
-    private void processAddEntry( AdministrativeRoleEnum role, Entry entry ) throws LdapException
+    private void processAddEntry( Entry entry ) throws LdapException
     {
-        DN dn = entry.getDn();
+        List<Modification> modificationAcs = updateEntry( entry, directoryService.getAccessControlAPCache(), ACCESS_CONTROL_SEQ_NUMBER_AT, ACCESS_CONTROL_SUBENTRIES_UUID_AT );
+        List<Modification> modificationCas = updateEntry( entry, directoryService.getCollectiveAttributeAPCache(), COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT, COLLECTIVE_ATTRIBUTE_SUBENTRIES_UUID_AT );
+        List<Modification> modificationSss = updateEntry( entry, directoryService.getSubschemaAPCache(), SUB_SCHEMA_SEQ_NUMBER_AT, SUBSCHEMA_SUBENTRY_UUID_AT );
+        List<Modification> modificationTes = updateEntry( entry, directoryService.getTriggerExecutionAPCache(), TRIGGER_EXECUTION_SEQ_NUMBER_AT, TRIGGER_EXECUTION_SUBENTRIES_UUID_AT );
         
-        // first get the parent AP for this entry
-        switch ( role )
+        if ( ( modificationAcs != null ) || ( modificationCas != null ) || ( modificationSss != null ) || (modificationTes != null ) )
         {
-            case AccessControl :
-                DnNode<AdministrativePoint> nodeAP = directoryService.getAccessControlAPCache().getParentWithElement( dn );
-                
-                if ( nodeAP != null )
-                {
-                    AdministrativePoint parentAP = nodeAP.getElement();
-    
-                    if ( parentAP != null )
-                    {
-                        // Update the entry seqNumber for AC
-                        entry.put( ApacheSchemaConstants.ACCESS_CONTROL_SEQ_NUMBER_AT, Long.toString( parentAP.getSeqNumber() ) );
-                        
-                        // This entry has a AccessControl AP parent.
-                        Set<Subentry> subentries = parentAP.getSubentries();
-    
-                        if ( subentries != null )
-                        {
-                            for ( Subentry subentry : subentries )
-                            {
-                                SubtreeSpecification ss = subentry.getSubtreeSpecification();
-        
-                                // Now, evaluate the entry wrt the subentry ss
-                                // and inject a ref to the subentry if it evaluates to true
-                                if ( evaluator.evaluate( ss, nodeAP.getDn(), dn, entry ) )
-                                {
-                                    // Point to the subentry UUID
-                                    entry.add( ApacheSchemaConstants.ACCESS_CONTROL_SUBENTRIES_UUID_AT, subentry.getUuid() );
-                                }
-                            }
-                        }
-                    }
-                }
-                
-                break;
-
-            case CollectiveAttribute :
-                nodeAP = directoryService.getCollectiveAttributeAPCache().getParentWithElement( dn );
-
-                if ( nodeAP != null )
-                {
-                    AdministrativePoint parentAP = nodeAP.getElement();
-    
-                    if ( parentAP != null )
-                    {
-                        // Update the entry seqNumber for CA
-                        entry.put( ApacheSchemaConstants.COLLECTIVE_ATTRIBUTE_SEQ_NUMBER_AT, Long.toString( parentAP.getSeqNumber() ) );
-                        
-                        // This entry has a CollectiveAttribute AP parent.
-                        Set<Subentry> subentries = parentAP.getSubentries();
-    
-                        if ( subentries != null )
-                        {
-                            for ( Subentry subentry : subentries )
-                            {
-                                SubtreeSpecification ss = subentry.getSubtreeSpecification();
-        
-                                // Now, evaluate the entry wrt the subentry ss
-                                // and inject a ref to the subentry if it evaluates to true
-                                if ( evaluator.evaluate( ss, nodeAP.getDn(), dn, entry ) )
-                                {
-                                    // Point to the subentry UUID
-                                    entry.add( ApacheSchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_UUID_AT, subentry.getUuid() );
-                                }
-                            }
-                        }
-                    }
-                }
-                
-                break;
-
-            case SubSchema :
-                nodeAP = directoryService.getSubschemaAPCache().getParentWithElement( dn );
-
-                if ( nodeAP != null )
-                {
-                    AdministrativePoint parentAP = nodeAP.getElement();
-    
-                    if ( parentAP != null )
-                    {
-                        // This entry has a Subschema AP parent.
-                        // Update the entry seqNumber for CA
-                        entry.put( ApacheSchemaConstants.SUB_SCHEMA_SEQ_NUMBER_AT, Long.toString( parentAP.getSeqNumber() ) );
-                        
-                        // This entry has a CollectiveAttribute AP parent.
-                        Set<Subentry> subentries = parentAP.getSubentries();
-    
-                        if ( subentries != null )
-                        {
-                            for ( Subentry subentry : subentries )
-                            {
-                                SubtreeSpecification ss = subentry.getSubtreeSpecification();
-        
-                                // Now, evaluate the entry wrt the subentry ss
-                                // and inject a ref to the subentry if it evaluates to true
-                                if ( evaluator.evaluate( ss, nodeAP.getDn(), dn, entry ) )
-                                {
-                                    // Point to the subentry UUID
-                                    entry.add( ApacheSchemaConstants.SUB_SCHEMA_SUBENTRY_UUID_AT, subentry.getUuid() );
-                                }
-                            }
-                        }
-                    }
-                }
-                
-                break;
-
-            case TriggerExecution :
-                nodeAP = directoryService.getTriggerExecutionAPCache().getParentWithElement( dn );
-
-                if ( nodeAP != null )
-                {
-                    AdministrativePoint parentAP = nodeAP.getElement();
-    
-                    if ( parentAP != null )
-                    {
-                        // Update the entry seqNumber for TE
-                        entry.put( ApacheSchemaConstants.TRIGGER_EXECUTION_SEQ_NUMBER_AT, Long.toString( parentAP.getSeqNumber() ) );
-                        
-                        // This entry has a TriggerExecution AP parent.
-                        Set<Subentry> subentries = parentAP.getSubentries();
-    
-                        if ( subentries != null )
-                        {
-                            for ( Subentry subentry : subentries )
-                            {
-                                SubtreeSpecification ss = subentry.getSubtreeSpecification();
-        
-                                // Now, evaluate the entry wrt the subentry ss
-                                // and inject a ref to the subentry if it evaluates to true
-                                if ( evaluator.evaluate( ss, nodeAP.getDn(), dn, entry ) )
-                                {
-                                    // Point to the subentry UUID
-                                    entry.add( ApacheSchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_UUID_AT, subentry.getUuid() );
-                                }
-                            }
-                        }
-                    }
-                }
-                
-                break;
+            List<Modification> modifications = new ArrayList<Modification>();
+            
+            if ( modificationAcs != null )
+            {
+                modifications.addAll( modificationAcs );
+            }
+            
+            if ( modificationCas != null )
+            {
+                modifications.addAll( modificationCas );
+            }
+            
+            if ( modificationSss != null )
+            {
+                modifications.addAll( modificationSss );
+            }
+            
+            if ( modificationTes != null )
+            {
+                modifications.addAll( modificationTes );
+            }
+            
+            for ( Modification modification : modifications )
+            {
+                entry.add( modification.getAttribute() );
+            }
         }
     }
     
@@ -2482,7 +1988,7 @@ public class SubentryInterceptor extends
                 subentryCache.addSubentry( dn, subentry );
 
                 // Update the seqNumber and update the parent AP
-                long seqNumber = updateSeqNumber( apDn, subentryRoles );
+                long seqNumber = updateAPSeqNumbers( apDn, subentryRoles );
     
                 // Now inject the subentry into the backend
                 next.add( addContext );
@@ -2506,10 +2012,7 @@ public class SubentryInterceptor extends
         {
             // The added entry is a normal entry
             // We have to process the addition for each role
-            processAddEntry( AdministrativeRoleEnum.AccessControl, entry );
-            processAddEntry( AdministrativeRoleEnum.CollectiveAttribute, entry );
-            processAddEntry( AdministrativeRoleEnum.TriggerExecution, entry );
-            processAddEntry( AdministrativeRoleEnum.SubSchema, entry );
+            processAddEntry( entry );
 
             // Propagate the addition down to the backend.
             next.add( addContext );
@@ -2576,7 +2079,7 @@ public class SubentryInterceptor extends
             
             // And finally, update the parent AP SeqNumber for each role the subentry manage
             Set<AdministrativeRoleEnum> subentryRoles = removedSubentry.getAdministrativeRoles();
-            updateSeqNumber( apDn, subentryRoles );
+            updateAPSeqNumbers( apDn, subentryRoles );
         }
         else
         {
@@ -2606,7 +2109,7 @@ public class SubentryInterceptor extends
         }
         
         // This is a normal entry, update its seqNumbers if neede
-        if ( updateSeqNumber( entry ) )
+        if ( updateEntry( entry ) )
         {
             // Get the entry back again
             entry = nextInterceptor.lookup( lookupContext );



Mime
View raw message