directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r658911 - in /directory/apacheds/branches/bigbang/mitosis: ./ src/main/java/org/apache/directory/mitosis/operation/ src/main/java/org/apache/directory/mitosis/operation/support/ src/main/java/org/apache/directory/mitosis/service/ src/main/j...
Date Wed, 21 May 2008 22:39:24 GMT
Author: elecharny
Date: Wed May 21 15:39:24 2008
New Revision: 658911

URL: http://svn.apache.org/viewvc?rev=658911&view=rev
Log:
fixing issues with Cursor verses NamingEnumeration usage in Interceptors

Modified:
    directory/apacheds/branches/bigbang/mitosis/pom.xml
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddAttributeOperation.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddEntryOperation.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AttributeOperation.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/CompositeOperation.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/DeleteAttributeOperation.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/Operation.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/ReplaceAttributeOperation.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationLogCleanJob.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java

Modified: directory/apacheds/branches/bigbang/mitosis/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/pom.xml?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/pom.xml (original)
+++ directory/apacheds/branches/bigbang/mitosis/pom.xml Wed May 21 15:39:24 2008
@@ -110,6 +110,12 @@
       <groupId>org.apache.derby</groupId>
       <artifactId>derby</artifactId>
     </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-cursor</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
   </dependencies>
 
   <build>

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddAttributeOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddAttributeOperation.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddAttributeOperation.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddAttributeOperation.java
Wed May 21 15:39:24 2008
@@ -31,7 +31,6 @@
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
-import javax.naming.NamingException;
 import java.util.List;
 
 
@@ -62,7 +61,7 @@
     }
 
 
