directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r815492 - in /directory/apacheds/branches/apacheds-schema: core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ core-api/src/main/java/org/apache/directory/server/core/schema/ core-api/src/main/java/org/apache/direct...
Date Tue, 15 Sep 2009 21:14:19 GMT
Author: elecharny
Date: Tue Sep 15 21:14:14 2009
New Revision: 815492

URL: http://svn.apache.org/viewvc?rev=815492&view=rev
Log:
o Renamed a DN constant for clarity
o Cleaned up a bit the modify() op in operationalAttribute interceptor
o Added a static constant for schemaModificationAttributesDN in schemaInterceptor 
o Added a initialize() method in the SchemaService interface
o Simplified a lot the modify() operation in schemaInterceptor
o Called the SchemaService.initialize() method from the DS initialize method
o remobed the 'entry' field from the ModifyOperationContext, as it's already present in the inherited class
o Fixed an infinite loop in the schemaPartition, as we were updating some fields through a call which ends at the same place, looping again
o Fixed the RegistrySynchronizerAdaptor.modify() operation to get it exit if the schemaModificationAttributes were modified

Modified:
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
    directory/apacheds/branches/apacheds-schema/core-constants/src/main/java/org/apache/directory/server/constants/ServerDNConstants.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesITest.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java?rev=815492&r1=815491&r2=815492&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java Tue Sep 15 21:14:14 2009
@@ -26,7 +26,6 @@
 import javax.naming.NamingException;
 
 import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.entry.ServerModification;
@@ -34,8 +33,8 @@
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.client.ClientModification;
-import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.InternalModifyRequest;
+import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.control.ManageDsaITControl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
@@ -54,10 +53,6 @@
     /** The modification items */
     private List<Modification> modItems;
     
-    /** Cloned entry that is modified */
-    private ClonedServerEntry entry;
-
-
     /**
      * Creates a new instance of ModifyOperationContext.
      */
@@ -143,18 +138,6 @@
     }
 
     
-    public void setEntry( ClonedServerEntry entry )
-    {
-        this.entry = entry;
-    }
-    
-    
-    public ClonedServerEntry getEntry()
-    {
-        return entry;
-    }
-
-    
     /**
      * @see Object#toString()
      */

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java?rev=815492&r1=815491&r2=815492&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java Tue Sep 15 21:14:14 2009
@@ -121,6 +121,9 @@
     /** registry synchronizer adaptor */
     private RegistrySynchronizerAdaptor synchronizer;
     
+    /** A static DN for the ou=schemaModifications entry */
+    private static LdapDN schemaModificationDN;
+    
     
     /**
      * Sets the wrapped {@link Partition} which must be supplied or 
@@ -254,6 +257,9 @@
         }
 
         loader.loadAllEnabled( registries );  
+        
+        schemaModificationDN = new LdapDN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
+        schemaModificationDN.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
     }
     
     
@@ -336,18 +342,31 @@
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.partition.Partition#modify(org.apache.directory.server.core.interceptor.context.ModifyOperationContext)
+    /**
+     * {@inheritDoc}
      */
     public void modify( ModifyOperationContext opContext ) throws Exception
     {
+        ServerEntry entry = opContext.getEntry();
+        
+        if ( entry == null )
+        {
+            LookupOperationContext lookupCtx = new LookupOperationContext( opContext.getSession(), opContext.getDn() );
+            entry = wrapped.lookup( lookupCtx );
+        }
+        
         ServerEntry targetEntry = ( ServerEntry ) SchemaUtils.getTargetEntry( 
-            opContext.getModItems(), opContext.getEntry() );
+            opContext.getModItems(), entry );
         
         boolean cascade = opContext.hasRequestControl( CascadeControl.CONTROL_OID );
+        
         synchronizer.modify( opContext, opContext.getEntry(), targetEntry, cascade );
         wrapped.modify( opContext );
-        updateSchemaModificationAttributes( opContext );
+        
+        if ( !opContext.getDn().equals( schemaModificationDN ) )
+        {
+            updateSchemaModificationAttributes( opContext );
+        }
     }
 
 
@@ -446,7 +465,7 @@
                 registries.getAttributeTypeRegistry().lookup( ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT ),
                 modifiersName ) ) );
         
-        LdapDN name = new LdapDN( ServerDNConstants.SCHEMA_TIMESTAMP_ENTRY_DN );
+        LdapDN name = new LdapDN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
         name.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
         
         opContext.modify( name, mods, ByPassConstants.SCHEMA_MODIFICATION_ATTRIBUTES_UPDATE_BYPASS );

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?rev=815492&r1=815491&r2=815492&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Tue Sep 15 21:14:14 2009
@@ -17,19 +17,27 @@
      * @return <code>true</code> if the given DN is the Schema subentry DN
      * @throws NamingException If the given DN is not valid
      */
