You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/07/22 09:06:50 UTC

svn commit: r966520 - in /directory: apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/interceptor/ apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/ apache...

Author: elecharny
Date: Thu Jul 22 07:06:49 2010
New Revision: 966520

URL: http://svn.apache.org/viewvc?rev=966520&view=rev
Log:
o Added two new AT in apache schema for dealing with subentries using UUID instead of DN
o Modified the server code to deal with this new implementation

This is a partial commit, more modifications will come later. The branch won't build.

Added:
    directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.12.ldif
      - copied, changed from r965546, directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.27.ldif
    directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.13.ldif
    directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.14.ldif
Removed:
    directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.27.ldif
Modified:
    directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
    directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
    directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
    directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/Subentry.java
    directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryCache.java
    directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/shared/branches/shared-subtree/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java
    directory/shared/branches/shared-subtree/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
    directory/shared/branches/shared-subtree/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java
    directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerEnableDisableLoadTest.java
    directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
    directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java
    directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.11.ldif
    directory/shared/branches/shared-subtree/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java

Modified: directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java Thu Jul 22 07:06:49 2010
@@ -780,6 +780,7 @@ public class InterceptorChain
         }
         catch ( LdapException le )
         {
+            le.printStackTrace();
             throw le;
         }
         catch ( Throwable e )

Modified: directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java Thu Jul 22 07:06:49 2010
@@ -400,7 +400,6 @@ public class CollectiveAttributeServiceI
         // -------------------------------------------------------------------
         // now modify entries included by the subentry to have collectiveExclusions
         // -------------------------------------------------------------------
-
         ModificationItem[] items = new ModificationItem[]
             { new ModificationItem( DirContext.ADD_ATTRIBUTE,
                 new BasicAttribute( "collectiveExclusions", "c-ou" ) ) };

Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Thu Jul 22 07:06:49 2010
@@ -29,6 +29,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.filtering.EntryFilter;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
+import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
@@ -38,6 +39,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchingOperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
+import org.apache.directory.server.core.subtree.Subentry;
+import org.apache.directory.server.core.subtree.SubentryInterceptor;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
@@ -75,15 +78,24 @@ public class CollectiveAttributeIntercep
     /** The SchemaManager instance */
     private SchemaManager schemaManager;
     
+    /** The subentry interceptor reference */
+    SubentryInterceptor subentryInterceptor;
+    
     /** The ObjectClass AttributeType */
     private static AttributeType OBJECT_CLASS_AT;
 
+    /** The ADS-CollectiveAttributeSubentries AttributeType */
+    private static AttributeType ADS_COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT;
+    
     /** The CollectiveAttributeSubentries AttributeType */
     private static AttributeType COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT;
     
     /** The CollectiveExclusions AttributeType */
     private static AttributeType COLLECTIVE_EXCLUSIONS_AT;
     
+    /** The EntryUUID AttributeType */
+    private static AttributeType ENTRY_UUID_AT;
+    
     /**
      * the search result filter to use for collective attribute injection
      */
@@ -94,6 +106,9 @@ public class CollectiveAttributeIntercep
             String[] retAttrs = operation.getSearchControls().getReturningAttributes();
             addCollectiveAttributes( operation, result, retAttrs );
             
+            // Add the CollectiveAttributeSubentries AT if needed
+            addCollectiveAttributeSubentries( result, retAttrs );
+
             return true;
         }
     };
@@ -109,11 +124,16 @@ public class CollectiveAttributeIntercep
         schemaManager = directoryService.getSchemaManager();
         
         // Load some AttributeType
+        ADS_COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT = schemaManager.getAttributeType( SchemaConstants.ADS_COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT = schemaManager.getAttributeType( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         COLLECTIVE_EXCLUSIONS_AT = schemaManager.getAttributeType( SchemaConstants.COLLECTIVE_EXCLUSIONS_AT );
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
+        ENTRY_UUID_AT = schemaManager.getAttributeType( SchemaConstants.ENTRY_UUID_AT );
+        
+        InterceptorChain chain = directoryService.getInterceptorChain();
+        subentryInterceptor = ( SubentryInterceptor ) chain.get( SubentryInterceptor.class.getName() );
         
-        LOG.debug( "CollectiveAttriute interceptor initilaized" );
+        LOG.debug( "CollectiveAttriute interceptor initialized" );
     }
 
 
@@ -166,6 +186,9 @@ public class CollectiveAttributeIntercep
         {
             addCollectiveAttributes( lookupContext, result, lookupContext.getAttrsIdArray() );
         }
+        
+        // Add the CollectiveAttributeSubentries AT if needed
+        addCollectiveAttributeSubentries( result, lookupContext.getAttrsIdArray() );
 
         return result;
     }
@@ -226,9 +249,6 @@ public class CollectiveAttributeIntercep
 
         if ( containsAnyCollectiveAttributes( entry ) )
         {
-            /*
-             * TODO: Replace the Exception and the ResultCodeEnum with the correct ones.
-             */
             LOG.info( "Cannot add the entry {} : it contains some CollectiveAttributes and is not a collective subentry",
                 entry );
             throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, I18n.err( I18n.ERR_241_CANNOT_STORE_COLLECTIVE_ATT_IN_ENTRY ) );
