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 2011/01/14 18:04:14 UTC

svn commit: r1059073 - in /directory: apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ apacheds/trunk/core/src/main/java/org/apache/directory/server/core/s...

Author: elecharny
Date: Fri Jan 14 17:04:13 2011
New Revision: 1059073

URL: http://svn.apache.org/viewvc?rev=1059073&view=rev
Log:
o Added some missing At in the metaSyntax ObjectClass : m-obsolete and x-humanReadable
o Fixed a potential NPE when a schema object is injected without name
o Moved the ChangeLog interceptor at the end of the iChain
o Removed the isFirstOperation() check in the ChangeLong operations, it's not used anymore

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/shared/trunk/ldap-schema/src/main/resources/schema/ou=schema/cn=apachemeta/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.0.3.4.ldif

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=1059073&r1=1059072&r2=1059073&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Fri Jan 14 17:04:13 2011
@@ -683,13 +683,13 @@ public class DefaultDirectoryService imp
         list.add( new DefaultAuthorizationInterceptor() );
         list.add( new AdministrativePointInterceptor() );
         list.add( new ExceptionInterceptor() );
-        list.add( new ChangeLogInterceptor() );
         list.add( new OperationalAttributeInterceptor() );
         list.add( new SchemaInterceptor() );
         list.add( new CollectiveAttributeInterceptor() );
         list.add( new SubentryInterceptor() );
         list.add( new EventInterceptor() );
         list.add( new TriggerInterceptor() );
+        list.add( new ChangeLogInterceptor() );
         list.add( new JournalInterceptor() );
 
         setInterceptors( list );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=1059073&r1=1059072&r2=1059073&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Fri Jan 14 17:04:13 2011
@@ -98,13 +98,11 @@ public class ChangeLogInterceptor extend
     // -----------------------------------------------------------------------
     // Overridden (only change inducing) intercepted methods
     // -----------------------------------------------------------------------
-    
-
     public void add( NextInterceptor next, AddOperationContext addContext ) throws LdapException
     {
         next.add( addContext );
 
-        if ( ! changeLog.isEnabled() || ! addContext.isFirstOperation() )
+        if ( !changeLog.isEnabled() )
         {
             return;
         }
@@ -143,14 +141,14 @@ public class ChangeLogInterceptor extend
         // must save the entry if change log is enabled
         Entry serverEntry = null;
 
-        if ( changeLog.isEnabled() && deleteContext.isFirstOperation() )
+        if ( changeLog.isEnabled() )
         {
             serverEntry = getAttributes( deleteContext );
         }
 
         next.delete( deleteContext );
 
-        if ( ! changeLog.isEnabled() || ! deleteContext.isFirstOperation() )
+        if ( !changeLog.isEnabled() )
         {
             return;
         }
@@ -220,7 +218,7 @@ public class ChangeLogInterceptor extend
         Modification modification = ServerEntryUtils.getModificationItem( modifyContext.getModItems(), entryDeleted );
         boolean isDelete = ( modification != null );
 
-        if ( ! isDelete && ( changeLog.isEnabled() && modifyContext.isFirstOperation() ) )
+        if ( !isDelete && ( changeLog.isEnabled() ) )
         {
             // @todo make sure we're not putting in operational attributes that cannot be user modified
             serverEntry = getAttributes( modifyContext );
@@ -242,7 +240,6 @@ public class ChangeLogInterceptor extend
         if ( 
             isDelete ||   
             ! changeLog.isEnabled() || 
-            ! modifyContext.isFirstOperation() ||
             
          // if there are no modifications due to stripping out bogus non-
          // existing attributes then we will have no modification items and
@@ -307,7 +304,7 @@ public class ChangeLogInterceptor extend
         // After this point, the entry has been modified. The cloned entry contains
         // the modified entry, the originalEntry has changed
 
-        if ( ! changeLog.isEnabled() || ! renameContext.isFirstOperation() )
+        if ( !changeLog.isEnabled() )
         {
             return;
         }
@@ -330,7 +327,7 @@ public class ChangeLogInterceptor extend
     {
         Entry serverEntry = null;
         
-        if ( changeLog.isEnabled() && moveAndRenameContext.isFirstOperation() )
+        if ( changeLog.isEnabled() )
         {
             // @todo make sure we're not putting in operational attributes that cannot be user modified
             serverEntry = moveAndRenameContext.getOriginalEntry();
@@ -338,7 +335,7 @@ public class ChangeLogInterceptor extend
 
         next.moveAndRename( moveAndRenameContext );
 
-        if ( ! changeLog.isEnabled() || ! moveAndRenameContext.isFirstOperation() )
+        if ( !changeLog.isEnabled() )
         {
             return;
         }
@@ -371,7 +368,7 @@ public class ChangeLogInterceptor extend
     {
         next.move( moveContext );
 
-        if ( ! changeLog.isEnabled() || ! moveContext.isFirstOperation() )
+        if ( !changeLog.isEnabled() )
         {
             return;
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1059073&r1=1059072&r2=1059073&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Fri Jan 14 17:04:13 2011
@@ -1533,14 +1533,15 @@ public class SchemaInterceptor extends B
 
                 if ( ( schema != null ) && schema.isEnabled() )
                 {
-                    String ocName = entry.get( MetaSchemaConstants.M_NAME_AT ).getString();
-                    ObjectClass addedOC = schemaManager.getObjectClassRegistry().lookup( ocName );
+                    EntryAttribute oidAT = entry.get( MetaSchemaConstants.M_OID_AT );                    
+                    String ocOid = oidAT.getString();
+                    
+                    ObjectClass addedOC = schemaManager.getObjectClassRegistry().lookup( ocOid );
                     computeSuperior( addedOC );
                 }
             }
             else if ( entry.contains( OBJECT_CLASS_AT, SchemaConstants.META_ATTRIBUTE_TYPE_OC ) )
             {
-
                 // This is an AttributeType addition
                 next.add( addContext );
             }

Modified: directory/shared/trunk/ldap-schema/src/main/resources/schema/ou=schema/cn=apachemeta/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.0.3.4.ldif
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapachemeta/ou%3Dobjectclasses/m-oid%3D1.3.6.1.4.1.18060.0.4.0.3.4.ldif?rev=1059073&r1=1059072&r2=1059073&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema/src/main/resources/schema/ou=schema/cn=apachemeta/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.0.3.4.ldif (original)
+++ directory/shared/trunk/ldap-schema/src/main/resources/schema/ou=schema/cn=apachemeta/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.0.3.4.ldif Fri Jan 14 17:04:13 2011
@@ -10,3 +10,5 @@ objectclass: top
 m-name: metaSyntax
 m-typeobjectclass: STRUCTURAL
 creatorsname: uid=admin,ou=system
+m-may: x-humanReadable
+m-may: m-obsolete