directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1197295 - in /directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api: partition/ByPassConstants.java schema/SchemaPartition.java
Date Thu, 03 Nov 2011 20:16:44 GMT
Author: kayyagari
Date: Thu Nov  3 20:16:43 2011
New Revision: 1197295

URL: http://svn.apache.org/viewvc?rev=1197295&view=rev
Log:
o removed the usage of SCHEMA_MODIFICATION_ATTRIBUTES_UPDATE_BYPASS
o fixed an NPE by setting the looked up entry into modification context

Modified:
    directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/partition/ByPassConstants.java
    directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java

Modified: directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/partition/ByPassConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/partition/ByPassConstants.java?rev=1197295&r1=1197294&r2=1197295&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/partition/ByPassConstants.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/partition/ByPassConstants.java
Thu Nov  3 20:16:43 2011
@@ -57,9 +57,6 @@ public class ByPassConstants
      */
     public static final Collection<String> BYPASS_ALL_COLLECTION = Collections.singleton(
BYPASS_ALL );
 
-    /** Bypass for when we modify schema attributes */
-    public static final Collection<String> SCHEMA_MODIFICATION_ATTRIBUTES_UPDATE_BYPASS;
-    
     static
     {
         Collection<String> c = new HashSet<String>();
@@ -85,15 +82,5 @@ public class ByPassConstants
         c.add( "EventInterceptor" );
         c.add( "JournalInterceptor" );
         GETMATCHEDDN_BYPASS = Collections.unmodifiableCollection( c );
-
-        c = new HashSet<String>();
-        c.add( "NormalizationInterceptor" );
-        c.add( "AciAuthorizationInterceptor" );
-        c.add( "DefaultAuthorizationInterceptor" );
-        c.add( "ExceptionInterceptor" );
-        c.add( "SchemaInterceptor" );
-        c.add( "CollectiveAttributeInterceptor" );
-        c.add( "JournalInterceptor" );
-        SCHEMA_MODIFICATION_ATTRIBUTES_UPDATE_BYPASS = Collections.unmodifiableCollection(
c );
     }
 }

Modified: directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java?rev=1197295&r1=1197294&r2=1197295&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
Thu Nov  3 20:16:43 2011
@@ -336,6 +336,7 @@ public final class SchemaPartition exten
         {
             LookupOperationContext lookupCtx = new LookupOperationContext( modifyContext.getSession(),
modifyContext.getDn() );
             entry = wrapped.lookup( lookupCtx );
+            modifyContext.setEntry( entry );
         }
 
         Entry targetEntry = ( Entry ) SchemaUtils.getTargetEntry( modifyContext.getModItems(),
entry );
@@ -458,7 +459,12 @@ public final class SchemaPartition exten
             ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT, schemaManager
                 .lookupAttributeTypeRegistry( ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT
), modifiersName ) ) );
 
-        opContext.modify( SCHEMA_MODIFICATION_DN, mods, ByPassConstants.SCHEMA_MODIFICATION_ATTRIBUTES_UPDATE_BYPASS
);
+        // operation reached this level means all the necessary ACI and other checks should
+        // have been done, so we can perform the below modification directly on the partition
nexus
+        // without using a a bypass list
+        CoreSession session = opContext.getSession();
+        ModifyOperationContext modifyContext = new ModifyOperationContext( session, SCHEMA_MODIFICATION_DN,
mods );
+        session.getDirectoryService().getPartitionNexus().modify( modifyContext );
     }
 
 



Mime
View raw message