@@ -255,9 +275,6 @@ public class CollectiveAttributeIntercep
         // Check that we don't add any collectve attribute, this is not allowed on normal entries
         if ( hasCollectiveAttributes( mods ) )
         {
-            /*
-             * TODO: Replace the Exception and the ResultCodeEnum with the correct ones.
-             */
             LOG.info( "Cannot modify the entry {} : it contains some CollectiveAttributes and is not a collective subentry",
                 targetEntry );
             throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, I18n.err( I18n.ERR_242 ) );
@@ -338,7 +355,7 @@ public class CollectiveAttributeIntercep
     private void addCollectiveAttributes( OperationContext opContext, Entry entry, String[] retAttrs ) throws LdapException
     {
         EntryAttribute collectiveAttributeSubentries = ( ( ClonedServerEntry ) entry ).getOriginalEntry().get(
-            COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+            ADS_COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
 
         /*
          * If there are no collective attribute subentries referenced then we 
@@ -415,19 +432,12 @@ public class CollectiveAttributeIntercep
          */
         for ( Value<?> value : collectiveAttributeSubentries )
         {
-            String subentryDnStr = value.getString();
-            DN subentryDn = new DN( subentryDnStr );
-
-            /*
-             * TODO - Instead of hitting disk here can't we leverage the 
-             * SubentryService to get us cached sub-entries so we're not
-             * wasting time with a lookup here? It is ridiculous to waste
-             * time looking up this sub-entry. 
-             */
+            String subentryUuid = value.getString();
+            Subentry subentry = subentryInterceptor.getSubentryCache().getSubentry( subentryUuid );
 
-            Entry subentry = opContext.lookup( subentryDn, ByPassConstants.LOOKUP_COLLECTIVE_BYPASS );
+            Entry subentryEntry = opContext.lookup( subentry.getDn(), ByPassConstants.LOOKUP_COLLECTIVE_BYPASS );
 
-            for ( AttributeType attributeType : subentry.getAttributeTypes() )
+            for ( AttributeType attributeType : subentryEntry.getAttributeTypes() )
             {
                 String attrId = attributeType.getName();
 
@@ -474,7 +484,7 @@ public class CollectiveAttributeIntercep
                     continue;
                 }
 
-                EntryAttribute subentryColAttr = subentry.get( attrId );
+                EntryAttribute subentryColAttr = subentryEntry.get( attrId );
                 EntryAttribute entryColAttr = entry.get( attrId );
 
                 /*
@@ -517,4 +527,51 @@ public class CollectiveAttributeIntercep
 
         return allSuperTypes;
     }
+    
+    
+    private void addCollectiveAttributeSubentries( Entry entry, String[] requestedAttributes ) throws LdapException
+    {
+        if ( requestedAttributes == null )
+        {
+            // Nothing to do
+            return;
+        }
+        
+        EntryAttribute adsCollectiveAttributeSubentries = entry.get( ADS_COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+        
+        if ( adsCollectiveAttributeSubentries == null )
+        {
+            return;
+        }
+            
+        Subentry subentry = subentryInterceptor.getSubentryCache().getSubentry( adsCollectiveAttributeSubentries.getString() );
+        
+        for ( String requestedAttribute : requestedAttributes )
+        {
+            if ( requestedAttribute.equals( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES ) )
+            {
+                // Add the missing collectiveAttributeSubentries and exit
+                entry.put( COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT, subentry.getDn().getNormName() );
+
+                return;
+            }
+            
+            if ( requestedAttribute.equals( SchemaConstants.ALL_USER_ATTRIBUTES ) || requestedAttribute.equals( SchemaConstants.NO_ATTRIBUTE ) )
+            {
+                continue;
+            }
+            
+            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( requestedAttribute );
+            
+            if ( attributeType.equals( COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) )
+            {
+                // Add the missing collectiveAttributeSubentries and exit
+                entry.put( COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT, subentry.getDn().getNormName() );
+
+                return;
+            }
+        }
+        
+        return;
+    }
 }

Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Thu Jul 22 07:06:49 2010
@@ -20,8 +20,6 @@
 package org.apache.directory.server.core.schema;
 
 
-import static org.apache.directory.shared.ldap.constants.PasswordPolicySchemaConstants.PWD_GRACE_USE_TIME_AT;
-
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -54,7 +52,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.controls.CascadeControl;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
-import org.apache.directory.shared.ldap.constants.PasswordPolicySchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.cursor.EmptyCursor;
 import org.apache.directory.shared.ldap.cursor.SingletonCursor;
@@ -477,16 +474,15 @@ public class SchemaInterceptor extends B
             try
             {
                 // Check that the attribute is declared
-                if ( schemaManager.getAttributeTypeRegistry().contains( attribute ) )
-                {
-                    String oid = schemaManager.getAttributeTypeRegistry().getOidByName( attribute );
+                AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( attribute );
+                
+                String oid = attributeType.getOid();
 
-                    // The attribute must be an AttributeType
-                    if ( schemaManager.getAttributeTypeRegistry().contains( oid ) && !filteredAttrs.containsKey( oid ) )
-                    {
-                        // Ok, we can add the attribute to the list of filtered attributes
-                        filteredAttrs.put( oid, attribute );
-                    }
+                // Don't add the AT twice
+                if ( !filteredAttrs.containsKey( oid ) )
+                {
+                    // Ok, we can add the attribute to the list of filtered attributes
+                    filteredAttrs.put( oid, attribute );
                 }
 
                 hasAttributes = true;

Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/Subentry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/Subentry.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/Subentry.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/Subentry.java Thu Jul 22 07:06:49 2010
@@ -22,6 +22,7 @@ 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.SubtreeSpecification;
 
 
@@ -34,46 +35,104 @@ import org.apache.directory.shared.ldap.
  */
 public class Subentry
 {
+    /** The subentry DN */
+    private DN subentryDn;
+    
     /** The Subtree Specification associated with this subentry */
     private SubtreeSpecification ss;
     
     /** The administratives roles */
     private Set<AdministrativeRole> administrativeRoles;
     
+    /** The subentry UUID */
+    private String uuid;
+    
+    
+    /**
+     * Creates a new instance of Subentry.
+     */
+    public Subentry()
+    {
+    }
+    
+    
+    /**
+     * Creates a new instance of Subentry.
+     *
+     * @param uuid The subentry UUID
+     */
+    public Subentry( String uuid )
+    {
+        this.uuid = uuid;
+    }
+    
+    
+    /**
+     * Creates a new instance of Subentry.
+     *
+     * @param uuid The subentry UUID
+     * @param subentryDn The subentry DN
+     */
+    public Subentry( DN subentryDn, String uuid )
+    {
+        this.uuid = uuid;
+        this.subentryDn = subentryDn;
+    }
+    
+    
+    /**
+     * @return The subtree specification
+     */
+    public SubtreeSpecification getSubtreeSpecification()
+    {
+        return ss;
+    }
+
     
     /**
      * Stores the subtree
      *
      * @param ss The subtree specification
      */
-    final void setSubtreeSpecification( SubtreeSpecification ss )
+    public void setSubtreeSpecification( SubtreeSpecification ss )
     {
         this.ss = ss;
     }
-    
+
 
     /**
-     * @return The subtree specification
+     * @return the subentry DN
      */
-    final SubtreeSpecification getSubtreeSpecification()
+    public DN getDn()
     {
-        return ss;
+        return subentryDn;
+    }
+
+
+    /**
+     * @param subentryDn the subentry DN to set
+     */
+    public void setDn( DN subentryDn )
+    {
+        this.subentryDn = subentryDn;
     }
 
 
     /**
-     * 
-     * TODO setAdministrativeRoles.
+     * Set the administrative roles for this subentry
      *
-     * @param administrativeRoles
+     * @param administrativeRoles The set of administrative roles
      */
-    final void setAdministrativeRoles( Set<AdministrativeRole> administrativeRoles )
+    public void setAdministrativeRoles( Set<AdministrativeRole> administrativeRoles )
     {
         this.administrativeRoles = administrativeRoles;
     }
 
 
-    final Set<AdministrativeRole> getAdministrativeRoles()
+    /**
+     * @return The set of administrative roles for this subentry
+     */
+    public Set<AdministrativeRole> getAdministrativeRoles()
     {
         return administrativeRoles;
     }
@@ -82,7 +141,7 @@ public class Subentry
     /**
      * Tells if the type contains the Collective attribute Administrative Role 
      */
-    final boolean isCollectiveAdminRole()
+    public boolean isCollectiveAdminRole()
     {
         return administrativeRoles.contains( AdministrativeRole.COLLECTIVE_ADMIN_ROLE );
     }
@@ -91,7 +150,7 @@ public class Subentry
     /**
      * Tells if the type contains the SubSchema Administrative Role 
      */
-    final boolean isSchemaAdminRole()
+    public boolean isSchemaAdminRole()
     {
         return administrativeRoles.contains( AdministrativeRole.SUB_SCHEMA_ADMIN_ROLE );
     }
@@ -100,7 +159,7 @@ public class Subentry
     /**
      * Tells if the type contains the Access Control Administrative Role 
      */
-    final boolean isAccessControlAdminRole()
+    public boolean isAccessControlAdminRole()
     {
         return administrativeRoles.contains( AdministrativeRole.ACCESS_CONTROL_ADMIN_ROLE );
     }
@@ -109,17 +168,26 @@ public class Subentry
     /**
      * Tells if the type contains the Triggers Administrative Role 
      */
-    final boolean isTriggersAdminRole()
+    public boolean isTriggersAdminRole()
     {
         return administrativeRoles.contains( AdministrativeRole.TRIGGERS_ADMIN_ROLE );
     }
-    
-    
+
+
+    /**
+     * @return the uuid
+     */
+    public String getUuid()
+    {
+        return uuid;
+    }
+
+
     /**
      * @see Object#toString()
      */
     public String toString()
     {
-        return "Subentry[" + administrativeRoles + ", " + ss + "]";
+        return "Subentry<" + subentryDn + ", " + uuid + ", " + administrativeRoles + ", " + ss + ">";
     }
 }

Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryCache.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryCache.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryCache.java Thu Jul 22 07:06:49 2010
@@ -25,18 +25,16 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.directory.shared.ldap.name.DN;
-
 
 /**
- * A cache for subtree specifications. It associates a Subentry with a DN,
+ * A cache for subtree specifications. It associates a Subentry with an UUID,
  * representing its position in the DIT.<br>
  * This cache has a size limit set to 1000 at the moment. We should add a configuration
  * parameter to manage its size.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SubentryCache implements Iterable<DN>
+public class SubentryCache implements Iterable<Subentry>
 {
     /** The default cache size limit */
     private static final int DEFAULT_CACHE_MAX_SIZE = 1000;
@@ -48,14 +46,14 @@ public class SubentryCache implements It
     private AtomicInteger cacheSize;
     
     /** The Subentry cache */
-    private final Map<DN, Subentry> cache;
+    private final Map<String, Subentry> cache;
     
     /**
      * Creates a new instance of SubentryCache with a default maximum size.
      */
     public SubentryCache()
     {
-        cache = new ConcurrentHashMap<DN, Subentry>();
+        cache = new ConcurrentHashMap<String, Subentry>();
         cacheSize = new AtomicInteger( 0 );
     }
     
@@ -65,34 +63,34 @@ public class SubentryCache implements It
      */
     public SubentryCache( int maxSize )
     {
-        cache = new ConcurrentHashMap<DN, Subentry>();
+        cache = new ConcurrentHashMap<String, Subentry>();
         cacheSize = new AtomicInteger( 0 );
         cacheMaxSize = maxSize;
     }
     
     
     /**
-     * Retrieve a Subentry given a DN. If there is none, null will be returned.
+     * Retrieve a Subentry given a UUID. If there is none, null will be returned.
      *
-     * @param dn The DN we want to get the Subentry for 
+     * @param uuid The UUID we want to get the Subentry for 
      * @return The found Subentry, or null
      */
-    final Subentry getSubentry( DN dn )
+    public Subentry getSubentry( String uuid )
     {
-        return cache.get( dn );
+        return cache.get(uuid );
     }
     
     
     /**
-     * Remove a Subentry for a given DN 
+     * Remove a Subentry for a given UUID 
      *
-     * @param dn The DN for which we want to remove the 
+     * @param uuid The UUID for which we want to remove the 
      * associated Subentry
      * @return The removed Subentry, if any
      */
-    final Subentry removeSubentry( DN dn )
+    public Subentry removeSubentry( String uuid )
     {
-        Subentry oldSubentry = cache.remove( dn );
+        Subentry oldSubentry = cache.remove( uuid );
         
         if ( oldSubentry != null )
         {
@@ -104,21 +102,19 @@ public class SubentryCache implements It
     
     
     /**
-     * Stores a new Subentry into the cache, associated with a DN
+     * Stores a new Subentry into the cache
      *
-     * @param dn The Subentry DN
-     * @param ss The SubtreeSpecification
-     * @param adminRoles The administrative roles for this Subentry
+     * @param subentry The Subentry to add
      * @return The old Subentry, if any
      */
-    /* No qualifier */ Subentry addSubentry( DN dn, Subentry subentry )
+    public Subentry addSubentry( Subentry subentry )
     {
         if ( cacheSize.get() > cacheMaxSize )
         {
             // TODO : Throw an exception here
         }
         
-        Subentry oldSubentry = cache.put( dn, subentry );
+        Subentry oldSubentry = cache.put( subentry.getUuid(), subentry );
         
         if ( oldSubentry == null )
         {
@@ -130,22 +126,22 @@ public class SubentryCache implements It
     
     
     /**
-     * Tells if there is a Subentry associated with a DN
-     * @param dn The DN
+     * Tells if there is a Subentry associated with a UUID
+     * @param uuid The UUID
      * @return True if a Subentry is found
      */
-    /* No qualifier */ boolean hasSubentry( DN dn )
+    public boolean hasSubentry( String uuid )
     {
-        return cache.containsKey( dn );
+        return cache.containsKey( uuid );
     }
     
     
     /**
-     * @return An Iterator over the Subentry's DNs 
+     * @return An Iterator over the Subentry's UUIDs 
      */
-    public Iterator<DN> iterator()
+    public Iterator<Subentry> iterator()
     {
-        return cache.keySet().iterator();
+        return cache.values().iterator();
     }
     
     
@@ -156,4 +152,22 @@ public class SubentryCache implements It
     {
         return cacheSize.get();
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "Subentry cache(" ).append( cacheSize ).append( ")\n" );
+        
+        for ( Subentry subentry : this )
+        {
+            sb.append( "    " ).append( subentry ).append(  '\n' );
+        }
+        
+        return sb.toString();
+    }
 }

Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Thu Jul 22 07:06:49 2010
@@ -42,10 +42,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
-import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
-import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
-import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchingOperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
@@ -66,7 +63,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
-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;
@@ -138,6 +134,9 @@ public class SubentryInterceptor extends
     /** A reference to the TriggerExecutionSubentries AT */
     private static AttributeType TRIGGER_EXECUTION_SUBENTRIES_AT;
     
+    /** A reference to the EntryUUID AT */
+    private static AttributeType ENTRY_UUID_AT;
+    
     /** An enum used for the entries update */
     private enum OperationEnum 
     {
@@ -157,8 +156,10 @@ public class SubentryInterceptor extends
     {
         public boolean accept( SearchingOperationContext searchContext, ClonedServerEntry entry ) throws Exception
         {
+            String entryUuid = entry.get( ENTRY_UUID_AT ).getString();
+            
             // See if the requested entry is a subentry
-            if ( subentryCache.hasSubentry( entry.getDn() ) )
+            if ( subentryCache.hasSubentry( entryUuid ) )
             {
                 return false;
             }
@@ -177,8 +178,10 @@ public class SubentryInterceptor extends
     {
         public boolean accept( SearchingOperationContext searchContext, ClonedServerEntry entry ) throws Exception
         {
+            String entryUuid = entry.get( ENTRY_UUID_AT ).getString();
+
             // See if the requested entry is a subentry
-            if ( subentryCache.hasSubentry( entry.getDn() ) )
+            if ( subentryCache.hasSubentry( entryUuid ) )
             {
                 return true;
             }
@@ -209,9 +212,10 @@ public class SubentryInterceptor extends
         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 );
+        SUBSCHEMA_SUBENTRY_AT = schemaManager.getAttributeType( SchemaConstants.ADS_SUBSCHEMA_SUBENTRIES_AT );
+        COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT = schemaManager.getAttributeType( SchemaConstants.ADS_COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         TRIGGER_EXECUTION_SUBENTRIES_AT = schemaManager.getAttributeType( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT );
+        ENTRY_UUID_AT = schemaManager.getAttributeType( SchemaConstants.ENTRY_UUID_AT );
 
         SUBENTRY_OPATTRS = new AttributeType[]
             { 
@@ -273,12 +277,14 @@ public class SubentryInterceptor extends
                         continue;
                     }
                         
-                    Subentry newSubentry = new Subentry();
+                    String subentryUuid = subentry.get( ENTRY_UUID_AT ).getString();
+                    
+                    Subentry newSubentry = new Subentry( subentryDn, subentryUuid );
                     
                     newSubentry.setAdministrativeRoles( getSubentryAdminRoles( subentry ) );
                     newSubentry.setSubtreeSpecification( ss );
                     
-                    subentryCache.addSubentry( subentryDn, newSubentry );
+                    subentryCache.addSubentry( newSubentry );
                 }
                 
                 subentries.close();
@@ -507,6 +513,9 @@ public class SubentryInterceptor extends
     }
 
 
+    /**
+     * 
+     *
     private List<Modification> getModsOnEntryRdnChange( DN oldName, DN newName, Entry entry ) throws LdapException
     {
         List<Modification> modifications = new ArrayList<Modification>();
@@ -523,11 +532,13 @@ public class SubentryInterceptor extends
          * it did not previously with the old name. Again this situation
          * would be caused by chop exclusions. In this case we must add subentry
          * operational attribute values with the dn of this subentry.
-         */
-        for ( DN subentryDn : subentryCache )
+         *
+        for ( Subentry subentry : subentryCache )
         {
-            DN apDn = subentryDn.getParent();
-            SubtreeSpecification ss = subentryCache.getSubentry( subentryDn ).getSubtreeSpecification();
+            Subentry subentry = subentryCache.getSubentry( subentryUuid );
+            
+            DN apDn = subentry.getAdministrativePointDn();
+            SubtreeSpecification ss = subentry.getSubtreeSpecification();
             boolean isOldNameSelected = evaluator.evaluate( ss, apDn, oldName, entry );
             boolean isNewNameSelected = evaluator.evaluate( ss, apDn, newName, entry );
 
@@ -579,6 +590,9 @@ public class SubentryInterceptor extends
     // Methods dealing with subentry modification
     // -----------------------------------------------------------------------
 
+    /**
+     * 
+     */
     private Set<AdministrativeRole> getSubentryTypes( Entry entry, List<Modification> mods ) throws LdapException
     {
         EntryAttribute ocFinalState = entry.get( OBJECT_CLASS_AT ).clone();
@@ -672,28 +686,29 @@ public class SubentryInterceptor extends
     private List<EntryAttribute> getSubentryOperationalAttributes( DN dn, Subentry subentry ) throws LdapException
     {
         List<EntryAttribute> attributes = new ArrayList<EntryAttribute>();
+        String uuid = subentry.getUuid().toString();
 
         if ( subentry.isAccessControlAdminRole() )
         {
-            EntryAttribute accessControlSubentries = new DefaultEntryAttribute( ACCESS_CONTROL_SUBENTRIES_AT, dn.getNormName() );
+            EntryAttribute accessControlSubentries = new DefaultEntryAttribute( ACCESS_CONTROL_SUBENTRIES_AT, uuid );
             attributes.add( accessControlSubentries );
         }
         
         if ( subentry.isSchemaAdminRole() )
         {
-            EntryAttribute subschemaSubentry = new DefaultEntryAttribute( SUBSCHEMA_SUBENTRY_AT, dn.getNormName() );
+            EntryAttribute subschemaSubentry = new DefaultEntryAttribute( SUBSCHEMA_SUBENTRY_AT, uuid );
             attributes.add( subschemaSubentry );
         }
         
         if ( subentry.isCollectiveAdminRole() )
         {
-            EntryAttribute collectiveAttributeSubentries = new DefaultEntryAttribute( COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT, dn.getNormName() );
+            EntryAttribute collectiveAttributeSubentries = new DefaultEntryAttribute( COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT, uuid );
             attributes.add( collectiveAttributeSubentries );
         }
         
         if ( subentry.isTriggersAdminRole() )
         {
-            EntryAttribute tiggerExecutionSubentries = new DefaultEntryAttribute( TRIGGER_EXECUTION_SUBENTRIES_AT, dn.getNormName() );
+            EntryAttribute tiggerExecutionSubentries = new DefaultEntryAttribute( TRIGGER_EXECUTION_SUBENTRIES_AT, uuid );
             attributes.add( tiggerExecutionSubentries );
         }
 
@@ -774,7 +789,7 @@ public class SubentryInterceptor extends
 
     /**
      * Get the list of modification to apply to all the entries 
-     */
+     *
     private List<Modification> getModsOnEntryModification( DN name, Entry oldEntry, Entry newEntry ) throws LdapException
     {
         List<Modification> modList = new ArrayList<Modification>();
@@ -883,7 +898,8 @@ public class SubentryInterceptor extends
              * this new subentry.
              * ----------------------------------------------------------------
              */
-            Subentry subentry = new Subentry();
+            String subentryUuid = entry.get( SchemaConstants.ENTRY_UUID_AT ).getString();
+            Subentry subentry = new Subentry( entry.getDn(), subentryUuid );
             subentry.setAdministrativeRoles( getSubentryAdminRoles( entry ) );
             List<EntryAttribute> operationalAttributes = getSubentryOperationalAttributes( dn, subentry );
 
@@ -895,7 +911,7 @@ public class SubentryInterceptor extends
              * ----------------------------------------------------------------
              */
             setSubtreeSpecification( subentry, entry );
-            subentryCache.addSubentry( dn, subentry );
+            subentryCache.addSubentry( subentry );
 
             // Now inject the subentry into the backend
             next.add( addContext );
@@ -925,14 +941,14 @@ public class SubentryInterceptor extends
             // We brutally check *all* the subentries, as we don't hold a hierarchy
             // of AP
             // TODO : add a hierarchy of subentries
-            for ( DN subentryDn : subentryCache )
+            for ( Subentry subentry : subentryCache )
             {
+                DN subentryDn = subentry.getDn();
                 DN apDn = subentryDn.getParent();
                 
                 // No need to evaluate the entry if it's not below an AP.
                 if ( dn.isChildOf( apDn ) )
                 {
-                    Subentry subentry = subentryCache.getSubentry( subentryDn );
                     SubtreeSpecification ss = subentry.getSubtreeSpecification();
     
                     // Now, evaluate the entry wrt the subentry ss
@@ -985,7 +1001,8 @@ public class SubentryInterceptor extends
         // We first remove the re
         if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC ) )
         {
-            Subentry removedSubentry = subentryCache.getSubentry( dn );
+            String subentryUuid = entry.get( ENTRY_UUID_AT ).getString();
+            Subentry removedSubentry = subentryCache.getSubentry( subentryUuid );
             
             /* ----------------------------------------------------------------
              * Find the baseDn for the subentry and use that to search the tree
@@ -1002,11 +1019,11 @@ public class SubentryInterceptor extends
             // 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 cache
-            subentryCache.removeSubentry( dn );
-
             // Now delete the subentry itself
             next.delete( deleteContext );
+
+            // Update the cache
+            subentryCache.removeSubentry( subentryUuid );
         }
         else
         {
@@ -1035,7 +1052,7 @@ public class SubentryInterceptor extends
 
     /**
      * {@inheritDoc}
-     */
+     *
     public void modify( NextInterceptor next, ModifyOperationContext modifyContext ) throws LdapException
     {
         DN dn = modifyContext.getDn();
@@ -1202,7 +1219,7 @@ public class SubentryInterceptor extends
      * @param next The next interceptor in the chain
      * @param moveContext The context containing all the needed informations to proceed
      * @throws LdapException If the move failed
-     */
+     *
     public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
     {
         DN oldDn = moveContext.getDn();
@@ -1303,6 +1320,9 @@ public class SubentryInterceptor extends
     }
 
 
+    /**
+     * 
+     *
     public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
     {
         DN oldDn = moveAndRenameContext.getDn();
@@ -1386,6 +1406,9 @@ public class SubentryInterceptor extends
     }
 
 
+    /**
+     * 
+     *
     public void rename( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException
     {
         DN oldDn = renameContext.getDn();
@@ -1500,6 +1523,15 @@ public class SubentryInterceptor extends
     // Shared method
     //-------------------------------------------------------------------------------------------
     /**
+     * @return the reference on the subentry cache. 
+     */
+    public SubentryCache getSubentryCache()
+    {
+        return subentryCache;
+    }
+    
+    
+    /**
      * Evaluates the set of subentry subtrees upon an entry and returns the
      * operational subentry attributes that will be added to the entry if
      * added at the dn specified.
@@ -1513,10 +1545,10 @@ public class SubentryInterceptor extends
     {
         Entry subentryAttrs = new DefaultEntry( schemaManager, dn );
 
-        for ( DN subentryDn : subentryCache )
+        for ( Subentry subentry : subentryCache )
         {
+            DN subentryDn = subentry.getDn();
             DN apDn = subentryDn.getParent();
-            Subentry subentry = subentryCache.getSubentry( subentryDn );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
 
             if ( evaluator.evaluate( ss, apDn, dn, entryAttrs ) )

Modified: directory/shared/branches/shared-subtree/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-subtree/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/shared/branches/shared-subtree/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java (original)
+++ directory/shared/branches/shared-subtree/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java Thu Jul 22 07:06:49 2010
@@ -585,7 +585,7 @@ public enum I18n
     ERR_04444( "ERR_04444" ),
     ERR_04445( "ERR_04445" ),
     ERR_04446( "ERR_04446" ),
-    ERR_04447( "ERR_04447" ),
+    ERR_04447_CANNOT_NORMALIZE_VALUE( "ERR_04447_CANNOT_NORMALIZE_VALUE" ),
     ERR_04448( "ERR_04448" ),
     ERR_04449( "ERR_04449" ),
     ERR_04450( "ERR_04450" ),

Modified: directory/shared/branches/shared-subtree/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-subtree/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/shared/branches/shared-subtree/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties (original)
+++ directory/shared/branches/shared-subtree/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties Thu Jul 22 07:06:49 2010
@@ -569,7 +569,7 @@ ERR_04443=Failed to compare normalized v
 ERR_04444=I don't really know how to compare anything other than ServerBinaryValues at this point in time.
 ERR_04445=There is no Syntax associated with this attributeType
 ERR_04446=Cannot use standard serialization for a ServerStringValue
-ERR_04447=Cannot normalize the wrapped value {0}
+ERR_04447_CANNOT_NORMALIZE_VALUE=Cannot normalize the wrapped value {0}
 ERR_04448=I don't know what to do if value is not a ServerStringValue
 ERR_04449=The value ''{0}'' can't be normalized, it hasn't been added
 ERR_04450=The value ''{0}'' is incorrect, it hasn't been added
@@ -578,7 +578,7 @@ ERR_04452=The value must be a byte[], as
 ERR_04453=The upID ({0}) is not an OID or is different from the AttributeType OID ({1})
 ERR_04454=Cannot use standard serialization for a ServerAttribute
 ERR_04455=The ID ''{0}''is incompatible with the AttributeType's id ''{1}''
-ERR_04456=An ID cannnot be null, empty, or resolved to an emtpy value when trimmed
+ERR_04456=An ID cannot be null, empty, or resolved to an emtpy value when trimmed
 ERR_04457_NULL_ATTRIBUTE_ID=The ID should not be null or empty
 ERR_04458=Cannot add an attribute without an ID
 ERR_04459=We have had an error while adding the ''{0}'' AttributeType : {1}

Modified: directory/shared/branches/shared-subtree/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-subtree/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/shared/branches/shared-subtree/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java (original)
+++ directory/shared/branches/shared-subtree/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java Thu Jul 22 07:06:49 2010
@@ -438,7 +438,15 @@ public interface SchemaConstants
 
     // TriggerExecutionSubentries
     String TRIGGER_EXECUTION_SUBENTRIES_AT          = "triggerExecutionSubentries";
-    String TRIGGER_EXECUTION_SUBENTRIES_AT_OID      = "1.3.6.1.4.1.18060.0.4.1.2.27";
+    String TRIGGER_EXECUTION_SUBENTRIES_AT_OID      = "1.3.6.1.4.1.18060.0.4.1.2.12";
+
+    // Ads-SubschemaSubentries
+    String ADS_SUBSCHEMA_SUBENTRIES_AT              = "ads-subschemaSubentries";
+    String ADS_SUBSCHEMA_SUBENTRIES_AT_OID          = "1.3.6.1.4.1.18060.0.4.1.2.13";
+
+    // Ads-CollectiveAttributeSubentries
+    String ADS_COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT   = "ads-collectiveAttributeSubentries";
+    String ADS_COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT_OID = "1.3.6.1.4.1.18060.0.4.1.2.14";
 
     // Comparators
     String COMPARATORS_AT                           = "comparators";

Modified: directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerEnableDisableLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerEnableDisableLoadTest.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerEnableDisableLoadTest.java (original)
+++ directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerEnableDisableLoadTest.java Thu Jul 22 07:06:49 2010
@@ -149,14 +149,14 @@ public class SchemaManagerEnableDisableL
         assertEquals( 0, disabled.size() );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 389, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 391, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 48, schemaManager.getComparatorRegistry().size() );
         assertEquals( 48, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 48, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 114, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 66, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 71, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 622, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 624, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 12, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNull( schemaManager.getRegistries().getLoadedSchema( "nis" ) );
@@ -194,14 +194,14 @@ public class SchemaManagerEnableDisableL
         assertNotNull( schemaManager.lookupAttributeTypeRegistry( "gecos" ) );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 416, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 418, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 49, schemaManager.getComparatorRegistry().size() );
         assertEquals( 49, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 49, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 127, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 68, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 73, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 665, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 667, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 13, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "nis" ) );
@@ -234,14 +234,14 @@ public class SchemaManagerEnableDisableL
         }
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 389, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 391, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 48, schemaManager.getComparatorRegistry().size() );
         assertEquals( 48, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 48, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 114, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 66, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 71, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 622, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 624, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 12, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNull( schemaManager.getRegistries().getLoadedSchema( "nis" ) );

Modified: directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java (original)
+++ directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java Thu Jul 22 07:06:49 2010
@@ -282,14 +282,14 @@ public class SchemaManagerLoadTest
         assertTrue( schemaManager.load( "apache" ) );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 146, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 148, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 43, schemaManager.getComparatorRegistry().size() );
         assertEquals( 43, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 43, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 53, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 62, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 66, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 308, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 310, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );

Modified: directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java (original)
+++ directory/shared/branches/shared-subtree/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java Thu Jul 22 07:06:49 2010
@@ -167,14 +167,14 @@ public class SchemaManagerLoadWithDepsTe
         schemaManager.loadWithDeps( "apache" );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 146, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 148, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 43, schemaManager.getComparatorRegistry().size() );
         assertEquals( 43, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 43, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 53, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 62, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 66, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 308, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 310, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
@@ -251,14 +251,14 @@ public class SchemaManagerLoadWithDepsTe
         schemaManager.loadWithDeps( "other" );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 177, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 179, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 48, schemaManager.getComparatorRegistry().size() );
         assertEquals( 48, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 48, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 66, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 66, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 71, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 362, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 364, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 5, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );

Modified: directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.11.ldif
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.11.ldif?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.11.ldif (original)
+++ directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.11.ldif Thu Jul 22 07:06:49 2010
@@ -10,10 +10,11 @@ m-collective: FALSE
 m-oid: 1.3.6.1.4.1.18060.0.4.1.2.11
 entrycsn: 20090818052729.367000Z#000000#000#000000
 m-nousermodification: TRUE
-m-syntax: 1.3.6.1.4.1.1466.115.121.1.12
+m-syntax: 1.3.6.1.1.16.1
 objectclass: metaAttributeType
 objectclass: metaTop
 objectclass: top
 m-name: accessControlSubentries
-m-equality: distinguishedNameMatch
+m-equality: uuidMatch
+m-ordering: uuidOrderingMatch
 

Copied: directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.12.ldif (from r965546, directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.27.ldif)
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.12.ldif?p2=directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.12.ldif&p1=directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.27.ldif&r1=965546&r2=966520&rev=966520&view=diff
==============================================================================
--- directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.27.ldif (original)
+++ directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.12.ldif Thu Jul 22 07:06:49 2010
@@ -1,20 +1,21 @@
 version: 1
-dn: m-oid=1.3.6.1.4.1.18060.0.4.1.2.27,ou=attributeTypes,cn=apache,ou=schema
+dn: m-oid=1.3.6.1.4.1.18060.0.4.1.2.12,ou=attributeTypes,cn=apache,ou=schema
 createtimestamp: 20090818022729Z
 m-singlevalue: FALSE
 m-obsolete: FALSE
-m-description: Used to track subentries associated with a trigger area which an 
- entry falls under
+m-description: Used to track subentries associated with a trigger area which an
+  entry falls under
 m-usage: DIRECTORY_OPERATION
 creatorsname: uid=admin,ou=system
 m-collective: FALSE
-m-oid: 1.3.6.1.4.1.18060.0.4.1.2.27
+m-oid: 1.3.6.1.4.1.18060.0.4.1.2.12
 entrycsn: 20090818052729.833000Z#000000#000#000000
 m-nousermodification: TRUE
-m-syntax: 1.3.6.1.4.1.1466.115.121.1.12
+m-syntax: 1.3.6.1.1.16.1
 objectclass: metaAttributeType
 objectclass: metaTop
 objectclass: top
 m-name: triggerExecutionSubentries
-m-equality: distinguishedNameMatch
+m-equality: uuidMatch
+m-ordering: uuidOrderingMatch
 

Added: directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.13.ldif
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.13.ldif?rev=966520&view=auto
==============================================================================
--- directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.13.ldif (added)
+++ directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.13.ldif Thu Jul 22 07:06:49 2010
@@ -0,0 +1,21 @@
+version: 1
+dn: m-oid=1.3.6.1.4.1.18060.0.4.1.2.13,ou=attributeTypes,cn=apache,ou=schema
+createtimestamp: 20090818022729Z
+m-singlevalue: FALSE
+m-obsolete: FALSE
+m-description: Used to track subentries associated with a subschema area which 
+ an entry falls under
+m-usage: DIRECTORY_OPERATION
+creatorsname: uid=admin,ou=system
+m-collective: FALSE
+m-oid: 1.3.6.1.4.1.18060.0.4.1.2.13
+entrycsn: 20090818052729.833000Z#000000#000#000000
+m-nousermodification: TRUE
+m-syntax: 1.3.6.1.1.16.1
+objectclass: metaAttributeType
+objectclass: metaTop
+objectclass: top
+m-name: ads-subschemaSubentries
+m-equality: uuidMatch
+m-ordering: uuidOrderingMatch
+

Added: directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.14.ldif
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.14.ldif?rev=966520&view=auto
==============================================================================
--- directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.14.ldif (added)
+++ directory/shared/branches/shared-subtree/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.14.ldif Thu Jul 22 07:06:49 2010
@@ -0,0 +1,21 @@
+version: 1
+dn: m-oid=1.3.6.1.4.1.18060.0.4.1.2.14,ou=attributeTypes,cn=apache,ou=schema
+createtimestamp: 20090818022729Z
+m-singlevalue: FALSE
+m-obsolete: FALSE
+m-description: Used to track subentries associated with a collectiveAttribute a
+ rea which an entry falls under
+m-usage: DIRECTORY_OPERATION
+creatorsname: uid=admin,ou=system
+m-collective: FALSE
+m-oid: 1.3.6.1.4.1.18060.0.4.1.2.14
+entrycsn: 20090818052729.833000Z#000000#000#000000
+m-nousermodification: TRUE
+m-syntax: 1.3.6.1.1.16.1
+objectclass: metaAttributeType
+objectclass: metaTop
+objectclass: top
+m-name: ads-collectiveAttributeSubentries
+m-equality: uuidMatch
+m-ordering: uuidOrderingMatch
+

Modified: directory/shared/branches/shared-subtree/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-subtree/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java?rev=966520&r1=966519&r2=966520&view=diff
==============================================================================
--- directory/shared/branches/shared-subtree/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java (original)
+++ directory/shared/branches/shared-subtree/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java Thu Jul 22 07:06:49 2010
@@ -19,9 +19,8 @@
  */
 package org.apache.directory.shared.ldap.entry;
 
-import org.apache.directory.shared.ldap.exception.LdapException;
-
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.LdapComparator;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
@@ -129,7 +128,7 @@ public abstract class AbstractValue<T> i
         }
         catch ( LdapException le )
         {
-            String message = I18n.err( I18n.ERR_04447, le.getLocalizedMessage() );
+            String message = I18n.err( I18n.ERR_04447_CANNOT_NORMALIZE_VALUE, le.getLocalizedMessage() );
             LOG.info( message );
             normalized = false;
         }
@@ -142,7 +141,7 @@ public abstract class AbstractValue<T> i
         }
         catch ( LdapException ne )
         {
-            String message = I18n.err( I18n.ERR_04447, ne.getLocalizedMessage() );
+            String message = I18n.err( I18n.ERR_04447_CANNOT_NORMALIZE_VALUE, ne.getLocalizedMessage() );
             LOG.info( message );
             normalized = false;
         }