-    public abstract boolean isSchemaSubentry( String dnString ) throws NamingException;
+    abstract boolean isSchemaSubentry( String dnString ) throws NamingException;
 
 
     /**
      * @return the registries loaded from schemaPartition
      */
-    public abstract Registries getRegistries();
+    abstract Registries getRegistries();
 
 
-    public abstract SchemaPartition getSchemaPartition();
+    abstract SchemaPartition getSchemaPartition();
 
 
-    public abstract void setSchemaPartition( SchemaPartition schemaPartition );
+    abstract void setSchemaPartition( SchemaPartition schemaPartition );
+    
+    
+    /**
+     * Initializes the SchemaService
+     *
+     * @throws Exception If the initializaion fails
+     */
+    void initialize() throws Exception;
 
 
     /**
@@ -38,7 +46,7 @@
      * @return the schemaSubentry
      * @throws NamingException if there is a failure to access schema timestamps
      */
-    public abstract ServerEntry getSubschemaEntryImmutable() throws Exception;
+    abstract ServerEntry getSubschemaEntryImmutable() throws Exception;
 
 
     /**
@@ -47,7 +55,7 @@
      * @return the schemaSubentry
      * @throws NamingException if there is a failure to access schema timestamps
      */
-    public abstract ServerEntry getSubschemaEntryCloned() throws Exception;
+    abstract ServerEntry getSubschemaEntryCloned() throws Exception;
 
 
     /**
@@ -58,6 +66,5 @@
      * @return the subschema entry with the ids provided
      * @throws NamingException if there are failures during schema info access
      */
-    public abstract ServerEntry getSubschemaEntry( String[] ids ) throws Exception;
-
+    abstract ServerEntry getSubschemaEntry( String[] ids ) throws Exception;
 }
\ No newline at end of file

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java?rev=815492&r1=815491&r2=815492&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java Tue Sep 15 21:14:14 2009
@@ -25,6 +25,7 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
@@ -48,7 +49,6 @@
 import org.apache.directory.shared.ldap.schema.SchemaObject;
 import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -304,6 +304,11 @@
             return;
         }
 
+        if ( oc.contains(  ApacheSchemaConstants.SCHEMA_MODIFICATION_ATTRIBUTES_OC ) )
+        {
+            return;
+        }
+        
         LOG.error( String.format( "Unwilling to perform modify on %s:\n\nEntry:\n%s\n\nModifications:\n%s", 
             opContext.getDn(), entry, opContext.getModItems() ) );
         throw new LdapOperationNotSupportedException( ResultCodeEnum.UNWILLING_TO_PERFORM );

Modified: directory/apacheds/branches/apacheds-schema/core-constants/src/main/java/org/apache/directory/server/constants/ServerDNConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-constants/src/main/java/org/apache/directory/server/constants/ServerDNConstants.java?rev=815492&r1=815491&r2=815492&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-constants/src/main/java/org/apache/directory/server/constants/ServerDNConstants.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-constants/src/main/java/org/apache/directory/server/constants/ServerDNConstants.java Tue Sep 15 21:14:14 2009
@@ -59,8 +59,8 @@
     /** the normalized DN for the schema in DIT area */
     public static final String OU_SCHEMA_DN_NORMALIZED = "2.5.4.11=schema";
     
-    /** The DN for the schema modification's timestamp */
-    public static final String SCHEMA_TIMESTAMP_ENTRY_DN = "cn=schemaModifications,ou=schema";
+    /** The DN for the schema modifications */
+    public static final String SCHEMA_MODIFICATIONS_DN = "cn=schemaModifications,ou=schema";
     
     /** the base dn under which all users reside */
     public static final String USERS_SYSTEM_DN = "ou=users,ou=system";

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesITest.java?rev=815492&r1=815491&r2=815492&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesITest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesITest.java Tue Sep 15 21:14:14 2009
@@ -90,6 +90,7 @@
         LdapContext schemaRoot = getSchemaContext( service );
         Attributes nisAttrs = schemaRoot.getAttributes( "cn=nis" );
         boolean isNisDisabled = false;
+        
         if ( nisAttrs.get( "m-disabled" ) != null )
         {
             isNisDisabled = ( ( String ) nisAttrs.get( "m-disabled" ).get() ).equalsIgnoreCase( "TRUE" );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=815492&r1=815491&r2=815492&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Tue Sep 15 21:14:14 2009
@@ -1410,7 +1410,8 @@
         }
 
         // triggers partition to load schema fully from schema partition
