directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1053086 - in /directory/apacheds/branches/apacheds-AP: core-api/src/main/java/org/apache/directory/server/core/administrative/ core/src/main/java/org/apache/directory/server/core/admin/ core/src/main/java/org/apache/directory/server/core/s...
Date Mon, 27 Dec 2010 15:28:21 GMT
Author: elecharny
Date: Mon Dec 27 15:28:20 2010
New Revision: 1053086

URL: http://svn.apache.org/viewvc?rev=1053086&view=rev
Log:
o Removed the DN from the AdministrativePoint data structure
o Updated the Javadoc for the AP classes
o Removed some useless code from the AdministartivePointInterceptor
o Fixed some code in the SubentryInterceptor

Modified:
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AbstractAdministrativePoint.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlAAP.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlAdministrativePoint.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlIAP.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlSAP.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AdministrativePoint.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AutonomousAdministrativePoint.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeAAP.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeAdministrativePoint.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeIAP.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeSAP.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaAAP.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaAdministrativePoint.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaSAP.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionAAP.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionAdministrativePoint.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionIAP.java
    directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionSAP.java
    directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.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/administrative/AbstractAdministrativePoint.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AbstractAdministrativePoint.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AbstractAdministrativePoint.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AbstractAdministrativePoint.java Mon Dec 27 15:28:20 2010