-    protected void execute1( PartitionNexus nexus, Registries registries ) throws NamingException
+    protected void execute1( PartitionNexus nexus, Registries registries ) throws Exception
     {
         ServerEntry serverEntry = new DefaultServerEntry( registries, LdapDN.EMPTY_LDAPDN
);
         ServerAttribute attribute = getAttribute( registries.getAttributeTypeRegistry() );

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddEntryOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddEntryOperation.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddEntryOperation.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddEntryOperation.java
Wed May 21 15:39:24 2008
@@ -20,16 +20,14 @@
 package org.apache.directory.mitosis.operation;
 
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.operation.support.EntryUtil;
 import org.apache.directory.mitosis.store.ReplicationStore;
+import org.apache.directory.server.core.cursor.Cursor;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
-import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
@@ -72,7 +70,7 @@
 
 
     protected void execute0( PartitionNexus nexus, ReplicationStore store, Registries registries
)
-        throws NamingException
+        throws Exception
     {
         if ( !EntryUtil.isEntryUpdatable( registries, nexus, dn, getCSN() ) )
         {
@@ -93,19 +91,19 @@
 
     @SuppressWarnings("unchecked")
     private void recursiveDelete( PartitionNexus nexus, LdapDN normalizedName, Registries
registries )
-        throws NamingException
+        throws Exception
     {
-        NamingEnumeration<ServerSearchResult> ne = nexus.list( new ListOperationContext(
registries, normalizedName ) );
+        Cursor<ServerEntry> ne = nexus.list( new ListOperationContext( registries,
normalizedName ) );
         
-        if ( !ne.hasMore() )
+        if ( !ne.available() )
         {
             nexus.delete( new DeleteOperationContext( registries, normalizedName ) );
             return;
         }
 
-        while ( ne.hasMore() )
+        while ( ne.next() )
         {
-            ServerSearchResult sr = ne.next();
+            ServerEntry sr = ne.get();
             LdapDN dn = sr.getDn();
             dn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
             recursiveDelete( nexus, dn, registries );

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AttributeOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AttributeOperation.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AttributeOperation.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AttributeOperation.java
Wed May 21 15:39:24 2008
@@ -96,7 +96,7 @@
 
 
     protected final void execute0( PartitionNexus nexus, ReplicationStore store, Registries
registries ) 
-        throws NamingException
+        throws Exception
     {
         if ( !EntryUtil.isEntryUpdatable( registries, nexus, name, getCSN() ) )
         {
@@ -108,7 +108,7 @@
     }
 
 
-    protected abstract void execute1( PartitionNexus nexus, Registries registries ) throws
NamingException;
+    protected abstract void execute1( PartitionNexus nexus, Registries registries ) throws
Exception;
 
 
     /**

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/CompositeOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/CompositeOperation.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/CompositeOperation.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/CompositeOperation.java
Wed May 21 15:39:24 2008
@@ -32,7 +32,6 @@
 import org.apache.directory.server.schema.registries.Registries;
 
 import javax.naming.Name;
-import javax.naming.NamingException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
@@ -161,7 +160,7 @@
 
 
     protected void execute0( PartitionNexus nexus, ReplicationStore store, Registries registries
) 
-        throws NamingException
+        throws Exception
     {
         for ( Operation op : children )
         {

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/DeleteAttributeOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/DeleteAttributeOperation.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/DeleteAttributeOperation.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/DeleteAttributeOperation.java
Wed May 21 15:39:24 2008
@@ -31,7 +31,6 @@
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
-import javax.naming.NamingException;
 import java.util.List;
 
 
@@ -62,7 +61,7 @@
     }
 
 
-    protected void execute1( PartitionNexus nexus, Registries registries ) throws NamingException
+    protected void execute1( PartitionNexus nexus, Registries registries ) throws Exception
     {
         ServerEntry serverEntry = new DefaultServerEntry( registries, LdapDN.EMPTY_LDAPDN
);
         ServerAttribute attribute = getAttribute( registries.getAttributeTypeRegistry() );

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/Operation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/Operation.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/Operation.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/Operation.java
Wed May 21 15:39:24 2008
@@ -22,7 +22,6 @@
 
 import java.io.Serializable;
 
-import javax.naming.NamingException;
 import javax.naming.OperationNotSupportedException;
 
 import org.apache.directory.mitosis.common.CSN;
@@ -101,7 +100,7 @@
      * Executes this operation on the specified nexus.
      */
     public final void execute( PartitionNexus nexus, ReplicationStore store, Registries registries
) 
-        throws NamingException
+        throws Exception
     {
         synchronized ( nexus )
         {
@@ -112,7 +111,7 @@
 
     @SuppressWarnings("unused")
     protected void execute0( PartitionNexus nexus, ReplicationStore store, Registries registries
) 
-        throws NamingException
+        throws Exception
     {
         throw new OperationNotSupportedException( nexus.getSuffixDn().toString() );
     }

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
Wed May 21 15:39:24 2008
@@ -26,10 +26,10 @@
 import org.apache.directory.mitosis.common.UUIDFactory;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.cursor.Cursor;
 import org.apache.directory.server.core.entry.DefaultServerAttribute;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
@@ -48,7 +48,6 @@
 import org.apache.directory.shared.ldap.name.Rdn;
 
 import javax.naming.NameAlreadyBoundException;
-import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 
@@ -107,7 +106,7 @@
      * Creates a new {@link Operation} that performs LDAP "add" operation
      * with a newly generated {@link CSN}.
      */
-    public Operation newAdd( LdapDN normalizedName, ServerEntry entry ) throws NamingException
+    public Operation newAdd( LdapDN normalizedName, ServerEntry entry ) throws Exception
     {
         return newAdd( newCSN(), normalizedName, entry );
     }
@@ -119,7 +118,7 @@
      * additional attributes; {@link Constants#ENTRY_CSN} ({@link CSN}),
      * {@link Constants#ENTRY_UUID}, and {@link Constants#ENTRY_DELETED}.
      */
-    private Operation newAdd( CSN csn, LdapDN normalizedName, ServerEntry entry ) throws
NamingException
+    private Operation newAdd( CSN csn, LdapDN normalizedName, ServerEntry entry ) throws
Exception
     {
         // Check an entry already exists.
         checkBeforeAdd( normalizedName );
@@ -234,7 +233,7 @@
      * {@link #newMove(LdapDN, LdapDN, Rdn, boolean)} with unchanged
      * <tt>newParentName</tt>. 
      */
-    public Operation newModifyRn( LdapDN oldName, Rdn newRdn, boolean deleteOldRn ) throws
NamingException
+    public Operation newModifyRn( LdapDN oldName, Rdn newRdn, boolean deleteOldRn ) throws
Exception
     {
         LdapDN newParentName = ( LdapDN ) oldName.clone();
         newParentName.remove( oldName.size() - 1 );
@@ -249,7 +248,7 @@
      * {@link #newMove(LdapDN, LdapDN, Rdn, boolean)} with unchanged
      * <tt>newRdn</tt> and '<tt>true</tt>' <tt>deleteOldRn</tt>.

      */
-    public Operation newMove( LdapDN oldName, LdapDN newParentName ) throws NamingException
+    public Operation newMove( LdapDN oldName, LdapDN newParentName ) throws Exception
     {
         return newMove( oldName, newParentName, oldName.getRdn(), true );
     }
@@ -261,7 +260,7 @@
      * so it should be reviewed completely again.
      */
     public Operation newMove( LdapDN oldName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn
)
-        throws NamingException
+        throws Exception
     {
         // Prepare to create composite operations
         CSN csn = newCSN();
@@ -271,16 +270,16 @@
         SearchControls ctrl = new SearchControls();
         ctrl.setSearchScope( SearchControls.SUBTREE_SCOPE );
         
-        NamingEnumeration<ServerSearchResult> e = nexus.search( 
+        Cursor<ServerEntry> e = nexus.search( 
             new SearchOperationContext( registries, oldName, AliasDerefMode.DEREF_ALWAYS,
                     new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ), ctrl ) );
 
-        while ( e.hasMore() )
+        while ( e.next() )
         {
-            ServerSearchResult sr = e.next();
+            ServerEntry entry = e.get();
 
             // Get the name of the old entry
-            LdapDN oldEntryName = sr.getDn();
+            LdapDN oldEntryName = entry.getDn();
             oldEntryName.normalize( attributeRegistry.getNormalizerMapping() );
 
             // Delete the old entry
@@ -294,8 +293,6 @@
                         "TRUE" ) ) );
 
             // Get the old entry attributes and replace RDN if required
-            ServerEntry entry = sr.getServerEntry();
-            
             if ( oldEntryName.size() == oldName.size() )
             {
                 if ( deleteOldRn )
@@ -362,7 +359,7 @@
      *
      * @param newEntryName makes sure an entry already exists.
      */
-    private void checkBeforeAdd( LdapDN newEntryName ) throws NamingException
+    private void checkBeforeAdd( LdapDN newEntryName ) throws Exception
     {
         if ( nexus.hasEntry( new EntryOperationContext( registries, newEntryName ) ) )
         {

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/ReplaceAttributeOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/ReplaceAttributeOperation.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/ReplaceAttributeOperation.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/ReplaceAttributeOperation.java
Wed May 21 15:39:24 2008
@@ -31,7 +31,6 @@
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
-import javax.naming.NamingException;
 import java.util.List;
 
 
@@ -64,7 +63,7 @@
     }
 
 
-    protected void execute1( PartitionNexus nexus, Registries registries ) throws NamingException
+    protected void execute1( PartitionNexus nexus, Registries registries ) throws Exception
     {
         ServerEntry serverEntry = new DefaultServerEntry( registries, LdapDN.EMPTY_LDAPDN
);
         ServerAttribute attribute = getAttribute( registries.getAttributeTypeRegistry() );

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
Wed May 21 15:39:24 2008
@@ -21,7 +21,6 @@
 
 
 import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
 
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -43,7 +42,8 @@
 public class EntryUtil
 {
     @SuppressWarnings("unchecked")
-    public static boolean isEntryUpdatable( Registries registries, PartitionNexus nexus,
LdapDN name, CSN newCSN ) throws NamingException
+    public static boolean isEntryUpdatable( Registries registries, PartitionNexus nexus,
LdapDN name, CSN newCSN ) 
+        throws Exception
     {
         ServerEntry entry = nexus.lookup( new LookupOperationContext( registries, name )
);
 
@@ -86,7 +86,7 @@
 
 
     public static void createGlueEntries( Registries registries, PartitionNexus nexus, LdapDN
name, boolean includeLeaf )
-        throws NamingException
+        throws Exception
     {
         assert name.size() > 0;
 
@@ -102,7 +102,8 @@
     }
 
 
-    private static void createGlueEntry( Registries registries, PartitionNexus nexus, LdapDN
name ) throws NamingException
+    private static void createGlueEntry( Registries registries, PartitionNexus nexus, LdapDN
name ) 
+        throws Exception
     {
         try
         {

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
Wed May 21 15:39:24 2008
@@ -33,9 +33,8 @@
 import org.apache.directory.mitosis.service.protocol.handler.ReplicationServerProtocolHandler;
 import org.apache.directory.mitosis.store.ReplicationStore;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.cursor.Cursor;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerSearchResult;
-import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.Interceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
@@ -50,9 +49,7 @@
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
-import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -72,7 +69,6 @@
 import org.slf4j.LoggerFactory;
 
 import javax.naming.NameNotFoundException;
-import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 
@@ -194,7 +190,7 @@
     }
 
 
-    public void init( DirectoryService directoryService ) throws NamingException
+    public void init( DirectoryService directoryService ) throws Exception
     {
         configuration.validate();
         // and then preserve frequently used ones
@@ -300,7 +296,7 @@
      * @see ReplicationLogCleanJob
      * @throws javax.naming.NamingException on error
      */
-    public void purgeAgedData() throws NamingException
+    public void purgeAgedData() throws Exception
     {
         ServerEntry rootDSE = nexus.getRootDSE( null );
         EntryAttribute namingContextsAttr = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT
);
@@ -342,23 +338,23 @@
     }
 
 
-    private void purgeAgedData( LdapDN contextName, ExprNode filter ) throws NamingException
+    private void purgeAgedData( LdapDN contextName, ExprNode filter ) throws Exception
     {
         SearchControls ctrl = new SearchControls();
         ctrl.setSearchScope( SearchControls.SUBTREE_SCOPE );
         ctrl.setReturningAttributes( new String[] { "entryCSN", "entryDeleted" } );
 
-        NamingEnumeration<ServerSearchResult> e = nexus.search(
+        Cursor<ServerEntry> e = nexus.search(
             new SearchOperationContext( registries, contextName, AliasDerefMode.DEREF_ALWAYS,
filter, ctrl ) );
 
         List<LdapDN> names = new ArrayList<LdapDN>();
         
         try
         {
-            while ( e.hasMore() )
+            while ( e.next() )
             {
-            	ServerSearchResult sr = e.next();
-                LdapDN name = sr.getDn();
+            	ServerEntry entry = e.get();
+                LdapDN name = entry.getDn();
                 
                 if ( name.size() > contextName.size() )
                 {
@@ -388,7 +384,7 @@
     }
 
 
-    public void add( NextInterceptor nextInterceptor, AddOperationContext addContext ) throws
NamingException
+    public void add( NextInterceptor nextInterceptor, AddOperationContext addContext ) throws
Exception
     {
         Operation op = operationFactory.newAdd( 
             addContext.getDn(), addContext.getEntry() );
@@ -397,14 +393,14 @@
 
 
     @Override
-    public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws NamingException
+    public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws Exception
     {
         Operation op = operationFactory.newDelete( opContext.getDn() );
         op.execute( nexus, store, registries );
     }
 
 
-    public void modify( NextInterceptor next, ModifyOperationContext modifyContext ) throws
NamingException
+    public void modify( NextInterceptor next, ModifyOperationContext modifyContext ) throws
Exception
     {
         Operation op = operationFactory.newModify( modifyContext );
         op.execute( nexus, store, registries );
@@ -412,7 +408,7 @@
 
 
     @Override
-    public void move( NextInterceptor next, MoveOperationContext moveOpContext ) throws NamingException
+    public void move( NextInterceptor next, MoveOperationContext moveOpContext ) throws Exception
     {
         Operation op = operationFactory.newMove( moveOpContext.getDn(), moveOpContext.getParent()
);
         op.execute( nexus, store, registries );
@@ -420,7 +416,7 @@
 
 
     @Override
-    public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameOpContext
) throws NamingException
+    public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameOpContext
) throws Exception
     {
         Operation op = operationFactory.newMove( moveAndRenameOpContext.getDn(),
                 moveAndRenameOpContext.getParent(), moveAndRenameOpContext.getNewRdn(),
@@ -430,14 +426,14 @@
 
 
     @Override
-    public void rename( NextInterceptor next, RenameOperationContext renameOpContext ) throws
NamingException
+    public void rename( NextInterceptor next, RenameOperationContext renameOpContext ) throws
Exception
     {
         Operation op = operationFactory.newModifyRn( renameOpContext.getDn(), renameOpContext.getNewRdn(),
renameOpContext.getDelOldDn() );
         op.execute( nexus, store, registries );
     }
 
 
-    public boolean hasEntry( NextInterceptor nextInterceptor, EntryOperationContext entryContext
) throws NamingException
+    public boolean hasEntry( NextInterceptor nextInterceptor, EntryOperationContext entryContext
) throws Exception
     {
         // Ask others first.
         boolean hasEntry = nextInterceptor.hasEntry( entryContext );
@@ -461,7 +457,7 @@
     }
 
 
-    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext lookupContext
) throws NamingException
+    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext lookupContext
) throws Exception
     {
         if ( lookupContext.getAttrsId() != null )
         {
@@ -496,21 +492,24 @@
 
 
     @Override
-    public NamingEnumeration<ServerSearchResult> list( NextInterceptor nextInterceptor,
ListOperationContext opContext ) throws NamingException
+    public Cursor<ServerEntry> list( NextInterceptor nextInterceptor, ListOperationContext
opContext ) throws Exception
     {
-    	NamingEnumeration<ServerSearchResult> result = nextInterceptor.search(
+    	Cursor<ServerEntry> result = nextInterceptor.search(
 	            new SearchOperationContext(
 	                registries, opContext.getDn(), opContext.getAliasDerefMode(),
 	                new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ),
 	                new SearchControls() ) );
 
-        return new SearchResultFilteringEnumeration( result, new SearchControls(), InvocationStack.getInstance().peek(),
-            Constants.DELETED_ENTRIES_FILTER, "List replication filter" );
+        // TODO FixMe
+    	//return new SearchResultFilteringEnumeration( result, new SearchControls(), InvocationStack.getInstance().peek(),
+        //    Constants.DELETED_ENTRIES_FILTER, "List replication filter" );
+    	return null;
     }
 
 
     @Override
-    public NamingEnumeration<ServerSearchResult> search( NextInterceptor nextInterceptor,
SearchOperationContext opContext ) throws NamingException
+    public Cursor<ServerEntry> search( NextInterceptor nextInterceptor, SearchOperationContext
opContext ) 
+        throws Exception
     {
         SearchControls searchControls = opContext.getSearchControls();
 
@@ -523,14 +522,17 @@
             searchControls.setReturningAttributes( newAttrIds );
         }
 
-    	NamingEnumeration<ServerSearchResult> result = nextInterceptor.search(
+    	Cursor<ServerEntry> result = nextInterceptor.search(
             new SearchOperationContext( registries, opContext.getDn(), opContext.getAliasDerefMode(),
opContext.getFilter(), searchControls ) );
-        return new SearchResultFilteringEnumeration( result, searchControls, InvocationStack.getInstance().peek(),
-            Constants.DELETED_ENTRIES_FILTER, "Search Replication filter" );
+        // TODO FixMe
+    	// return new SearchResultFilteringEnumeration( result, searchControls, InvocationStack.getInstance().peek(),
+        //    Constants.DELETED_ENTRIES_FILTER, "Search Replication filter" );
+    	return null;
     }
 
 
-    private void ensureNotDeleted( LdapDN name, ServerEntry entry ) throws NamingException
{
+    private void ensureNotDeleted( LdapDN name, ServerEntry entry ) throws Exception 
+    {
         if ( isDeleted( entry ) )
         {
             LdapNameNotFoundException e = new LdapNameNotFoundException( "Deleted entry:
" + name.getUpName() );

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationLogCleanJob.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationLogCleanJob.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationLogCleanJob.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationLogCleanJob.java
Wed May 21 15:39:24 2008
@@ -27,7 +27,6 @@
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 
-import javax.naming.NamingException;
 import java.util.Map;
 
 
@@ -83,7 +82,7 @@
                 {
                     ( ( ReplicationInterceptor ) interceptor ).purgeAgedData();
                 }
-                catch ( NamingException e )
+                catch ( Exception e )
                 {
                     throw new JobExecutionException( e );
                 }

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java?rev=658911&r1=658910&r2=658911&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
(original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
Wed May 21 15:39:24 2008
@@ -42,8 +42,8 @@
 import org.apache.directory.mitosis.service.protocol.message.LoginMessage;
 import org.apache.directory.mitosis.store.ReplicationLogIterator;
 import org.apache.directory.mitosis.store.ReplicationStore;
+import org.apache.directory.server.core.cursor.Cursor;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -57,8 +57,6 @@
 import org.apache.mina.common.WriteFuture;
 import org.apache.mina.util.SessionLog;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 import java.net.InetSocketAddress;
 import java.util.Map;
@@ -296,7 +294,7 @@
 
 
     private void onBeginLogEntriesAck( ReplicationContext ctx, BeginLogEntriesAckMessage
message )
-        throws NamingException
+        throws Exception
     {
         // Start transaction only when the server says OK.
         if ( message.getResponseCode() != Constants.OK )
@@ -343,7 +341,7 @@
     }
 
 
-    private void sendAllEntries( ReplicationContext ctx ) throws NamingException
+    private void sendAllEntries( ReplicationContext ctx ) throws Exception
     {
         ServerEntry rootDSE = ctx.getDirectoryService().getPartitionNexus().getRootDSE( null
);
 
@@ -375,24 +373,23 @@
     }
 
 
-    private void sendAllEntries( ReplicationContext ctx, LdapDN contextName ) throws NamingException
+    private void sendAllEntries( ReplicationContext ctx, LdapDN contextName ) throws Exception
     {
         // Retrieve all subtree including the base entry
         SearchControls ctrl = new SearchControls();
         ctrl.setSearchScope( SearchControls.SUBTREE_SCOPE );
-        NamingEnumeration<ServerSearchResult> e = ctx.getDirectoryService().getPartitionNexus().search(
+        Cursor<ServerEntry> e = ctx.getDirectoryService().getPartitionNexus().search(
             new SearchOperationContext( ctx.getDirectoryService().getRegistries(), contextName,
                 AliasDerefMode.DEREF_ALWAYS, new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID
), ctrl ) );
 
         try
         {
-            while ( e.hasMore() )
+            while ( e.next() )
             {
-                ServerSearchResult sr = e.next();
-                ServerEntry attrs = sr.getServerEntry();
+                ServerEntry entry = e.get();
 
                 // Skip entries without entryCSN attribute.
-                EntryAttribute entryCSNAttr = attrs.get( org.apache.directory.mitosis.common.Constants.ENTRY_CSN
);
+                EntryAttribute entryCSNAttr = entry.get( org.apache.directory.mitosis.common.Constants.ENTRY_CSN
);
 
                 if ( entryCSNAttr == null )
                 {
@@ -417,15 +414,15 @@
                 }
                 catch ( IllegalArgumentException ex )
                 {
-                    SessionLog.warn( ctx.getSession(), "An entry with improper entryCSN:
" + sr.getDn() );
+                    SessionLog.warn( ctx.getSession(), "An entry with improper entryCSN:
" + entry.getDn() );
                     continue;
                 }
 
                 // Convert the entry into AddEntryOperation log.
-                LdapDN dn = sr.getDn();
+                LdapDN dn = entry.getDn();
                 dn.normalize( ctx.getDirectoryService().getRegistries().getAttributeTypeRegistry()
                     .getNormalizerMapping() );
-                Operation op = new AddEntryOperation( csn, attrs );
+                Operation op = new AddEntryOperation( csn, entry );
 
                 // Send a LogEntry message for the entry.
                 writeTimeLimitedMessage( ctx, new LogEntryMessage( ctx.getNextSequence(),
op ) );



Mime
View raw message