directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r606815 - /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
Date Tue, 25 Dec 2007 21:28:42 GMT
Author: elecharny
Date: Tue Dec 25 13:28:41 2007
New Revision: 606815

URL: http://svn.apache.org/viewvc?rev=606815&view=rev
Log:
Using ServerEntry for the add() operation

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=606815&r1=606814&r2=606815&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
Tue Dec 25 13:28:41 2007
@@ -19,8 +19,12 @@
 package org.apache.directory.server.core.changelog;
 
 
+import java.util.Set;
+
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
@@ -45,9 +49,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
 
@@ -98,11 +100,14 @@
         Entry forward = new Entry();
         forward.setChangeType( ChangeType.Add );
         forward.setDn( opContext.getDn().getUpName() );
-        NamingEnumeration<? extends Attribute> list = opContext.getEntry().getAll();
         
-        while ( list.hasMore() )
+        DefaultServerEntry addEntry = ServerEntryUtils.toServerEntry( opContext.getEntry(),
opContext.getDn(), schemaService.getRegistries() );
+
+        Set<AttributeType> list = addEntry.getAttributeTypes();
+        
+        for ( AttributeType attributeType:list )
         {
-            forward.addAttribute( ( Attribute ) list.next() );
+            forward.addAttribute( ServerEntryUtils.toAttributeImpl( addEntry.get( attributeType
) ) );
         }
         
         Entry reverse = LdifUtils.reverseAdd( opContext.getDn() );



Mime
View raw message