@@ -25,7 +25,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -36,9 +35,6 @@ import org.apache.directory.shared.ldap.
  */
 public abstract class AbstractAdministrativePoint implements AdministrativePoint
 {
-    /** The AP's DN */
-    protected DN dn;
-
     /** The AP's UUID */
     protected String uuid;
     
@@ -60,10 +56,13 @@ public abstract class AbstractAdministra
 
     /**
      * Creates a new instance of AbstractAdministrativePoint.
+     * 
+     * @param uuid the AdministrativePoint UUID
+     * @param role the AdministrativePoint role
+     * @param seqNumber the associated Sequence Number
      */
-    protected AbstractAdministrativePoint( DN dn, String uuid, AdministrativeRole role, long seqNumber )
+    protected AbstractAdministrativePoint( String uuid, AdministrativeRole role, long seqNumber )
     {
-        this.dn = dn;
         this.uuid = uuid;
         this.role = role;
         this.children = new ConcurrentHashMap<String, AdministrativePoint>();
@@ -84,15 +83,6 @@ public abstract class AbstractAdministra
     /**
      * {@inheritDoc}
      */
-    public DN getDn()
-    {
-        return dn;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public String getUuid()
     {
         return uuid;
@@ -172,6 +162,18 @@ public abstract class AbstractAdministra
     /**
      * {@inheritDoc}
      */
+    public void deleteSubentry( Subentry subentry )
+    {
+        synchronized( subentries )
+        {
+            subentries.remove( subentry );
+        }
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
     public Set<Subentry> getSubentries( AdministrativeRole role )
     {
         synchronized( subentries )
@@ -211,7 +213,6 @@ public abstract class AbstractAdministra
         StringBuilder sb = new StringBuilder();
 
         sb.append( "Role: '" ).append( role ).append( "', " );
-        sb.append( "DN: '" ).append( dn ).append( "', " );
         sb.append( "UUID: " ).append( uuid ).append( ", " );
         sb.append( "SeqNumber: " ).append( seqNumber ).append( '\n' );
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlAAP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlAAP.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlAAP.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlAAP.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -34,12 +33,12 @@ public class AccessControlAAP extends Ac
     /**
      * Create an instance of AccessControl AdministrativePoint
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public AccessControlAAP( DN dn, String uuid, long seqNumber )
+    public AccessControlAAP( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.AccessControlSpecificArea, seqNumber );
+        super( uuid, AdministrativeRole.AccessControlSpecificArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlAdministrativePoint.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlAdministrativePoint.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlAdministrativePoint.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlAdministrativePoint.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -35,12 +34,12 @@ public abstract class AccessControlAdmin
     /**
      * Create an instance of AccessControlAdministrativePoint
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
      * @param role The AdministrativePoint role
+     * @param seqNumber the associated Sequence Number
      */
-    protected AccessControlAdministrativePoint( DN dn, String uuid, AdministrativeRole role, long seqNumber )
+    protected AccessControlAdministrativePoint( String uuid, AdministrativeRole role, long seqNumber )
     {
-        super( dn, uuid, role, seqNumber );
+        super( uuid, role, seqNumber );
     }
 }

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlIAP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlIAP.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlIAP.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlIAP.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -34,12 +33,12 @@ public class AccessControlIAP extends Ac
     /**
      * Create an instance of AccessControl IAP
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public AccessControlIAP( DN dn, String uuid, long seqNumber )
+    public AccessControlIAP( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.AccessControlInnerArea, seqNumber );
+        super( uuid, AdministrativeRole.AccessControlInnerArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlSAP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlSAP.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlSAP.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AccessControlSAP.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -35,12 +34,12 @@ public class AccessControlSAP extends Ac
     /**
      * Create an instance of AccessControl AdministrativePoint
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public AccessControlSAP( DN dn, String uuid, long seqNumber )
+    public AccessControlSAP( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.AccessControlSpecificArea, seqNumber );
+        super( uuid, AdministrativeRole.AccessControlSpecificArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AdministrativePoint.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AdministrativePoint.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AdministrativePoint.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AdministrativePoint.java Mon Dec 27 15:28:20 2010
@@ -21,7 +21,6 @@ package org.apache.directory.server.core
 
 import java.util.Set;
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -29,7 +28,6 @@ import org.apache.directory.shared.ldap.
  * An interface used to describe an AdministrativePoint. An AdministratuvePoint 
  * holds some elements useful to navigate through the administrative model :
  * <li>
- * <ul>The DN : the AP position in the DIT</ul>
  * <ul>The UUID : The AP unique identifier used when an entry point to the AP it depends on</ul>
  * <ul>The role : the AP role</ul>
  * <ul>The parent : the AP this AP is the direct descendant of</ul>
@@ -39,12 +37,6 @@ import org.apache.directory.shared.ldap.
 public interface AdministrativePoint
 {
     /**
-     * @return The AdministrativePoint DN
-     */
-    DN getDn();
-
-
-    /**
      * @return The AdministrativePoint UUID
      */
     String getUuid();
@@ -57,6 +49,12 @@ public interface AdministrativePoint
 
 
     /**
+     * @param seqNumber The AdministrativePoint sequence number
+     */
+    void setSeqNumber( long seqNumber );
+
+
+    /**
      * Tells if the AdministrativePoint defines an autonomous area
      * 
      * @return true if the AdministrativePoint is an AutonomousArea
@@ -109,6 +107,13 @@ public interface AdministrativePoint
     
     
     /**
+     * Remove a subentry from the AdminstrativePoint
+     * @param subentry The subentry to remove
+     */
+    void deleteSubentry( Subentry subentry );
+    
+    
+    /**
      * Get the set of subentries associated with a role 
      * @param role The role we are looking the subentries for
      * @return The Set of subentries found

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AutonomousAdministrativePoint.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AutonomousAdministrativePoint.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AutonomousAdministrativePoint.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/AutonomousAdministrativePoint.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -45,12 +44,12 @@ public class AutonomousAdministrativePoi
     /**
      * Create an instance of AutonomousAdministrativePoint
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public AutonomousAdministrativePoint( DN dn, String uuid, long seqNumber )
+    public AutonomousAdministrativePoint( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.AutonomousArea, seqNumber );
+        super( uuid, AdministrativeRole.AutonomousArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeAAP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeAAP.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeAAP.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeAAP.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -34,12 +33,12 @@ public class CollectiveAttributeAAP exte
     /**
      * Create an instance of CollectiveAttribute AAP
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public CollectiveAttributeAAP( DN dn, String uuid, long seqNumber )
+    public CollectiveAttributeAAP( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.CollectiveAttributeSpecificArea, seqNumber );
+        super( uuid, AdministrativeRole.CollectiveAttributeSpecificArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeAdministrativePoint.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeAdministrativePoint.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeAdministrativePoint.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeAdministrativePoint.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -35,12 +34,12 @@ public abstract class CollectiveAttribut
     /**
      * Create an instance of CollectiveAttributeAdministrativePoint
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
      * @param role The AdministrativePoint role
+     * @param seqNumber the associated Sequence Number
      */
-    protected CollectiveAttributeAdministrativePoint( DN dn, String uuid, AdministrativeRole role, long seqNumber )
+    protected CollectiveAttributeAdministrativePoint( String uuid, AdministrativeRole role, long seqNumber )
     {
-        super( dn, uuid, role, seqNumber );
+        super( uuid, role, seqNumber );
     }
 }

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeIAP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeIAP.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeIAP.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeIAP.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -34,12 +33,12 @@ public class CollectiveAttributeIAP exte
     /**
      * Create an instance of CollectiveAttribute IAP
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public CollectiveAttributeIAP( DN dn, String uuid, long seqNumber )
+    public CollectiveAttributeIAP( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.CollectiveAttributeInnerArea, seqNumber );
+        super( uuid, AdministrativeRole.CollectiveAttributeInnerArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeSAP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeSAP.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeSAP.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/CollectiveAttributeSAP.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -34,12 +33,12 @@ public class CollectiveAttributeSAP exte
     /**
      * Create an instance of CollectiveAttribute SAP
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public CollectiveAttributeSAP( DN dn, String uuid, long seqNumber )
+    public CollectiveAttributeSAP( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.CollectiveAttributeSpecificArea, seqNumber );
+        super( uuid, AdministrativeRole.CollectiveAttributeSpecificArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaAAP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaAAP.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaAAP.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaAAP.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -34,12 +33,12 @@ public class SubschemaAAP extends Subsch
     /**
      * Create an instance of Subschema AAP
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public SubschemaAAP( DN dn, String uuid, long seqNumber )
+    public SubschemaAAP( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.SubSchemaSpecificArea, seqNumber );
+        super( uuid, AdministrativeRole.SubSchemaSpecificArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaAdministrativePoint.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaAdministrativePoint.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaAdministrativePoint.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaAdministrativePoint.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -35,12 +34,12 @@ public abstract class SubschemaAdministr
     /**
      * Create an instance of Subschema AdministrativePoint
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
      * @param role The AdministrativePoint role
+     * @param seqNumber the associated Sequence Number
      */
-    protected SubschemaAdministrativePoint( DN dn, String uuid, AdministrativeRole role, long seqNumber )
+    protected SubschemaAdministrativePoint( String uuid, AdministrativeRole role, long seqNumber )
     {
-        super( dn, uuid, role, seqNumber );
+        super( uuid, role, seqNumber );
     }
 }

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaSAP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaSAP.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaSAP.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/SubschemaSAP.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -34,12 +33,12 @@ public class SubschemaSAP extends Subsch
     /**
      * Create an instance of Subschema SAP
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public SubschemaSAP( DN dn, String uuid, long seqNumber )
+    public SubschemaSAP( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.SubSchemaSpecificArea, seqNumber );
+        super( uuid, AdministrativeRole.SubSchemaSpecificArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionAAP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionAAP.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionAAP.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionAAP.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -34,12 +33,12 @@ public class TriggerExecutionAAP extends
     /**
      * Create an instance of TriggerExecution AAP
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public TriggerExecutionAAP( DN dn, String uuid, long seqNumber )
+    public TriggerExecutionAAP( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.TriggerExecutionSpecificArea, seqNumber );
+        super( uuid, AdministrativeRole.TriggerExecutionSpecificArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionAdministrativePoint.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionAdministrativePoint.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionAdministrativePoint.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionAdministrativePoint.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -35,12 +34,12 @@ public abstract class TriggerExecutionAd
     /**
      * Create an instance of TriggerExecutionAdministrativePoint
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
      * @param role The AdministrativePoint role
+     * @param seqNumber the associated Sequence Number
      */
-    protected TriggerExecutionAdministrativePoint( DN dn, String uuid, AdministrativeRole role, long seqNumber )
+    protected TriggerExecutionAdministrativePoint( String uuid, AdministrativeRole role, long seqNumber )
     {
-        super( dn, uuid, role, seqNumber );
+        super( uuid, role, seqNumber );
     }
 }

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionIAP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionIAP.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionIAP.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionIAP.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -34,12 +33,12 @@ public class TriggerExecutionIAP extends
     /**
      * Create an instance of TriggerExecution IAP
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public TriggerExecutionIAP( DN dn, String uuid, long seqNumber )
+    public TriggerExecutionIAP( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.TriggerExecutionInnerArea, seqNumber );
+        super( uuid, AdministrativeRole.TriggerExecutionInnerArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionSAP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionSAP.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionSAP.java (original)
+++ directory/apacheds/branches/apacheds-AP/core-api/src/main/java/org/apache/directory/server/core/administrative/TriggerExecutionSAP.java Mon Dec 27 15:28:20 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.administrative;
 
 
-import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.subtree.AdministrativeRole;
 
 
@@ -34,12 +33,12 @@ public class TriggerExecutionSAP extends
     /**
      * Create an instance of TriggerExecution SAP
      *
-     * @param dn The AdministrativePoint DN
      * @param uuid The AdministrativePoint UUID
+     * @param seqNumber the associated Sequence Number
      */
-    public TriggerExecutionSAP( DN dn, String uuid, long seqNumber )
+    public TriggerExecutionSAP( String uuid, long seqNumber )
     {
-        super( dn, uuid, AdministrativeRole.TriggerExecutionSpecificArea, seqNumber );
+        super( uuid, AdministrativeRole.TriggerExecutionSpecificArea, seqNumber );
     }
 
 

Modified: directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java?rev=1053086&r1=1053085&r2=1053086&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java Mon Dec 27 15:28:20 2010
@@ -36,22 +36,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
-import org.apache.directory.server.core.administrative.AccessControlAAP;
-import org.apache.directory.server.core.administrative.AccessControlAdministrativePoint;
-import org.apache.directory.server.core.administrative.AccessControlIAP;
-import org.apache.directory.server.core.administrative.AccessControlSAP;
 import org.apache.directory.server.core.administrative.AdministrativePoint;
-import org.apache.directory.server.core.administrative.CollectiveAttributeAAP;
-import org.apache.directory.server.core.administrative.CollectiveAttributeAdministrativePoint;
-import org.apache.directory.server.core.administrative.CollectiveAttributeIAP;
-import org.apache.directory.server.core.administrative.CollectiveAttributeSAP;
-import org.apache.directory.server.core.administrative.SubschemaAAP;
-import org.apache.directory.server.core.administrative.SubschemaAdministrativePoint;
-import org.apache.directory.server.core.administrative.SubschemaSAP;
-import org.apache.directory.server.core.administrative.TriggerExecutionAAP;
-import org.apache.directory.server.core.administrative.TriggerExecutionAdministrativePoint;
-import org.apache.directory.server.core.administrative.TriggerExecutionIAP;
-import org.apache.directory.server.core.administrative.TriggerExecutionSAP;
 import org.apache.directory.server.core.authn.Authenticator;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
@@ -243,211 +228,6 @@ public class AdministrativePointIntercep
 
 
     /**
-     * Create the list of AP for a given entry
-     */
-    private void createAdministrativePoints( EntryAttribute adminPoint, DN dn, String uuid, long seqNumber ) throws LdapException
-    {
-        if ( isAAP( adminPoint ) )
-        {
-            // The AC AAP
-            AccessControlAdministrativePoint acAap = new AccessControlAAP( dn, uuid, seqNumber );
-            directoryService.getAccessControlAPCache().add( dn, acAap );
-
-            // The CA AAP
-            CollectiveAttributeAdministrativePoint caAap = new CollectiveAttributeAAP( dn, uuid, seqNumber );
-            directoryService.getCollectiveAttributeAPCache().add( dn, caAap );
-
-            // The TE AAP
-            TriggerExecutionAdministrativePoint teAap = new TriggerExecutionAAP( dn, uuid, seqNumber );
-            directoryService.getTriggerExecutionAPCache().add( dn, teAap );
-
-            // The SS AAP
-            SubschemaAdministrativePoint ssAap = new SubschemaAAP( dn, uuid, seqNumber );
-            directoryService.getSubschemaAPCache().add( dn, ssAap );
-
-            // TODO : Here, we have to update the children, removing any 
-            // reference to any other underlying AP
-
-            // If it's an AAP, we can get out immediately
-            return;
-        }
-
-        for ( Value<?> value : adminPoint )
-        {
-            String role = value.getString();
-
-            // Deal with AccessControl AP
-            if ( isAccessControlSpecificRole( role ) )
-            {
-                AccessControlAdministrativePoint sap = new AccessControlSAP( dn, uuid, seqNumber );
-                directoryService.getAccessControlAPCache().add( dn, sap );
-
-                // TODO : Here, we have to update the children, removing any 
-                // reference to any other underlying AccessControl IAP or SAP 
-
-                continue;
-            }
-
-            if ( isAccessControlInnerRole( role ) )
-            {
-                AccessControlAdministrativePoint iap = new AccessControlIAP( dn, uuid, seqNumber );
-                directoryService.getAccessControlAPCache().add( dn, iap );
-
-                continue;
-            }
-
-            // Deal with CollectiveAttribute AP
-            if ( isCollectiveAttributeSpecificRole( role ) )
-            {
-                CollectiveAttributeAdministrativePoint sap = new CollectiveAttributeSAP( dn, uuid, seqNumber );
-                directoryService.getCollectiveAttributeAPCache().add( dn, sap );
-
-                // TODO : Here, we have to update the children, removing any 
-                // reference to any other underlying CollectiveAttribute IAP or SAP 
-                
-                continue;
-            }
-
-            if ( isCollectiveAttributeInnerRole( role ) )
-            {
-                CollectiveAttributeAdministrativePoint iap = new CollectiveAttributeIAP( dn, uuid, seqNumber );
-                directoryService.getCollectiveAttributeAPCache().add( dn, iap );
-
-                continue;
-            }
-
-            // Deal with SubSchema AP
-            if ( isSubschemaSpecficRole( role ) )
-            {
-                SubschemaAdministrativePoint sap = new SubschemaSAP( dn, uuid, seqNumber );
-                directoryService.getSubschemaAPCache().add( dn, sap );
-
-                // TODO : Here, we have to update the children, removing any 
-                // reference to any other underlying Subschema IAP or SAP 
-
-                continue;
-            }
-
-            // Deal with TriggerExecution AP
-            if ( isTriggerExecutionSpecificRole( role ) )
-            {
-                TriggerExecutionAdministrativePoint sap = new TriggerExecutionSAP( dn, uuid, seqNumber );
-                directoryService.getTriggerExecutionAPCache().add( dn, sap );
-
-                // TODO : Here, we have to update the children, removing any 
-                // reference to any other underlying TriggerExecution IAP or SAP
-                
-                continue;
-            }
-
-            if ( isTriggerExecutionInnerRole( role ) )
-            {
-                TriggerExecutionAdministrativePoint iap = new TriggerExecutionIAP( dn, uuid, seqNumber );
-                directoryService.getTriggerExecutionAPCache().add( dn, iap );
-
-                continue;
-            }
-        }
-
-        return;
-    }
-
-
-    /**
-     * Update the cache clones with the added roles
-     */
-    private void addRole( String role, DN dn, String uuid, DnNode<AdministrativePoint> acapCache,
-        DnNode<AdministrativePoint> caapCache, DnNode<AdministrativePoint> teapCache,
-        DnNode<AdministrativePoint> ssapCache, long seqNumber ) throws LdapException
-    {
-        // Deal with Autonomous AP : create the 4 associated SAP/AAP
-        if ( isAutonomousAreaRole( role ) )
-        {
-            // The AC AAP
-            AccessControlAdministrativePoint acAap = new AccessControlAAP( dn, uuid, seqNumber );
-            acapCache.add( dn, acAap );
-
-            // The CA AAP
-            CollectiveAttributeAdministrativePoint caAap = new CollectiveAttributeAAP( dn, uuid, seqNumber );
-            caapCache.add( dn, caAap );
-
-            // The TE AAP
-            TriggerExecutionAdministrativePoint teAap = new TriggerExecutionAAP( dn, uuid, seqNumber );
-            teapCache.add( dn, teAap );
-
-            // The SS AAP
-            SubschemaAdministrativePoint ssAap = new SubschemaAAP( dn, uuid, seqNumber );
-            ssapCache.add( dn, ssAap );
-            
-            // If it's an AAP, we can get out immediately
-            return;
-        }
-
-        // Deal with AccessControl AP
-        if ( isAccessControlSpecificRole( role ) )
-        {
-            AccessControlAdministrativePoint sap = new AccessControlSAP( dn, uuid, seqNumber );
-            acapCache.add( dn, sap );
-
-            return;
-        }
-
-        if ( isAccessControlInnerRole( role ) )
-        {
-            AccessControlAdministrativePoint iap = new AccessControlIAP( dn, uuid, seqNumber );
-            acapCache.add( dn, iap );
-
-            return;
-        }
-
-        // Deal with CollectiveAttribute AP
-        if ( isCollectiveAttributeSpecificRole( role ) )
-        {
-            CollectiveAttributeAdministrativePoint sap = new CollectiveAttributeSAP( dn, uuid, seqNumber );
-            caapCache.add( dn, sap );
-
-            return;
-        }
-
-        if ( isCollectiveAttributeInnerRole( role ) )
-        {
-            CollectiveAttributeAdministrativePoint iap = new CollectiveAttributeIAP( dn, uuid, seqNumber );
-            caapCache.add( dn, iap );
-
-            return;
-        }
-
-        // Deal with SubSchema AP
-        if ( isSubschemaSpecficRole( role ) )
-        {
-            SubschemaAdministrativePoint sap = new SubschemaSAP( dn, uuid, seqNumber );
-            ssapCache.add( dn, sap );
-
-            return;
-        }
-
-        // Deal with TriggerExecution AP
-        if ( isTriggerExecutionSpecificRole( role ) )
-        {
-            TriggerExecutionAdministrativePoint sap = new TriggerExecutionSAP( dn, uuid, seqNumber );
-            teapCache.add( dn, sap );
-
-            return;
-        }
-
-        if ( isTriggerExecutionInnerRole( role ) )
-        {
-            TriggerExecutionAdministrativePoint iap = new TriggerExecutionIAP( dn, uuid, seqNumber );
-            teapCache.add( dn, iap );
-
-            return;
-        }
-    }
-
-
-
-
-    /**
      * Update the cache clones with the added roles
      */
     private void delRole( String role, DN dn, String uuid, DnNode<AdministrativePoint> acapCache,
@@ -636,94 +416,6 @@ public class AdministrativePointIntercep
     
 
     /**
-     * Check if we can safely delete a role
-     */
-    private void checkDelRole( Value<?> role, EntryAttribute adminPoint, DN dn ) throws LdapException
-    {
-        String roleStr = StringTools.toLowerCase( StringTools.trim( role.getString() ) );
-
-        // Check that the removed AdministrativeRole is valid
-        if ( !ROLES.contains( roleStr ) )
-        {
-            String message = "Cannot delete the given role, it's not a valid one :" + role;
-            LOG.error( message );
-            throw new LdapUnwillingToPerformException( message );
-        }
-
-        // Now we are trying to delete an Administrative point. We have to check that 
-        // we only have one role if the deleted role is an AAP
-        if ( isAutonomousAreaRole( roleStr ) )
-        {
-            // We know have to check that removing the AAP, we will not 
-            // left any pending IAP. We should check for the 3 potential IAPs :
-            // AccessControl, CollectiveAttribute and TriggerExecution.
-            // If the removed AP has a parent, no need to go any further :
-            // the children IAPs will depend on this parent.
-            
-            // Process the ACs
-            DnNode<AdministrativePoint> acAps = directoryService.getAccessControlAPCache();
-            
-            if ( !acAps.hasParent( dn ) )
-            {
-                // No parent, check for any IAP
-                List<AdministrativePoint> children = acAps.getDescendantElements( dn );
-                
-                for ( AdministrativePoint child : children )
-                {
-                    if ( child.isInner() )
-                    {
-                        // Ok, we are dead : the IAP will remain with no parent.
-                        String message = "Cannot delete the given role, the " + child.getDn() + " AccessControl IAP will remain orphan";
-                        LOG.error( message );
-                        throw new LdapUnwillingToPerformException( message );
-                    }
-                }
-            }
-            
-            // Process the CAs
-            DnNode<AdministrativePoint> caAps = directoryService.getCollectiveAttributeAPCache();
-            
-            if ( !acAps.hasParent( dn ) )
-            {
-                // No parent, check for any IAP
-                List<AdministrativePoint> children = caAps.getDescendantElements( dn );
-                
-                for ( AdministrativePoint child : children )
-                {
-                    if ( child.isInner() )
-                    {
-                        // Ok, we are dead : the IAP will remain with no parent.
-                        String message = "Cannot delete the given role, the " + child.getDn() + " CollectiveAttribute IAP will remain orphan";
-                        LOG.error( message );
-                        throw new LdapUnwillingToPerformException( message );
-                    }
-                }
-            }
-            
-            // Process the TEs
-            DnNode<AdministrativePoint> teAps = directoryService.getTriggerExecutionAPCache();
-            
-            if ( !acAps.hasParent( dn ) )
-            {
-                // No parent, check for any IAP
-                List<AdministrativePoint> children = teAps.getDescendantElements( dn );
-                
-                for ( AdministrativePoint child : children )
-                {
-                    if ( child.isInner() )
-                    {
-                        // Ok, we are dead : the IAP will remain with no parent.
-                        String message = "Cannot delete the given role, the " + child.getDn() + " TriggerExecution IAP will remain orphan";
-                        LOG.error( message );
-                        throw new LdapUnwillingToPerformException( message );
-                    }
-                }
-            }
-        }
-    }
-
-
-    /**
      * Creates an Administrative service interceptor.
      */
     public AdministrativePointInterceptor()
@@ -802,7 +494,7 @@ public class AdministrativePointIntercep
             EntryAttribute adminPoint = adminPointEntry.get( ADMINISTRATIVE_ROLE_AT );
             long seqNumber = Long.parseLong( adminPointEntry.get( ApacheSchemaConstants.AP_SEQ_NUMBER_AT ).getString() );
 
-            createAdministrativePoints( adminPoint, dn, uuid , seqNumber);
+            //createAdministrativePoints( adminPoint, dn, uuid , seqNumber);
         }
     }
 
@@ -1279,7 +971,7 @@ public class AdministrativePointIntercep
      * <li> If we remove a SAP, no descendant IAP should remain orphan</li>
      * </ul> 
      * {@inheritDoc}
-     */
+     *
     public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
     {
 System.out.println( "addContext : " + deleteContext );
@@ -1402,7 +1094,7 @@ System.out.println( "addContext : " + mo
 
                         for ( Value<?> role : attribute )
                         {
-                            addRole( role.getString(), dn, uuid, acapCacheCopy, caapCacheCopy, teapCacheCopy, ssapCacheCopy, seqNumber );
+                            //addRole( role.getString(), dn, uuid, acapCacheCopy, caapCacheCopy, teapCacheCopy, ssapCacheCopy, seqNumber );
 
                             // Add the role to the modified attribute
                             modifiedAdminRole.add( role );

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=1053086&r1=1053085&r2=1053086&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 Mon Dec 27 15:28:20 2010
@@ -442,7 +442,7 @@ public class SubentryInterceptor extends
     // Helper methods
     //-------------------------------------------------------------------------------------------
     /**
-     * Return the list of AdministrativeRole for a subentry
+     * Return the list of AdministrativeRole for a subentry. We only use Specific Area roles.
      */
     private Set<AdministrativeRole> getSubentryAdminRoles( Entry subentry ) throws LdapException
     {
@@ -450,7 +450,7 @@ public class SubentryInterceptor extends
 
         if ( subentry.hasObjectClass( SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC ) )
         {
-            adminRoles.add( AdministrativeRole.AccessControlInnerArea );
+            adminRoles.add( AdministrativeRole.AccessControlSpecificArea );
         }
 
         if ( subentry.hasObjectClass( SchemaConstants.SUBSCHEMA_OC ) )
@@ -465,7 +465,7 @@ public class SubentryInterceptor extends
 
         if ( subentry.hasObjectClass( ApacheSchemaConstants.TRIGGER_EXECUTION_SUBENTRY_OC ) )
         {
-            adminRoles.add( AdministrativeRole.TriggerExecutionInnerArea );
+            adminRoles.add( AdministrativeRole.TriggerExecutionSpecificArea );
         }
 
         return adminRoles;
@@ -1413,19 +1413,19 @@ public class SubentryInterceptor extends
         if ( isAAP( adminPoint ) )
         {
             // The AC AAP
-            AccessControlAdministrativePoint acAap = new AccessControlAAP( dn, uuid, seqNumber );
+            AccessControlAdministrativePoint acAap = new AccessControlAAP( uuid, seqNumber );
             directoryService.getAccessControlAPCache().add( dn, acAap );
 
             // The CA AAP
-            CollectiveAttributeAdministrativePoint caAap = new CollectiveAttributeAAP( dn, uuid, seqNumber );
+            CollectiveAttributeAdministrativePoint caAap = new CollectiveAttributeAAP( uuid, seqNumber );
             directoryService.getCollectiveAttributeAPCache().add( dn, caAap );
 
             // The TE AAP
-            TriggerExecutionAdministrativePoint teAap = new TriggerExecutionAAP( dn, uuid, seqNumber );
+            TriggerExecutionAdministrativePoint teAap = new TriggerExecutionAAP( uuid, seqNumber );
             directoryService.getTriggerExecutionAPCache().add( dn, teAap );
 
             // The SS AAP
-            SubschemaAdministrativePoint ssAap = new SubschemaAAP( dn, uuid, seqNumber );
+            SubschemaAdministrativePoint ssAap = new SubschemaAAP( uuid, seqNumber );
             directoryService.getSubschemaAPCache().add( dn, ssAap );
 
             // If it's an AAP, we can get out immediately
@@ -1440,7 +1440,7 @@ public class SubentryInterceptor extends
             // Deal with AccessControl AP
             if ( isAccessControlSpecificRole( role ) )
             {
-                AccessControlAdministrativePoint sap = new AccessControlSAP( dn, uuid, seqNumber );
+                AccessControlAdministrativePoint sap = new AccessControlSAP( uuid, seqNumber );
                 directoryService.getAccessControlAPCache().add( dn, sap );
 
                 continue;
@@ -1448,7 +1448,7 @@ public class SubentryInterceptor extends
 
             if ( isAccessControlInnerRole( role ) )
             {
-                AccessControlAdministrativePoint iap = new AccessControlIAP( dn, uuid, seqNumber );
+                AccessControlAdministrativePoint iap = new AccessControlIAP( uuid, seqNumber );
                 directoryService.getAccessControlAPCache().add( dn, iap );
 
                 continue;
@@ -1457,7 +1457,7 @@ public class SubentryInterceptor extends
             // Deal with CollectiveAttribute AP
             if ( isCollectiveAttributeSpecificRole( role ) )
             {
-                CollectiveAttributeAdministrativePoint sap = new CollectiveAttributeSAP( dn, uuid, seqNumber );
+                CollectiveAttributeAdministrativePoint sap = new CollectiveAttributeSAP( uuid, seqNumber );
                 directoryService.getCollectiveAttributeAPCache().add( dn, sap );
 
                 continue;
@@ -1465,7 +1465,7 @@ public class SubentryInterceptor extends
 
             if ( isCollectiveAttributeInnerRole( role ) )
             {
-                CollectiveAttributeAdministrativePoint iap = new CollectiveAttributeIAP( dn, uuid, seqNumber );
+                CollectiveAttributeAdministrativePoint iap = new CollectiveAttributeIAP( uuid, seqNumber );
                 directoryService.getCollectiveAttributeAPCache().add( dn, iap );
 
                 continue;
@@ -1474,7 +1474,7 @@ public class SubentryInterceptor extends
             // Deal with SubSchema AP
             if ( isSubschemaSpecficRole( role ) )
             {
-                SubschemaAdministrativePoint sap = new SubschemaSAP( dn, uuid, seqNumber );
+                SubschemaAdministrativePoint sap = new SubschemaSAP( uuid, seqNumber );
                 directoryService.getSubschemaAPCache().add( dn, sap );
 
                 continue;
@@ -1483,7 +1483,7 @@ public class SubentryInterceptor extends
             // Deal with TriggerExecution AP
             if ( isTriggerExecutionSpecificRole( role ) )
             {
-                TriggerExecutionAdministrativePoint sap = new TriggerExecutionSAP( dn, uuid, seqNumber );
+                TriggerExecutionAdministrativePoint sap = new TriggerExecutionSAP( uuid, seqNumber );
                 directoryService.getTriggerExecutionAPCache().add( dn, sap );
 
                 continue;
@@ -1491,7 +1491,7 @@ public class SubentryInterceptor extends
 
             if ( isTriggerExecutionInnerRole( role ) )
             {
-                TriggerExecutionAdministrativePoint iap = new TriggerExecutionIAP( dn, uuid, seqNumber );
+                TriggerExecutionAdministrativePoint iap = new TriggerExecutionIAP( uuid, seqNumber );
                 directoryService.getTriggerExecutionAPCache().add( dn, iap );
 
                 continue;
@@ -1666,7 +1666,7 @@ public class SubentryInterceptor extends
     /**
      * Inject a new seqNumber in an AP
      */
-    private void updateSeqNumber( DN apDn ) throws LdapException
+    private long updateSeqNumber( DN apDn ) throws LdapException
     {
         long seqNumber = directoryService.getNewApSeqNumber();
         
@@ -1682,9 +1682,14 @@ public class SubentryInterceptor extends
         modCtx.setModItems( modifications );
         
         directoryService.getOperationManager().modify( modCtx );
+        
+        return seqNumber;
     }
     
     
+    /**
+     * Process the addition of a standard entry
+     */
     private void processAddEntry( AdministrativeRoleEnum role, Entry entry ) throws LdapException
     {
         DN dn = entry.getDn();
@@ -1693,118 +1698,206 @@ public class SubentryInterceptor extends
         switch ( role )
         {
             case AccessControl :
-                AdministrativePoint parentAP = directoryService.getAccessControlAPCache().getParentWithElement( dn );
-
-                if ( parentAP != null )
+                DnNode<AdministrativePoint> nodeAP = directoryService.getAccessControlAPCache().getParentWithElement( dn );
+                
+                if ( nodeAP != 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 )
+                    AdministrativePoint parentAP = nodeAP.getElement();
+    
+                    if ( parentAP != null )
                     {
-                        for ( Subentry subentry : subentries )
-                        {
-                            SubtreeSpecification ss = subentry.getSubtreeSpecification();
+                        // 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();
     
-                            // Now, evaluate the entry wrt the subentry ss
-                            // and inject a ref to the subentry if it evaluates to true
-                            if ( evaluator.evaluate( ss, parentAP.getDn(), dn, entry ) )
+                        if ( subentries != null )
+                        {
+                            for ( Subentry subentry : subentries )
                             {
-                                // Point to the subentry UUID
-                                entry.add( ApacheSchemaConstants.ACCESS_CONTROL_SUBENTRIES_UUID_AT, subentry.getUuid() );
+                                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() );
+                                }
                             }
                         }
                     }
                 }
 
             case CollectiveAttribute :
-                parentAP = directoryService.getCollectiveAttributeAPCache().getParentWithElement( dn );
+                nodeAP = directoryService.getCollectiveAttributeAPCache().getParentWithElement( dn );
 
-                if ( parentAP != null )
+                if ( nodeAP != null )
                 {
-                    // Update the entry seqNumber for CA
-                    entry.put( ApacheSchemaConstants.ACCESS_CONTROL_SEQ_NUMBER_AT, Long.toString( parentAP.getSeqNumber() ) );
-                    
-                    // This entry has a CollectiveAttribute AP parent.
-                    Set<Subentry> subentries = parentAP.getSubentries();
-
-                    if ( subentries != null )
+                    AdministrativePoint parentAP = nodeAP.getElement();
+    
+                    if ( parentAP != null )
                     {
-                        for ( Subentry subentry : subentries )
-                        {
-                            SubtreeSpecification ss = subentry.getSubtreeSpecification();
+                        // Update the entry seqNumber for CA
+                        entry.put( ApacheSchemaConstants.ACCESS_CONTROL_SEQ_NUMBER_AT, Long.toString( parentAP.getSeqNumber() ) );
+                        
+                        // This entry has a CollectiveAttribute AP parent.
+                        Set<Subentry> subentries = parentAP.getSubentries();
     
-                            // Now, evaluate the entry wrt the subentry ss
-                            // and inject a ref to the subentry if it evaluates to true
-                            if ( evaluator.evaluate( ss, parentAP.getDn(), dn, entry ) )
+                        if ( subentries != null )
+                        {
+                            for ( Subentry subentry : subentries )
                             {
-                                // Point to the subentry UUID
-                                entry.add( ApacheSchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_UUID_AT, subentry.getUuid() );
+                                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() );
+                                }
                             }
                         }
                     }
                 }
 
             case SubSchema :
-                parentAP = directoryService.getSubschemaAPCache().getParentWithElement( dn );
+                nodeAP = directoryService.getSubschemaAPCache().getParentWithElement( dn );
 
-                if ( parentAP != null )
+                if ( nodeAP != null )
                 {
-                    // This entry has a Subschema AP parent.
-                    // Update the entry seqNumber for CA
-                    entry.put( ApacheSchemaConstants.ACCESS_CONTROL_SEQ_NUMBER_AT, Long.toString( parentAP.getSeqNumber() ) );
-                    
-                    // This entry has a CollectiveAttribute AP parent.
-                    Set<Subentry> subentries = parentAP.getSubentries();
-
-                    if ( subentries != null )
+                    AdministrativePoint parentAP = nodeAP.getElement();
+    
+                    if ( parentAP != null )
                     {
-                        for ( Subentry subentry : subentries )
-                        {
-                            SubtreeSpecification ss = subentry.getSubtreeSpecification();
+                        // This entry has a Subschema AP parent.
+                        // Update the entry seqNumber for CA
+                        entry.put( ApacheSchemaConstants.ACCESS_CONTROL_SEQ_NUMBER_AT, Long.toString( parentAP.getSeqNumber() ) );
+                        
+                        // This entry has a CollectiveAttribute AP parent.
+                        Set<Subentry> subentries = parentAP.getSubentries();
     
-                            // Now, evaluate the entry wrt the subentry ss
-                            // and inject a ref to the subentry if it evaluates to true
-                            if ( evaluator.evaluate( ss, parentAP.getDn(), dn, entry ) )
+                        if ( subentries != null )
+                        {
+                            for ( Subentry subentry : subentries )
                             {
-                                // Point to the subentry UUID
-                                entry.add( ApacheSchemaConstants.SUB_SCHEMA_SUBENTRY_UUID_AT, subentry.getUuid() );
+                                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() );
+                                }
                             }
                         }
                     }
                 }
 
             case TriggerExecution :
-                parentAP = directoryService.getTriggerExecutionAPCache().getParentWithElement( dn );
+                nodeAP = directoryService.getTriggerExecutionAPCache().getParentWithElement( dn );
 
-                if ( parentAP != null )
+                if ( nodeAP != null )
                 {
-                    // Update the entry seqNumber for TE
-                    entry.put( ApacheSchemaConstants.ACCESS_CONTROL_SEQ_NUMBER_AT, Long.toString( parentAP.getSeqNumber() ) );
-                    
-                    // This entry has a TriggerExecution AP parent.
-                    Set<Subentry> subentries = parentAP.getSubentries();
-
-                    if ( subentries != null )
+                    AdministrativePoint parentAP = nodeAP.getElement();
+    
+                    if ( parentAP != null )
                     {
-                        for ( Subentry subentry : subentries )
-                        {
-                            SubtreeSpecification ss = subentry.getSubtreeSpecification();
+                        // Update the entry seqNumber for TE
+                        entry.put( ApacheSchemaConstants.ACCESS_CONTROL_SEQ_NUMBER_AT, Long.toString( parentAP.getSeqNumber() ) );
+                        
+                        // This entry has a TriggerExecution AP parent.
+                        Set<Subentry> subentries = parentAP.getSubentries();
     
-                            // Now, evaluate the entry wrt the subentry ss
-                            // and inject a ref to the subentry if it evaluates to true
-                            if ( evaluator.evaluate( ss, parentAP.getDn(), dn, entry ) )
+                        if ( subentries != null )
+                        {
+                            for ( Subentry subentry : subentries )
                             {
-                                // Point to the subentry UUID
-                                entry.add( ApacheSchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_UUID_AT, subentry.getUuid() );
+                                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() );
+                                }
                             }
                         }
                     }
                 }
-            
+        }
+    }
+    
+    
+    /**
+     * Add a reference to the added subentry in each of the AP cache for which the 
+     * subentry has a role.
+     */
+    private void addSubentry( DN apDn, Entry entry, Subentry subentry, long seqNumber ) throws LdapException
+    {
+        for ( AdministrativeRole role : getSubentryAdminRoles( entry ) )
+        {
+            switch ( role )
+            {
+                case AccessControlSpecificArea :
+                     AdministrativePoint apAC = directoryService.getAccessControlAPCache().getElement( apDn );
+                     apAC.addSubentry( subentry );
+                     apAC.setSeqNumber( seqNumber );
+                     break;
+                     
+                case CollectiveAttributeSpecificArea :
+                    AdministrativePoint apCA = directoryService.getCollectiveAttributeAPCache().getElement( apDn );
+                    apCA.addSubentry( subentry );
+                    apCA.setSeqNumber( seqNumber );
+                    break;
+                    
+                case SubSchemaSpecificArea :
+                    AdministrativePoint apSS = directoryService.getSubschemaAPCache().getElement( apDn );
+                    apSS.addSubentry( subentry );
+                    apSS.setSeqNumber( seqNumber );
+                    break;
+                    
+                case TriggerExecutionSpecificArea :
+                    AdministrativePoint apTE = directoryService.getTriggerExecutionAPCache().getElement( apDn );
+                    apTE.addSubentry( subentry );
+                    apTE.setSeqNumber( seqNumber );
+                    break;
+            }
+        }
+    }
+    
+    
+    /**
+     * Remove the reference to the deleted subentry in each of the AP cache for which the 
+     * subentry has a role.
+     */
+    private void deleteSubentry( DN apDn, Entry entry, Subentry subentry ) throws LdapException
+    {
+        for ( AdministrativeRole role : getSubentryAdminRoles( entry ) )
+        {
+            switch ( role )
+            {
+                case AccessControlSpecificArea :
+                     directoryService.getAccessControlAPCache().getElement( apDn ).deleteSubentry( subentry );
+                     break;
+                     
+                case CollectiveAttributeSpecificArea :
+                    directoryService.getCollectiveAttributeAPCache().getElement( apDn ).deleteSubentry( subentry );
+                    break;
+                    
+                case SubSchemaSpecificArea :
+                    directoryService.getSubschemaAPCache().getElement( apDn ).deleteSubentry( subentry );
+                    break;
+                    
+                case TriggerExecutionSpecificArea :
+                    directoryService.getTriggerExecutionAPCache().getElement( apDn ).deleteSubentry( subentry );
+                    break;
+                    
+            }
         }
     }
 
@@ -1912,9 +2005,6 @@ public class SubentryInterceptor extends
                     throw new LdapUnwillingToPerformException( message );
                 }
                 
-                // Now, get the AdministrativePoint
-                AdministrativePoint adminPoint = getAdministrativePoint( apDn );
-                
                 /* ----------------------------------------------------------------
                  * Build the set of operational attributes to be injected into
                  * entries that are contained within the subtree represented by this
@@ -1925,7 +2015,7 @@ public class SubentryInterceptor extends
                  */
                 Subentry subentry = new Subentry();
                 subentry.setAdministrativeRoles( getSubentryAdminRoles( entry ) );
-                List<EntryAttribute> operationalAttributes = getSubentryOperationalAttributes( dn, subentry );
+                //List<EntryAttribute> operationalAttributes = getSubentryOperationalAttributes( dn, subentry );
     
                 /* ----------------------------------------------------------------
                  * Parse the subtreeSpecification of the subentry and add it to the
@@ -1937,11 +2027,8 @@ public class SubentryInterceptor extends
                 setSubtreeSpecification( subentry, entry );
                 subentryCache.addSubentry( dn, subentry );
 
-                // Inject the subentry into its parent AP
-                adminPoint.addSubentry( subentry );
-
                 // Update the seqNumber and update the parent AP
-                updateSeqNumber( apDn );
+                long seqNumber = updateSeqNumber( apDn );
     
                 // Now inject the subentry into the backend
                 next.add( addContext );
@@ -1949,6 +2036,9 @@ public class SubentryInterceptor extends
                 // Get back the entryUUID and store it in the subentry
                 String subentryUuid = addContext.getEntry().get( SchemaConstants.ENTRY_UUID_AT ).getString();
                 subentry.setUuid( subentryUuid );
+
+                // Inject the subentry into its parent APs cache
+                addSubentry( apDn, entry, subentry, seqNumber );
             }
             finally
             {
@@ -2007,7 +2097,7 @@ public class SubentryInterceptor extends
         }
         else if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC ) )
         {
-            // It's a subentry
+            // It's a subentry. We ust be admin t remove it
             if ( !isAdmin )
             {
                 String message = "Cannot delete the given Subentry, user is not an Admin";
@@ -2016,28 +2106,21 @@ public class SubentryInterceptor extends
                 throw new LdapUnwillingToPerformException( message );
             }
             
-            Subentry removedSubentry = subentryCache.getSubentry( dn );
-
-            /* ----------------------------------------------------------------
-             * Find the baseDn for the subentry and use that to search the tree
-             * for all entries included by the subtreeSpecification.  Then we
-             * check the entry for subentry operational attribute that contain
-             * the DN of the subentry.  These are the subentry operational
-             * attributes we remove from the entry in a modify operation.
-             * ----------------------------------------------------------------
-             */
-            DN apDn = dn.getParent();
-            DN baseDn = apDn;
-            baseDn = baseDn.addAll( removedSubentry.getSubtreeSpecification().getBase() );
+            // Now delete the subentry itself
+            next.delete( deleteContext );
 
-            // Remove all the references to this removed subentry from all the selected entries
-            updateEntries( OperationEnum.REMOVE, deleteContext.getSession(), dn, apDn, removedSubentry.getSubtreeSpecification(), baseDn, null );
+            // Update the subentry cache
+            Subentry removedSubentry = subentryCache.removeSubentry( dn );
 
-            // Update the cache
-            subentryCache.removeSubentry( dn );
+            // Get the administrativePoint role : we must have one immediately
+            // upper
+            DN apDn = dn.getParent();
 
-            // Now delete the subentry itself
-            next.delete( deleteContext );
+            // Update the parent AP seqNumber for the roles the subentry was handling
+            AdministrativePoint adminPoint = getAdministrativePoint( apDn );
+            adminPoint.deleteSubentry( removedSubentry );
+            
+            // And finally, update the parent AP SeqNumber
         }
         else
         {



Mime
View raw message