-        schemaService.getSchemaPartition().initialize( );
+        schemaService.initialize();
+        schemaService.getSchemaPartition().initialize();
         partitions.add( schemaService.getSchemaPartition() );
         systemPartition.getSuffixDn().normalize( getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=815492&r1=815491&r2=815492&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Tue Sep 15 21:14:14 2009
@@ -206,6 +206,11 @@
     public void modify( NextInterceptor nextInterceptor, ModifyOperationContext opContext )
         throws Exception
     {
+        // We must check that the user hasn't injected either the modifiersName
+        // or the modifyTimestamp operational attributes : they are not supposed to be
+        // added at this point.
+        // If so, remove them, and if there are no more attributes, simply return.
+        // otherwise, inject those values into the list of modifications
         nextInterceptor.modify( opContext );
         
         if ( opContext.getDn().getNormName().equals( subschemaSubentryDn.getNormName() ) ) 
@@ -216,27 +221,24 @@
         // -------------------------------------------------------------------
         // Add the operational attributes for the modifier first
         // -------------------------------------------------------------------
-        
+        // TODO : Why can't we add those elements on teh original modifications ???
+        // Or into the context ?
         List<Modification> modItemList = new ArrayList<Modification>(2);
         
         AttributeType modifiersNameAt = atRegistry.lookup( SchemaConstants.MODIFIERS_NAME_AT );
         ServerAttribute attribute = new DefaultServerAttribute( 
-            SchemaConstants.MODIFIERS_NAME_AT,
             modifiersNameAt, 
             getPrincipal().getName());
 
         Modification modifiers = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
-        //modifiers.setServerModified();
         modItemList.add( modifiers );
         
         AttributeType modifyTimeStampAt = atRegistry.lookup( SchemaConstants.MODIFY_TIMESTAMP_AT );
         attribute = new DefaultServerAttribute( 
-            SchemaConstants.MODIFY_TIMESTAMP_AT,
             modifyTimeStampAt,
             DateUtils.getGeneralizedTime() );
         
         Modification timestamp = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
-        //timestamp.setServerModified();
         modItemList.add( timestamp );
 
         // -------------------------------------------------------------------
@@ -245,6 +247,7 @@
 
         ModifyOperationContext newModify = new ModifyOperationContext( opContext.getSession(), 
             opContext.getDn(), modItemList );
+        newModify.setEntry( opContext.getEntry() );
         service.getPartitionNexus().modify( newModify );
     }
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java?rev=815492&r1=815491&r2=815492&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java Tue Sep 15 21:14:14 2009
@@ -19,6 +19,12 @@
 package org.apache.directory.server.core.schema;
 
 
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.naming.NamingException;
+
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
@@ -33,22 +39,16 @@
 import org.apache.directory.shared.ldap.schema.DITContentRule;
 import org.apache.directory.shared.ldap.schema.DITStructureRule;
 import org.apache.directory.shared.ldap.schema.LdapComparator;
+import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.MatchingRuleUse;
 import org.apache.directory.shared.ldap.schema.NameForm;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
-import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 
-import javax.naming.NamingException;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
 
 /**
  * This class manage the Schema's operations. 
@@ -67,10 +67,11 @@
     /** a handle on the schema partition */
     private SchemaPartition schemaPartition;
 
-    /**
-     * the normalized name for the schema modification attributes
-     */
+    /** the normalized name for the schema modification attributes */
     private LdapDN schemaModificationAttributesDN;
+    
+    /** A lock to avid concurrent generation of the SubschemaSubentry */
+    private Object schemaSubentrLock = new Object();
 
     
     public DefaultSchemaService() throws Exception
@@ -120,16 +121,6 @@
     public void setSchemaPartition( SchemaPartition schemaPartition )
     {
         this.schemaPartition = schemaPartition;
-        try
-        {
-            schemaModificationAttributesDN = new LdapDN( ServerDNConstants.SCHEMA_TIMESTAMP_ENTRY_DN );
-            schemaModificationAttributesDN.normalize( 
-                getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
-        }
-        catch ( NamingException e )
-        {
-            throw new RuntimeException( e );
-        }
     }
 
 
@@ -320,11 +311,14 @@
     }
 
 
+    /**
+     * Creates the SSSE by extracting all the SchemaObjects from the registries.
+     */
     private void generateSchemaSubentry( ServerEntry mods ) throws NamingException
     {
         ServerEntry attrs = new DefaultServerEntry( getRegistries(), mods.getDn() );
 
-        // add the objectClass attribute
+        // add the objectClass attribute : 'top', 'subschema', 'subentry' and 'apacheSubschema' 
         attrs.put( SchemaConstants.OBJECT_CLASS_AT, 
             SchemaConstants.TOP_OC,
             SchemaConstants.SUBSCHEMA_OC,
@@ -354,24 +348,18 @@
         // -------------------------------------------------------------------
 
         // Add the createTimestamp
-        AttributeType createTimestampAT = getRegistries().
-            getAttributeTypeRegistry().lookup( SchemaConstants.CREATE_TIMESTAMP_AT );
-        EntryAttribute createTimestamp = mods.get( createTimestampAT );
+        EntryAttribute createTimestamp = mods.get( SchemaConstants.CREATE_TIMESTAMP_AT );
         attrs.put( SchemaConstants.CREATE_TIMESTAMP_AT, createTimestamp.get() );
 
         // Add the creatorsName
         attrs.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN );
 
         // Add the modifyTimestamp
-        AttributeType schemaModifyTimestampAT = getRegistries().
-            getAttributeTypeRegistry().lookup( ApacheSchemaConstants.SCHEMA_MODIFY_TIMESTAMP_AT );
-        EntryAttribute schemaModifyTimestamp = mods.get( schemaModifyTimestampAT );
+        EntryAttribute schemaModifyTimestamp = mods.get( ApacheSchemaConstants.SCHEMA_MODIFY_TIMESTAMP_AT );
         attrs.put( SchemaConstants.MODIFY_TIMESTAMP_AT, schemaModifyTimestamp.get() );
 
         // Add the modifiersName
-        AttributeType schemaModifiersNameAT = getRegistries().
-            getAttributeTypeRegistry().lookup( ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT );
-        EntryAttribute schemaModifiersName = mods.get( schemaModifiersNameAT );
+        EntryAttribute schemaModifiersName = mods.get( ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT );
         attrs.put( SchemaConstants.MODIFIERS_NAME_AT, schemaModifiersName.get() );
 
         // don't swap out if a request for the subentry is in progress or we
@@ -394,18 +382,41 @@
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaService#getSubschemaEntryImmutable()
+    /**
+     * {@inheritDoc}
      */
     public ServerEntry getSubschemaEntryImmutable() throws Exception
     {
-        if ( schemaSubentry == null )
+        synchronized ( schemaSubentrLock )
         {
-            generateSchemaSubentry( schemaPartition.lookup(
-                    new LookupOperationContext( null, schemaModificationAttributesDN ) ) );
+            if ( schemaSubentry == null )
+            {
+                generateSchemaSubentry( schemaPartition.lookup(
+                        new LookupOperationContext( null, schemaModificationAttributesDN ) ) );
+            }
+    
+            return ( ServerEntry ) schemaSubentry.clone();
+        }
+    }
+    
+    
+    /**
+     * Initializes the SchemaService
+     *
+     * @throws Exception If the initializaion fails
+     */
+    public void initialize() throws Exception
+    {
+        try
+        {
+            schemaModificationAttributesDN = new LdapDN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
+            schemaModificationAttributesDN.normalize( 
+                getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
+        }
+        catch ( NamingException e )
+        {
+            throw new RuntimeException( e );
         }
-
-        return ( ServerEntry ) schemaSubentry.clone();
     }
 
 
@@ -424,8 +435,8 @@
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.schema.SchemaService#getSubschemaEntry(java.lang.String[])
+    /**
+     * {@inheritDoc}
      */
     public ServerEntry getSubschemaEntry( String[] ids ) throws Exception
     {
@@ -445,7 +456,9 @@
             // ---------------------------------------------------------------
 
             ServerEntry mods = 
-                schemaPartition.lookup( new LookupOperationContext( null, schemaModificationAttributesDN ) );
+                schemaPartition.lookup( 
+                    new LookupOperationContext( null, schemaModificationAttributesDN ) );
+            
 // @todo enable this optimization at some point but for now it
 // is causing some problems so I will just turn it off
 //          Attribute modifyTimeDisk = mods.get( SchemaConstants.MODIFY_TIMESTAMP_AT );
@@ -561,6 +574,7 @@
             }
 
             int minSetSize = 0;
+            
             if ( setOids.contains( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES ) )
             {
                 minSetSize++;

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=815492&r1=815491&r2=815492&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Tue Sep 15 21:14:14 2009
@@ -57,11 +57,6 @@
 import org.apache.directory.server.core.interceptor.context.SearchingOperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
-import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
-import org.apache.directory.shared.ldap.schema.syntaxCheckers.AcceptAllSyntaxChecker;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.cursor.EmptyCursor;
@@ -76,7 +71,6 @@
 import org.apache.directory.shared.ldap.exception.LdapAttributeInUseException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeIdentifierException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.filter.ApproximateNode;
@@ -100,9 +94,13 @@
 import org.apache.directory.shared.ldap.schema.AttributeTypeOptions;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
-import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
+import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
+import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
+import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.syntaxCheckers.AcceptAllSyntaxChecker;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -123,7 +121,10 @@
     private static Logger LOG = LoggerFactory.getLogger( SchemaInterceptor.class );
 
     private static final String[] SCHEMA_SUBENTRY_RETURN_ATTRIBUTES = new String[]
-        { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES };
+        { 
+            SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, 
+            SchemaConstants.ALL_USER_ATTRIBUTES 
+        };
 
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
@@ -217,7 +218,7 @@
         subschemaSubentryDn.normalize( atRegistry.getNormalizerMapping() );
         subschemaSubentryDnNorm = subschemaSubentryDn.getNormName();
 
-        schemaModificationAttributesDN = new LdapDN( ServerDNConstants.SCHEMA_TIMESTAMP_ENTRY_DN );
+        schemaModificationAttributesDN = new LdapDN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
         schemaModificationAttributesDN.normalize( atRegistry.getNormalizerMapping() );
 
         computeSuperiors();
@@ -1163,326 +1164,6 @@
     }
 
 
-    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws Exception
-    {
-        ServerEntry entry;
-        LdapDN name = opContext.getDn();
-        List<Modification> mods = opContext.getModItems();
-
-        // handle operations against the schema subentry in the schema service
-        // and never try to look it up in the nexus below
-        if ( name.getNormName().equalsIgnoreCase( subschemaSubentryDnNorm ) )
-        {
-            entry = schemaService.getSubschemaEntry( SCHEMA_SUBENTRY_RETURN_ATTRIBUTES );
-            entry.setDn( name );
-        }
-        else
-        {
-            // Get the entry we already read at the beginning
-            entry = opContext.getEntry();
-        }
-        
-        boolean schemaModification = name.startsWith( schemaBaseDN );
-        boolean subSchemaModification = subschemaSubentryDnNorm.equals( name.getNormName() );
-
-        // First, we get the entry from the backend. If it does not exist, then we throw an exception
-        ServerEntry targetEntry = (ServerEntry)SchemaUtils.getTargetEntry( mods , entry );
-
-        if ( entry == null )
-        {
-            LOG.error( "No entry with this name :{}", name );
-            throw new LdapNameNotFoundException( "The entry which name is " + name + " is not found." );
-        }
-
-        // We will use this temporary entry to check that the modifications
-        // can be applied as atomic operations
-        ServerEntry tmpEntry = ( ServerEntry ) entry.clone();
-
-        Set<String> modset = new HashSet<String>();
-        Modification objectClassMod = null;
-
-        // Check that we don't have two times the same modification.
-        // This is somehow useless, as modification operations are supposed to
-        // be atomic, so we may have a sucession of Add, DEL, ADD operations
-        // for the same attribute, and this will be legal.
-        // @TODO : check if we can remove this test.
-        for ( Modification mod : mods )
-        {
-            if ( mod.getAttribute().getId().equalsIgnoreCase( SchemaConstants.OBJECT_CLASS_AT ) )
-            {
-                objectClassMod = mod;
-            }
-
-            // Freak out under some weird cases
-            if ( mod.getAttribute().size() == 0 )
-            {
-                // not ok for add but ok for replace and delete
-                if ( mod.getOperation() == ModificationOperation.ADD_ATTRIBUTE )
-                {
-                    throw new LdapInvalidAttributeValueException( "No value is not a valid value for an attribute.",
-                        ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
-                }
-            }
-
-            StringBuffer keybuf = new StringBuffer();
-            keybuf.append( mod.getOperation() );
-            keybuf.append( mod.getAttribute().getId() );
-
-            for ( Value<?> value : ( ServerAttribute ) mod.getAttribute() )
-            {
-                keybuf.append( value.getString() );
-            }
-
-            if ( !modset.add( keybuf.toString() ) && ( mod.getOperation() == ModificationOperation.ADD_ATTRIBUTE ) )
-            {
-                throw new LdapAttributeInUseException( "found two copies of the following modification item: " + mod );
-            }
-        }
-
-        // Get the objectClass attribute.
-        EntryAttribute objectClass;
-
-        if ( objectClassMod == null )
-        {
-            objectClass = entry.get( SchemaConstants.OBJECT_CLASS_AT );
-
-            if ( objectClass == null )
-            {
-                objectClass = new DefaultServerAttribute( SchemaConstants.OBJECT_CLASS_AT, OBJECT_CLASS );
-            }
-        }
-        else
-        {
-            objectClass = getResultantObjectClasses( objectClassMod.getOperation(), objectClassMod.getAttribute(),
-                tmpEntry.get( SchemaConstants.OBJECT_CLASS_AT ).clone() );
-        }
-
-        ObjectClassRegistry ocRegistry = this.registries.getObjectClassRegistry();
-
-        // Now, apply the modifications on the cloned entry before applying it on the
-        // real object.
-        for ( Modification mod : mods )
-        {
-            ModificationOperation modOp = mod.getOperation();
-            ServerAttribute change = ( ServerAttribute ) mod.getAttribute();
-
-            // TODO/ handle http://issues.apache.org/jira/browse/DIRSERVER-1198
-            if ( ( change.getAttributeType() == null ) && !atRegistry.contains( change.getUpId() )
-                && !objectClass.contains( SchemaConstants.EXTENSIBLE_OBJECT_OC ) )
-            {
-                throw new LdapInvalidAttributeIdentifierException();
-            }
-
-            // We will forbid modification of operational attributes which are not
-            // user modifiable.
-            AttributeType attributeType = change.getAttributeType();
-            
-            if ( attributeType == null )
-            {
-                attributeType = atRegistry.lookup( change.getUpId() );
-            }
-
-            if ( !attributeType.isUserModifiable() )
-            {
-                throw new NoPermissionException( "Cannot modify the attribute '" + change.getUpId() + "'" );
-            }
-
-            switch ( modOp )
-            {
-                case ADD_ATTRIBUTE:
-                    EntryAttribute attr = tmpEntry.get( attributeType.getName() );
-
-                    if ( attr != null )
-                    {
-                        for ( Value<?> value : change )
-                        {
-                            attr.add( value );
-                        }
-                    }
-                    else
-                    {
-                        attr = new DefaultServerAttribute( change.getUpId(), attributeType );
-
-                        for ( Value<?> value : change )
-                        {
-                            attr.add( value );
-                        }
-
-                        tmpEntry.put( attr );
-                    }
-
-                    break;
-
-                case REMOVE_ATTRIBUTE:
-                    if ( tmpEntry.get( change.getId() ) == null )
-                    {
-                        LOG.error( "Trying to remove an non-existant attribute: " + change.getUpId() );
-                        throw new LdapNoSuchAttributeException();
-                    }
-
-                    // We may have to remove the attribute or only some values
-                    if ( change.size() == 0 )
-                    {
-                        // No value : we have to remove the entire attribute
-                        // Check that we aren't removing a MUST attribute
-                        if ( isRequired( change.getUpId(), objectClass ) )
-                        {
-                            LOG.error( "Trying to remove a required attribute: " + change.getUpId() );
-                            throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION );
-                        }
-                        
-                        attr = tmpEntry.get( change.getUpId() );
-                        if ( attr != null )
-                        {
-                            tmpEntry.removeAttributes( change.getUpId() );
-                        }
-                    }
-                    else
-                    {
-                        // for required attributes we need to check if all values are removed
-                        // if so then we have a schema violation that must be thrown
-                        if ( isRequired( change.getUpId(), objectClass ) && isCompleteRemoval( change, entry ) )
-                        {
-                            LOG.error( "Trying to remove a required attribute: " + change.getUpId() );
-                            throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION );
-                        }
-
-                        // Now remove the attribute and all its values
-                        EntryAttribute modified = tmpEntry.removeAttributes( change.getId() ).get( 0 );
-
-                        // And inject back the values except the ones to remove
-                        for ( Value<?> value : change )
-                        {
-                            if ( modified.contains( value ) )
-                            {
-                                modified.remove( value );
-                            }
-                            else if ( !subSchemaModification )
-                            {
-                                // We are trying to remove an not existing value : error
-                                throw new LdapNoSuchAttributeException( "Value " + value + " does not exist in the " + modified + " AT" );
-                            }
-                        }
-
-                        // ok, done. Last check : if the attribute does not content any more value;
-                        // and if it's a MUST one, we should thow an exception
-                        if ( ( modified.size() == 0 ) && isRequired( change.getId(), objectClass ) )
-                        {
-                            LOG.error( "Trying to remove a required attribute: " + change.getUpId() );
-                            throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION );
-                        }
-
-                        // Put back the attribute in the entry only if it has values left in it
-                        if ( modified.size() > 0 )
-                        {
-                            tmpEntry.put( modified );
-                        }
-                    }
-
-                    SchemaChecker
-                        .preventRdnChangeOnModifyRemove( name, modOp, change, atRegistry );
-                    SchemaChecker.preventStructuralClassRemovalOnModifyRemove( ocRegistry, name, modOp, change,
-                        objectClass );
-                    break;
-
-                case REPLACE_ATTRIBUTE:
-                    SchemaChecker.preventRdnChangeOnModifyReplace( name, modOp, change, atRegistry );
-                    SchemaChecker.preventStructuralClassRemovalOnModifyReplace( ocRegistry, name, modOp, change );
-
-                    attr = tmpEntry.get( change.getUpId() );
-
-                    if ( attr != null )
-                    {
-                        tmpEntry.removeAttributes( change.getUpId() );
-                    }
-
-                    attr = new DefaultServerAttribute( change.getUpId(), attributeType );
-
-                    if ( change.size() != 0 )
-                    {
-                        for ( Value<?> value : change )
-                        {
-                            attr.add( value );
-                        }
-
-                        tmpEntry.put( attr );
-                    }
-
-                    break;
-            }
-        }
-
-        check( name, tmpEntry );
-
-        // let's figure out if we need to add or take away from mods to maintain 
-        // the objectClass attribute with it's hierarchy of ancestors 
-        if ( objectClassMod != null )
-        {
-            ServerAttribute alteredObjectClass = ( ServerAttribute ) objectClass.clone();
-            alterObjectClasses( alteredObjectClass );
-
-            if ( !alteredObjectClass.equals( objectClass ) )
-            {
-                ServerAttribute ocMods = ( ServerAttribute ) objectClassMod.getAttribute();
-
-                switch ( objectClassMod.getOperation() )
-                {
-                    case ADD_ATTRIBUTE:
-                        if ( ocMods.contains( SchemaConstants.TOP_OC ) )
-                        {
-                            ocMods.remove( SchemaConstants.TOP_OC );
-                        }
-
-                        for ( Value<?> value : alteredObjectClass )
-                        {
-                            if ( !objectClass.contains( value ) )
-                            {
-                                ocMods.add( value );
-                            }
-                        }
-
-                        break;
-
-                    case REMOVE_ATTRIBUTE:
-                        for ( Value<?> value : alteredObjectClass )
-                        {
-                            if ( !objectClass.contains( value ) )
-                            {
-                                ocMods.remove( value );
-                            }
-                        }
-
-                        break;
-
-                    case REPLACE_ATTRIBUTE:
-                        for ( Value<?> value : alteredObjectClass )
-                        {
-                            if ( !objectClass.contains( value ) )
-                            {
-                                ocMods.add( value );
-                            }
-                        }
-
-                        break;
-
-                    default:
-                }
-            }
-        }
-
-        if ( subSchemaModification )
-        {
-            LOG.debug( "Modification attempt on schema subentry {}: \n{}", name, opContext );
-
-            schemaManager.modifySchemaSubentry( opContext, entry, targetEntry, opContext
-                .hasRequestControl( CascadeControl.CONTROL_OID ) );
-            return;
-        }
-
-        next.modify( opContext );
-    }
-
-    
     /**
      * Create a new attribute using the given values
      */
@@ -1508,7 +1189,7 @@
     private ServerEntry modifyEntry( LdapDN dn, ServerEntry currentEntry, List<Modification> mods ) throws Exception
     {
         // The first step is to check that the modifications are valid :
-        // - the AT are present in the schema
+        // - the ATs are present in the schema
         // - The value is syntaxically correct
         //
         // While doing that, we will apply the modification to a copy of the current entry
@@ -1681,37 +1362,46 @@
     /**
      * {@inheritDoc}
      */
-    public void modifyNew( NextInterceptor next, ModifyOperationContext opContext ) throws Exception
+    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws Exception
     {
+        // A modification on a simple entry will be done in three steps :
+        // - get the original entry (it should already been in the context)
+        // - apply the modification on it
+        // - check that the entry is still correct
+        // - add the operational attributes (modifiersName/modifyTimeStamp)
+        // - store the modified entry on the backend.
+        //
+        // A modification done on the schema is a bit different, as there is two more
+        // steps
+        // - We have to update the registries
+        // - We have to modify the ou=schemaModifications entry
+        //
+        
         // First, check that the entry is either a subschemaSubentry or a schema element.
         // This is the case if it's a child of cn=schema or ou=schema
         LdapDN dn = opContext.getDn();
         ServerEntry targetEntry = null;
         
+        // Gets the stored entry on which the modification must be applied
         if ( dn.equals( subschemaSubentryDn ) )
         {
+            LOG.debug( "Modification attempt on schema subentry {}: \n{}", dn, opContext );
+
             ServerEntry currentEntry = schemaService.getSubschemaEntry( SCHEMA_SUBENTRY_RETURN_ATTRIBUTES );
             targetEntry = modifyEntry( dn, currentEntry, opContext.getModItems() );
+
+            // Now that the entry has been modified, update the SSSE
+            schemaManager.modifySchemaSubentry( 
+                opContext, 
+                opContext.getEntry(), 
+                targetEntry, 
+                opContext.hasRequestControl( CascadeControl.CONTROL_OID ) );
         }
         else
         {
             targetEntry = modifyEntry( dn, opContext.getEntry(), opContext.getModItems() );
         }
         
-        if ( dn.startsWith( schemaBaseDN ) )
-        {
-            LOG.debug( "Modification attempt on schema partition {}: \n{}", dn, opContext );
-        }
-        else if ( dn.equals( subschemaSubentryDn ) )
-        {
-            LOG.debug( "Modification attempt on schema subentry {}: \n{}", dn, opContext );
-
-            schemaManager.modifySchemaSubentry( opContext, opContext.getEntry(), targetEntry, opContext
-                .hasRequestControl( CascadeControl.CONTROL_OID ) );
-            return;
-        }
-
-        // We are golden ! Let's apply the change then.
         next.modify( opContext );
     }
     

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java?rev=815492&r1=815491&r2=815492&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java Tue Sep 15 21:14:14 2009
@@ -25,8 +25,11 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.directory.server.core.entry.ServerEntry;
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
 import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -38,24 +41,20 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.DITContentRule;
 import org.apache.directory.shared.ldap.schema.DITStructureRule;
+import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.MatchingRuleUse;
 import org.apache.directory.shared.ldap.schema.NameForm;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
-import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.SchemaObject;
 import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescription;
 import org.apache.directory.shared.ldap.schema.parsers.NormalizerDescription;
 import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescription;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.naming.NamingException;
-import javax.naming.directory.DirContext;
-
 
 /**
  *
@@ -386,7 +385,9 @@
                 {
                     subentryModifier.add( opContext, comparatorDescription );
                 }
+                
                 break;
+                
             case( NORMALIZER_INDEX ):
                 NormalizerDescription[] normalizerDescriptions = parsers.parseNormalizers( mods );
                 
@@ -394,7 +395,9 @@
                 {
                     subentryModifier.add( opContext, normalizerDescription );
                 }
+                
                 break;
+                
             case( SYNTAX_CHECKER_INDEX ):
                 SyntaxCheckerDescription[] syntaxCheckerDescriptions = parsers.parseSyntaxCheckers( mods );
                 
@@ -402,7 +405,9 @@
                 {
                     subentryModifier.add( opContext, syntaxCheckerDescription );
                 }
+                
                 break;
+                
             case( SYNTAX_INDEX ):
                 LdapSyntax[] syntaxes = parsers.parseLdapSyntaxes( mods );
                 
@@ -410,7 +415,9 @@
                 {
                     subentryModifier.addSchemaObject( opContext, syntax );
                 }
+                
                 break;
+                
             case( MATCHING_RULE_INDEX ):
                 MatchingRule[] mrs = parsers.parseMatchingRules( mods );
                 
@@ -418,7 +425,9 @@
                 {
                     subentryModifier.addSchemaObject( opContext, mr );
                 }
+                
                 break;
+                
             case( ATTRIBUTE_TYPE_INDEX ):
                 AttributeType[] ats = parsers.parseAttributeTypes( mods );
                 
@@ -426,7 +435,9 @@
                 {
                     subentryModifier.addSchemaObject( opContext, at );
                 }
+                
                 break;
+                
             case( OBJECT_CLASS_INDEX ):
                 ObjectClass[] ocs = parsers.parseObjectClasses( mods );
 
@@ -434,7 +445,9 @@
                 {
                     subentryModifier.addSchemaObject( opContext, oc );
                 }
+                
                 break;
+                
             case( MATCHING_RULE_USE_INDEX ):
                 MatchingRuleUse[] mrus = parsers.parseMatchingRuleUses( mods );
                 
@@ -442,7 +455,9 @@
                 {
                     subentryModifier.addSchemaObject( opContext, mru );
                 }
+                
                 break;
+                
             case( DIT_STRUCTURE_RULE_INDEX ):
                 DITStructureRule[] dsrs = parsers.parseDitStructureRules( mods );
                 
@@ -450,7 +465,9 @@
                 {
                     subentryModifier.addSchemaObject( opContext, dsr );
                 }
+                
                 break;
+                
             case( DIT_CONTENT_RULE_INDEX ):
                 DITContentRule[] dcrs = parsers.parseDitContentRules( mods );
                 
@@ -458,7 +475,9 @@
                 {
                     subentryModifier.addSchemaObject( opContext, dcr );
                 }
+                
                 break;
+                
             case( NAME_FORM_INDEX ):
                 NameForm[] nfs = parsers.parseNameForms( mods );
                 
@@ -466,7 +485,9 @@
                 {
                     subentryModifier.addSchemaObject( opContext, nf );
                 }
+                
                 break;
+                
             default:
                 throw new IllegalStateException( "Unknown index into handler array: " + index );
         }



Mime
View raw message