directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1198925 - /directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
Date Mon, 07 Nov 2011 20:51:32 GMT
Author: elecharny
Date: Mon Nov  7 20:51:31 2011
New Revision: 1198925

URL: http://svn.apache.org/viewvc?rev=1198925&view=rev
Log:
Small improvement : do not add the operationalAttributes when we are modifying the subschemaSubentry

Modified:
    directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java

Modified: directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1198925&r1=1198924&r2=1198925&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
Mon Nov  7 20:51:31 2011
@@ -249,6 +249,7 @@ public class OperationalAttributeInterce
         boolean modifierAtPresent = false;
         boolean modifiedTimeAtPresent = false;
         boolean entryCsnAtPresent = false;
+        Dn dn = modifyContext.getDn();
         
         for ( Modification modification : mods )
         {
@@ -304,34 +305,38 @@ public class OperationalAttributeInterce
             }
         }
 
-        if ( !modifierAtPresent )
+        // Add the modification AT only if we are not trying to modify the SubentrySubschema
+        if ( !dn.equals( subschemaSubentryDn ) )
         {
-            // Inject the ModifiersName AT if it's not present
-            Attribute attribute = new DefaultAttribute( MODIFIERS_NAME_AT, getPrincipal()
-                .getName() );
-
-            Modification modifiersName = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
attribute );
-
-            mods.add( modifiersName );
-        }
-
-        if ( !modifiedTimeAtPresent )
-        {
-            // Inject the ModifyTimestamp AT if it's not present
-            Attribute attribute = new DefaultAttribute( MODIFY_TIMESTAMP_AT, DateUtils
-                .getGeneralizedTime() );
-
-            Modification timestamp = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
attribute );
-
-            mods.add( timestamp );
-        }
-
-        if ( !entryCsnAtPresent )
-        {
-            String csn = directoryService.getCSN().toString();
-            Attribute attribute = new DefaultAttribute( ENTRY_CSN_AT, csn );
-            Modification updatedCsn = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
attribute );
-            mods.add( updatedCsn );
+	        if ( !modifierAtPresent )
+	        {
+	            // Inject the ModifiersName AT if it's not present
+	            Attribute attribute = new DefaultAttribute( MODIFIERS_NAME_AT, getPrincipal()
+	                .getName() );
+	
+	            Modification modifiersName = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
attribute );
+	
+	            mods.add( modifiersName );
+	        }
+	
+	        if ( !modifiedTimeAtPresent )
+	        {
+	            // Inject the ModifyTimestamp AT if it's not present
+	            Attribute attribute = new DefaultAttribute( MODIFY_TIMESTAMP_AT, DateUtils
+	                .getGeneralizedTime() );
+	
+	            Modification timestamp = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
attribute );
+	
+	            mods.add( timestamp );
+	        }
+	
+	        if ( !entryCsnAtPresent )
+	        {
+	            String csn = directoryService.getCSN().toString();
+	            Attribute attribute = new DefaultAttribute( ENTRY_CSN_AT, csn );
+	            Modification updatedCsn = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
attribute );
+	            mods.add( updatedCsn );
+	        }
         }
         
         // Go down in the chain



Mime
View raw message