directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1024334 - in /directory/studio/branches/studio-connection-refactoring/plugins: connection.core/src/main/java/org/apache/directory/studio/connection/core/ connection.core/src/main/java/org/apache/directory/studio/connection/core/io/ connect...
Date Tue, 19 Oct 2010 17:36:56 GMT
Author: pamarcelot
Date: Tue Oct 19 17:36:56 2010
New Revision: 1024334

URL: http://svn.apache.org/viewvc?rev=1024334&view=rev
Log:
Added an abstraction layer for the StudioNamingEnumeration.
Updated sub-classes, added an abstract classes.
Updated depending classes accordingly.

Added:
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/AbstractStudioNamingEnumeration.java
      - copied, changed from r1024257, directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/CursorNamingEnumeration.java
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/StudioNamingEnumeration.java
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/CursorStudioNamingEnumeration.java
      - copied, changed from r1024257, directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/CursorNamingEnumeration.java
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
      - copied, changed from r1024257, directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/DirectoryApiConnectionWrapper.java
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JndiStudioNamingEnumeration.java
      - copied, changed from r1024257, directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/StudioNamingEnumeration.java
Removed:
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/CursorNamingEnumeration.java
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/DirectoryApiConnectionWrapper.java
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/StudioNamingEnumeration.java
Modified:
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/Connection.java
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/ConnectionWrapper.java
    directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java
    directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlRunnable.java
    directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java
    directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java
    directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java

Modified: directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/Connection.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/Connection.java?rev=1024334&r1=1024333&r2=1024334&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/Connection.java (original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/Connection.java Tue Oct 19 17:36:56 2010
@@ -27,7 +27,7 @@ import org.apache.directory.studio.conne
 import org.apache.directory.studio.connection.core.ConnectionParameter.NetworkProvider;
 import org.apache.directory.studio.connection.core.event.ConnectionEventRegistry;
 import org.apache.directory.studio.connection.core.io.ConnectionWrapper;
-import org.apache.directory.studio.connection.core.io.DirectoryApiConnectionWrapper;
+import org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper;
 import org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper;
 import org.eclipse.core.runtime.IAdaptable;
 

Copied: directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/AbstractStudioNamingEnumeration.java (from r1024257, directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/CursorNamingEnumeration.java)
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/AbstractStudioNamingEnumeration.java?p2=directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/AbstractStudioNamingEnumeration.java&p1=directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/CursorNamingEnumeration.java&r1=1024257&r2=1024334&rev=1024334&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/CursorNamingEnumeration.java (original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/AbstractStudioNamingEnumeration.java Tue Oct 19 17:36:56 2010
@@ -43,7 +43,7 @@ import org.apache.directory.studio.conne
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper;
 import org.apache.directory.studio.connection.core.io.jndi.ReferralsInfo;
-import org.apache.directory.studio.connection.core.io.jndi.StudioNamingEnumeration;
+import org.apache.directory.studio.connection.core.io.jndi.JndiStudioNamingEnumeration;
 import org.apache.directory.studio.connection.core.io.jndi.StudioSearchResult;
 
 
@@ -52,27 +52,18 @@ import org.apache.directory.studio.conne
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CursorNamingEnumeration extends StudioNamingEnumeration
+public abstract class AbstractStudioNamingEnumeration implements StudioNamingEnumeration
 {
-    private final Connection connection;
-    private Cursor<Response> cursor;
-    private SearchResultEntry currentSearchResultEntry;
-    private SearchResultDone searchResultDone;
-    private List<Referral> referralsList = new ArrayList<Referral>();
-    private List<String> currentReferralUrlsList;
-    private CursorNamingEnumeration cursorNamingEnumeration;
+    protected Connection connection;
 
-    private long requestNum;
-    private long resultEntryCounter;
-
-    private String searchBase;
-    private String filter;
-    private SearchControls searchControls;
-    private AliasDereferencingMethod aliasesDereferencingMethod;
-    private ReferralHandlingMethod referralsHandlingMethod;
-    private Control[] controls;
-    private StudioProgressMonitor monitor;
-    private ReferralsInfo referralsInfo;
+    protected String searchBase;
+    protected String filter;
+    protected SearchControls searchControls;
+    protected AliasDereferencingMethod aliasesDereferencingMethod;
+    protected ReferralHandlingMethod referralsHandlingMethod;
+    protected Control[] controls;
+    protected StudioProgressMonitor monitor;
+    protected ReferralsInfo referralsInfo;
 
 
     /**
@@ -89,18 +80,12 @@ public class CursorNamingEnumeration ext
      * @param monitor the progress monitor
      * @param referralsInfo the referrals info
      */
-    public CursorNamingEnumeration( Connection connection, Cursor<Response> cursor,
-        String searchBase, String filter, SearchControls searchControls,
-        AliasDereferencingMethod aliasesDereferencingMethod, ReferralHandlingMethod referralsHandlingMethod,
-        Control[] controls, long requestNum, StudioProgressMonitor monitor, ReferralsInfo referralsInfo )
+    public AbstractStudioNamingEnumeration( Connection connection, String searchBase, String filter,
+        SearchControls searchControls, AliasDereferencingMethod aliasesDereferencingMethod,
+        ReferralHandlingMethod referralsHandlingMethod, Control[] controls, long requestNum,
+        StudioProgressMonitor monitor, ReferralsInfo referralsInfo )
     {
-        super( connection, null, null, null, searchBase, filter, searchControls, aliasesDereferencingMethod,
-            referralsHandlingMethod, controls, requestNum, monitor, referralsInfo );
         this.connection = connection;
-        this.cursor = cursor;
-        this.requestNum = requestNum;
-        this.resultEntryCounter = 0;
-
         this.searchBase = searchBase;
         this.filter = filter;
         this.searchControls = searchControls;
@@ -110,341 +95,4 @@ public class CursorNamingEnumeration ext
         this.monitor = monitor;
         this.referralsInfo = referralsInfo;
     }
-
-
-    /**
-     * @see javax.naming.NamingEnumeration#close()
-     */
-    public void close() throws NamingException
-    {
-        try
-        {
-            cursor.close();
-        }
-        catch ( Exception e )
-        {
-            throw new NamingException( e.getMessage() );
-        }
-    }
-
-
-    /**
-     * @see javax.naming.NamingEnumeration#hasMore()
-     */
-    public boolean hasMore() throws NamingException
-    {
-        try
-        {
-            // Nulling the current search result entry
-            currentSearchResultEntry = null;
-
-            // Do we have another response in the cursor?
-            while ( cursor.next() )
-            {
-                Response currentResponse = cursor.get();
-
-                // Is it a search result entry?
-                if ( currentResponse instanceof SearchResultEntry )
-                {
-                    currentSearchResultEntry = ( SearchResultEntry ) currentResponse;
-
-                    // return true if the current response is a search result entry
-                    return true;
-                }
-                // Is it a search result reference (ie. a referral)?
-                else if ( currentResponse instanceof SearchResultReference )
-                {
-                    // Are we ignoring referrals?
-                    if ( referralsHandlingMethod != ReferralHandlingMethod.IGNORE )
-                    {
-                        // Storing the referral for later use
-                        referralsList.add( ( ( SearchResultReference ) currentResponse ).getReferral() );
-                    }
-                }
-                // Is it a search result done?
-                else if ( currentResponse instanceof SearchResultDone )
-                {
-                    searchResultDone = ( SearchResultDone ) currentResponse;
-                }
-            }
-
-            // Are we following referrals manually?
-            if ( referralsHandlingMethod == ReferralHandlingMethod.FOLLOW_MANUALLY )
-            {
-                // Checking the current referral's URLs list
-                if ( ( currentReferralUrlsList != null ) && ( currentReferralUrlsList.size() > 0 ) )
-                {
-                    // return true if there's at least one referral LDAP URL to handle
-                    return true;
-                }
-
-                // Checking the referrals list
-                if ( ( referralsList != null ) && ( referralsList.size() > 0 ) )
-                {
-                    // Getting the list of the next referral
-                    currentReferralUrlsList = new ArrayList<String>( referralsList.remove( 0 ).getLdapUrls() );
-
-                    // return true if there's at least one referral LDAP URL to handle
-                    return currentReferralUrlsList.size() > 0;
-                }
-            }
-            // Are we following referrals automatically?
-            else if ( referralsHandlingMethod == ReferralHandlingMethod.FOLLOW )
-            {
-                if ( ( cursorNamingEnumeration != null ) && ( cursorNamingEnumeration.hasMore() ) )
-                {
-                    // return true if there's at least one more entry in the current cursor naming enumeration
-                    return true;
-                }
-
-                if ( ( referralsList != null ) && ( referralsList.size() > 0 ) )
-                {
-                    Referral referral = referralsList.remove( 0 );
-                    List<String> referralUrls = new ArrayList<String>( referral.getLdapUrls() );
-                    LdapURL url = new LdapURL( referralUrls.get( 0 ) );
-
-                    Connection referralConnection = JNDIConnectionWrapper.getReferralConnection( referral, monitor,
-                        this );
-                    if ( referralConnection != null )
-                    {
-                        String referralSearchBase = url.getDn() != null && !url.getDn().isEmpty() ? url.getDn()
-                            .getName()
-                            : searchBase;
-                        String referralFilter = url.getFilter() != null && url.getFilter().length() == 0 ? url
-                            .getFilter()
-                            : filter;
-                        SearchControls referralSearchControls = new SearchControls();
-                        referralSearchControls.setSearchScope( url.getScope().getScope() > -1 ? url.getScope()
-                            .getScope()
-                            : searchControls.getSearchScope() );
-                        referralSearchControls.setReturningAttributes( url.getAttributes() != null
-                            && url.getAttributes().size() > 0 ? url.getAttributes().toArray(
-                            new String[url.getAttributes().size()] ) : searchControls.getReturningAttributes() );
-                        referralSearchControls.setCountLimit( searchControls.getCountLimit() );
-                        referralSearchControls.setTimeLimit( searchControls.getTimeLimit() );
-                        referralSearchControls.setDerefLinkFlag( searchControls.getDerefLinkFlag() );
-                        referralSearchControls.setReturningObjFlag( searchControls.getReturningObjFlag() );
-
-                        cursorNamingEnumeration = ( CursorNamingEnumeration ) referralConnection.getConnectionWrapper()
-                            .search(
-                                referralSearchBase, referralFilter, referralSearchControls, aliasesDereferencingMethod,
-                                referralsHandlingMethod, controls, monitor, referralsInfo );
-
-                        return cursorNamingEnumeration.hasMore();
-                    }
-                }
-            }
-
-            return false;
-        }
-        catch ( Exception e )
-        {
-            throw new NamingException( e.getMessage() );
-        }
-    }
-
-
-    /**
-     * @see java.util.Enumeration#hasMoreElements()
-     */
-    public boolean hasMoreElements()
-    {
-        throw new UnsupportedOperationException( "Call hasMore() instead of hasMoreElements() !" );
-    }
-
-
-    /**
-     * @see javax.naming.NamingEnumeration#next()
-     */
-    public StudioSearchResult next() throws NamingException
-    {
-        try
-        {
-            if ( currentSearchResultEntry != null )
-            {
-                SearchResult sr = new SearchResult( currentSearchResultEntry.getObjectName().toString(), null,
-                        AttributeUtils.toAttributes( currentSearchResultEntry.getEntry() ) );
-                sr.setNameInNamespace( currentSearchResultEntry.getObjectName().toString() );
-
-                // Converting the SearchResult to a StudioSearchResult
-                StudioSearchResult ssr = new StudioSearchResult( sr, connection, false, null );
-                return ssr;
-            }
-
-            // Are we following referrals manually?
-            if ( referralsHandlingMethod == ReferralHandlingMethod.FOLLOW_MANUALLY )
-            {
-                // Checking the current referral's URLs list
-                if ( ( currentReferralUrlsList != null ) && ( currentReferralUrlsList.size() > 0 ) )
-                {
-                    // Building an LDAP URL from the the url
-                    LdapURL url = new LdapURL( currentReferralUrlsList.remove( 0 ) );
-
-                    // Building the search result
-                    SearchResult searchResult = new SearchResult( url.getDn().getName(), null,
-                        new BasicAttributes(),
-                        false );
-                    searchResult.setNameInNamespace( url.getDn().getName() );
-
-                    return new StudioSearchResult( searchResult, null, false, url );
-                }
-            }
-            // Are we following referrals automatically?
-            else if ( referralsHandlingMethod == ReferralHandlingMethod.FOLLOW )
-            {
-                return new StudioSearchResult( cursorNamingEnumeration.next(), connection, true, null );
-            }
-
-            return null;
-        }
-        catch ( Exception e )
-        {
-            throw new NamingException( e.getMessage() );
-        }
-    }
-
-
-    /**
-     * @see java.util.Enumeration#nextElement()
-     */
-    public StudioSearchResult nextElement()
-    {
-        throw new UnsupportedOperationException( "Call next() instead of nextElement() !" );
-    }
-
-
-    /**
-     * Gets the connection.
-     * 
-     * @return the connection
-     */
-    public Connection getConnection()
-    {
-        return connection;
-    }
-
-
-    /**
-     * Gets the response controls.
-     * 
-     * @return the response controls, may be null
-     * 
-     * @throws NamingException the naming exception
-     */
-    public Control[] getResponseControls() throws NamingException
-    {
-        //        return ctx != null ? ctx.getResponseControls() : null;
-        // TODO implement
-        return new Control[0];
-    }
-
-    //    private boolean checkReferral()
-    //    {
-    //        boolean done = false;
-    //
-    //        // ignore exception if referrals handling method is IGNORE
-    //        // follow referral if referrals handling method is FOLLOW
-    //        // follow manually if referrals handling method is FOLLOW_MANUALLY
-    //        if ( referralsHandlingMethod == ReferralHandlingMethod.IGNORE )
-    //        {
-    //            done = true;
-    //            delegate = null;
-    //        }
-    //        else if ( referralsHandlingMethod == ReferralHandlingMethod.FOLLOW_MANUALLY )
-    //        {
-    //            delegate = new NamingEnumeration<SearchResult>()
-    //            {
-    //
-    //                List<LdapURL> urls = new ArrayList<LdapURL>();
-    //                {
-    //                    while ( referralsInfo.hasMoreReferrals() )
-    //                    {
-    //                        Referral referral = referralsInfo.getNextReferral();
-    //                        for ( IJndiLogger logger : ConnectionCorePlugin.getDefault().getJndiLoggers() )
-    //                        {
-    //                            logger.logSearchResultReference( connection, referral, referralsInfo, requestNum, null );
-    //                        }
-    //                        urls.addAll( referral.getLdapURLs() );
-    //                    }
-    //                }
-    //
-    //
-    //                public SearchResult nextElement()
-    //                {
-    //                    throw new UnsupportedOperationException( "Call next() instead of nextElement() !" );
-    //                }
-    //
-    //
-    //                public boolean hasMoreElements()
-    //                {
-    //                    throw new UnsupportedOperationException( "Call hasMore() instead of hasMoreElements() !" );
-    //                }
-    //
-    //
-    //                public SearchResult next() throws NamingException
-    //                {
-    //                    LdapURL url = urls.remove( 0 );
-    //                    SearchResult searchResult = new SearchResult( url.getDn().getName(), null, new BasicAttributes(),
-    //                        false );
-    //                    searchResult.setNameInNamespace( url.getDn().getName() );
-    //                    StudioSearchResult ssr = new StudioSearchResult( searchResult, null, false, url );
-    //                    return ssr;
-    //                }
-    //
-    //
-    //                public boolean hasMore() throws NamingException
-    //                {
-    //                    return !urls.isEmpty();
-    //                }
-    //
-    //
-    //                public void close() throws NamingException
-    //                {
-    //                    urls.clear();
-    //                    referralsInfo = null;
-    //                }
-    //            };
-    //        }
-    //        else if ( referralsHandlingMethod == ReferralHandlingMethod.FOLLOW )
-    //        {
-    //            Referral referral = referralsInfo.getNextReferral();
-    //            for ( IJndiLogger logger : ConnectionCorePlugin.getDefault().getJndiLoggers() )
-    //            {
-    //                logger.logSearchResultReference( connection, referral, referralsInfo, requestNum, null );
-    //            }
-    //
-    //            LdapURL url = referral.getLdapURLs().get( 0 );
-    //            Connection referralConnection = JNDIConnectionWrapper.getReferralConnection( referral, monitor, this );
-    //            if ( referralConnection != null )
-    //            {
-    //                done = false;
-    //                String referralSearchBase = url.getDn() != null && !url.getDn().isEmpty() ? url.getDn().getName()
-    //                    : searchBase;
-    //                String referralFilter = url.getFilter() != null && url.getFilter().length() == 0 ? url.getFilter()
-    //                    : filter;
-    //                SearchControls referralSearchControls = new SearchControls();
-    //                referralSearchControls.setSearchScope( url.getScope().getScope() > -1 ? url.getScope().getScope()
-    //                    : searchControls
-    //                        .getSearchScope() );
-    //                referralSearchControls.setReturningAttributes( url.getAttributes() != null
-    //                    && url.getAttributes().size() > 0 ? url.getAttributes().toArray(
-    //                    new String[url.getAttributes().size()] ) : searchControls.getReturningAttributes() );
-    //                referralSearchControls.setCountLimit( searchControls.getCountLimit() );
-    //                referralSearchControls.setTimeLimit( searchControls.getTimeLimit() );
-    //                referralSearchControls.setDerefLinkFlag( searchControls.getDerefLinkFlag() );
-    //                referralSearchControls.setReturningObjFlag( searchControls.getReturningObjFlag() );
-    //
-    //                delegate = referralConnection.getConnectionWrapper().search( referralSearchBase, referralFilter,
-    //                    referralSearchControls, aliasesDereferencingMethod, referralsHandlingMethod, controls, monitor,
-    //                    referralsInfo );
-    //            }
-    //            else
-    //            {
-    //                done = true;
-    //                delegate = null;
-    //            }
-    //        }
-    //        return done;
-    //    }
-
 }

Modified: directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/ConnectionWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/ConnectionWrapper.java?rev=1024334&r1=1024333&r2=1024334&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/ConnectionWrapper.java (original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/ConnectionWrapper.java Tue Oct 19 17:36:56 2010
@@ -31,7 +31,7 @@ import org.apache.directory.studio.commo
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.io.jndi.ReferralsInfo;
-import org.apache.directory.studio.connection.core.io.jndi.StudioNamingEnumeration;
+import org.apache.directory.studio.connection.core.io.jndi.JndiStudioNamingEnumeration;
 
 
 /**

Added: directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/StudioNamingEnumeration.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/StudioNamingEnumeration.java?rev=1024334&view=auto
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/StudioNamingEnumeration.java (added)
+++ directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/StudioNamingEnumeration.java Tue Oct 19 17:36:56 2010
@@ -0,0 +1,54 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.studio.connection.core.io;
+
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.Control;
+
+import org.apache.directory.studio.connection.core.Connection;
+
+
+/**
+ * A naming enumeration that handles referrals itself. 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface StudioNamingEnumeration extends NamingEnumeration<SearchResult>
+{
+    /**
+     * Gets the connection.
+     * 
+     * @return the connection
+     */
+    public Connection getConnection();
+
+
+    /**
+     * Gets the response controls.
+     * 
+     * @return the response controls, may be null
+     * 
+     * @throws NamingException the naming exception
+     */
+    public Control[] getResponseControls() throws NamingException;
+}

Copied: directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/CursorStudioNamingEnumeration.java (from r1024257, directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/CursorNamingEnumeration.java)
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/CursorStudioNamingEnumeration.java?p2=directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/CursorStudioNamingEnumeration.java&p1=directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/CursorNamingEnumeration.java&r1=1024257&r2=1024334&rev=1024334&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/CursorNamingEnumeration.java (original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/CursorStudioNamingEnumeration.java Tue Oct 19 17:36:56 2010
@@ -17,7 +17,7 @@
  *  under the License.
  *
  */
-package org.apache.directory.studio.connection.core.io;
+package org.apache.directory.studio.connection.core.io.api;
 
 
 import java.util.ArrayList;
@@ -32,7 +32,6 @@ import javax.naming.ldap.Control;
 import org.apache.directory.shared.ldap.cursor.Cursor;
 import org.apache.directory.shared.ldap.message.Referral;
 import org.apache.directory.shared.ldap.message.Response;
-import org.apache.directory.shared.ldap.message.SearchResultDone;
 import org.apache.directory.shared.ldap.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.message.SearchResultReference;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
@@ -41,9 +40,10 @@ import org.apache.directory.studio.commo
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
+import org.apache.directory.studio.connection.core.io.AbstractStudioNamingEnumeration;
+import org.apache.directory.studio.connection.core.io.StudioNamingEnumeration;
 import org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper;
 import org.apache.directory.studio.connection.core.io.jndi.ReferralsInfo;
-import org.apache.directory.studio.connection.core.io.jndi.StudioNamingEnumeration;
 import org.apache.directory.studio.connection.core.io.jndi.StudioSearchResult;
 
 
@@ -52,27 +52,13 @@ import org.apache.directory.studio.conne
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CursorNamingEnumeration extends StudioNamingEnumeration
+public class CursorStudioNamingEnumeration extends AbstractStudioNamingEnumeration
 {
-    private final Connection connection;
     private Cursor<Response> cursor;
     private SearchResultEntry currentSearchResultEntry;
-    private SearchResultDone searchResultDone;
     private List<Referral> referralsList = new ArrayList<Referral>();
     private List<String> currentReferralUrlsList;
-    private CursorNamingEnumeration cursorNamingEnumeration;
-
-    private long requestNum;
-    private long resultEntryCounter;
-
-    private String searchBase;
-    private String filter;
-    private SearchControls searchControls;
-    private AliasDereferencingMethod aliasesDereferencingMethod;
-    private ReferralHandlingMethod referralsHandlingMethod;
-    private Control[] controls;
-    private StudioProgressMonitor monitor;
-    private ReferralsInfo referralsInfo;
+    private StudioNamingEnumeration cursorNamingEnumeration;
 
 
     /**
@@ -89,17 +75,15 @@ public class CursorNamingEnumeration ext
      * @param monitor the progress monitor
      * @param referralsInfo the referrals info
      */
-    public CursorNamingEnumeration( Connection connection, Cursor<Response> cursor,
+    public CursorStudioNamingEnumeration( Connection connection, Cursor<Response> cursor,
         String searchBase, String filter, SearchControls searchControls,
         AliasDereferencingMethod aliasesDereferencingMethod, ReferralHandlingMethod referralsHandlingMethod,
         Control[] controls, long requestNum, StudioProgressMonitor monitor, ReferralsInfo referralsInfo )
     {
-        super( connection, null, null, null, searchBase, filter, searchControls, aliasesDereferencingMethod,
+        super( connection, searchBase, filter, searchControls, aliasesDereferencingMethod,
             referralsHandlingMethod, controls, requestNum, monitor, referralsInfo );
         this.connection = connection;
         this.cursor = cursor;
-        this.requestNum = requestNum;
-        this.resultEntryCounter = 0;
 
         this.searchBase = searchBase;
         this.filter = filter;
@@ -161,11 +145,6 @@ public class CursorNamingEnumeration ext
                         referralsList.add( ( ( SearchResultReference ) currentResponse ).getReferral() );
                     }
                 }
-                // Is it a search result done?
-                else if ( currentResponse instanceof SearchResultDone )
-                {
-                    searchResultDone = ( SearchResultDone ) currentResponse;
-                }
             }
 
             // Are we following referrals manually?
@@ -225,7 +204,7 @@ public class CursorNamingEnumeration ext
                         referralSearchControls.setDerefLinkFlag( searchControls.getDerefLinkFlag() );
                         referralSearchControls.setReturningObjFlag( searchControls.getReturningObjFlag() );
 
-                        cursorNamingEnumeration = ( CursorNamingEnumeration ) referralConnection.getConnectionWrapper()
+                        cursorNamingEnumeration = referralConnection.getConnectionWrapper()
                             .search(
                                 referralSearchBase, referralFilter, referralSearchControls, aliasesDereferencingMethod,
                                 referralsHandlingMethod, controls, monitor, referralsInfo );

Copied: directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java (from r1024257, directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/DirectoryApiConnectionWrapper.java)
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java?p2=directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java&p1=directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/DirectoryApiConnectionWrapper.java&r1=1024257&r2=1024334&rev=1024334&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/DirectoryApiConnectionWrapper.java (original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java Tue Oct 19 17:36:56 2010
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.studio.connection.core.io;
+package org.apache.directory.studio.connection.core.io.api;
 
 
 import java.util.ArrayList;
@@ -58,8 +58,9 @@ import org.apache.directory.studio.conne
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.ConnectionParameter.EncryptionMethod;
+import org.apache.directory.studio.connection.core.io.ConnectionWrapper;
+import org.apache.directory.studio.connection.core.io.StudioNamingEnumeration;
 import org.apache.directory.studio.connection.core.io.jndi.ReferralsInfo;
-import org.apache.directory.studio.connection.core.io.jndi.StudioNamingEnumeration;
 
 
 /**
@@ -227,7 +228,7 @@ public class DirectoryApiConnectionWrapp
             Cursor<Response> cursor = getLdapConnection().search( request );
 
             // Returning the result of the search
-            return new CursorNamingEnumeration( connection, cursor, searchBase, filter, searchControls,
+            return new CursorStudioNamingEnumeration( connection, cursor, searchBase, filter, searchControls,
                 aliasesDereferencingMethod, referralsHandlingMethod, controls, requestNum, monitor, referralsInfo );
 
         }

Modified: directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java?rev=1024334&r1=1024333&r2=1024334&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java (original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java Tue Oct 19 17:36:56 2010
@@ -327,7 +327,7 @@ public class JNDIConnectionWrapper imple
      * 
      * @return the naming enumeration or null if an exception occurs.
      */
-    public StudioNamingEnumeration search( final String searchBase, final String filter,
+    public JndiStudioNamingEnumeration search( final String searchBase, final String filter,
         final SearchControls searchControls, final AliasDereferencingMethod aliasesDereferencingMethod,
         final ReferralHandlingMethod referralsHandlingMethod, final Control[] controls,
         final StudioProgressMonitor monitor, final ReferralsInfo referralsInfo )
@@ -355,19 +355,19 @@ public class JNDIConnectionWrapper imple
                     // perform the search
                     NamingEnumeration<SearchResult> result = searchCtx.search( JNDIConnectionWrapper
                         .getSaveJndiName( searchBase ), filter, searchControls );
-                    namingEnumeration = new StudioNamingEnumeration( connection, searchCtx, result, null, searchBase,
+                    namingEnumeration = new JndiStudioNamingEnumeration( connection, searchCtx, result, null, searchBase,
                         filter, searchControls, aliasesDereferencingMethod, referralsHandlingMethod, controls,
                         requestNum, monitor, referralsInfo );
                 }
                 catch ( PartialResultException e )
                 {
-                    namingEnumeration = new StudioNamingEnumeration( connection, searchCtx, null, e, searchBase,
+                    namingEnumeration = new JndiStudioNamingEnumeration( connection, searchCtx, null, e, searchBase,
                         filter, searchControls, aliasesDereferencingMethod, referralsHandlingMethod, controls,
                         requestNum, monitor, referralsInfo );
                 }
                 catch ( ReferralException e )
                 {
-                    namingEnumeration = new StudioNamingEnumeration( connection, searchCtx, null, e, searchBase,
+                    namingEnumeration = new JndiStudioNamingEnumeration( connection, searchCtx, null, e, searchBase,
                         filter, searchControls, aliasesDereferencingMethod, referralsHandlingMethod, controls,
                         requestNum, monitor, referralsInfo );
                 }
@@ -1375,7 +1375,7 @@ public class JNDIConnectionWrapper imple
 
     abstract class InnerRunnable implements Runnable
     {
-        protected StudioNamingEnumeration namingEnumeration = null;
+        protected JndiStudioNamingEnumeration namingEnumeration = null;
         protected NamingException namingException = null;
         protected boolean canceled = false;
 
@@ -1396,7 +1396,7 @@ public class JNDIConnectionWrapper imple
          * 
          * @return the result
          */
-        public StudioNamingEnumeration getResult()
+        public JndiStudioNamingEnumeration getResult()
         {
             return namingEnumeration;
         }

Copied: directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JndiStudioNamingEnumeration.java (from r1024257, directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/StudioNamingEnumeration.java)
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JndiStudioNamingEnumeration.java?p2=directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JndiStudioNamingEnumeration.java&p1=directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/StudioNamingEnumeration.java&r1=1024257&r2=1024334&rev=1024334&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/StudioNamingEnumeration.java (original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JndiStudioNamingEnumeration.java Tue Oct 19 17:36:56 2010
@@ -40,6 +40,7 @@ import org.apache.directory.studio.commo
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
+import org.apache.directory.studio.connection.core.io.AbstractStudioNamingEnumeration;
 import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.connection.core.IJndiLogger;
 
@@ -49,9 +50,8 @@ import org.apache.directory.studio.conne
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StudioNamingEnumeration implements NamingEnumeration<SearchResult>
+public class JndiStudioNamingEnumeration extends AbstractStudioNamingEnumeration
 {
-    private final Connection connection;
     private final LdapContext ctx;
     private NamingEnumeration<SearchResult> initialNamingEnumeration;
     private NamingEnumeration<SearchResult> delegate;
@@ -60,15 +60,6 @@ public class StudioNamingEnumeration imp
     private long requestNum;
     private long resultEntryCounter;
 
-    private String searchBase;
-    private String filter;
-    private SearchControls searchControls;
-    private AliasDereferencingMethod aliasesDereferencingMethod;
-    private ReferralHandlingMethod referralsHandlingMethod;
-    private Control[] controls;
-    private StudioProgressMonitor monitor;
-    private ReferralsInfo referralsInfo;
-
 
     /**
      * Creates a new instance of ReferralNamingEnumeration.
@@ -84,27 +75,20 @@ public class StudioNamingEnumeration imp
      * @param monitor the progress monitor
      * @param referralsInfo the referrals info
      */
-    public StudioNamingEnumeration( Connection connection, LdapContext ctx, NamingEnumeration<SearchResult> delegate,
+    public JndiStudioNamingEnumeration( Connection connection, LdapContext ctx,
+        NamingEnumeration<SearchResult> delegate,
         NamingException initialReferralException, String searchBase, String filter, SearchControls searchControls,
         AliasDereferencingMethod aliasesDereferencingMethod, ReferralHandlingMethod referralsHandlingMethod,
         Control[] controls, long requestNum, StudioProgressMonitor monitor, ReferralsInfo referralsInfo )
     {
-        this.connection = connection;
+        super( connection, searchBase, filter, searchControls, aliasesDereferencingMethod, referralsHandlingMethod,
+            controls, requestNum, monitor, referralsInfo );
         this.ctx = ctx;
         this.initialNamingEnumeration = delegate;
         this.delegate = delegate;
         this.initialReferralException = initialReferralException;
         this.requestNum = requestNum;
         this.resultEntryCounter = 0;
-
-        this.searchBase = searchBase;
-        this.filter = filter;
-        this.searchControls = searchControls;
-        this.aliasesDereferencingMethod = aliasesDereferencingMethod;
-        this.referralsHandlingMethod = referralsHandlingMethod;
-        this.controls = controls;
-        this.monitor = monitor;
-        this.referralsInfo = referralsInfo;
     }
 
 
@@ -258,9 +242,9 @@ public class StudioNamingEnumeration imp
      */
     public Connection getConnection()
     {
-        if ( delegate instanceof StudioNamingEnumeration )
+        if ( delegate instanceof JndiStudioNamingEnumeration )
         {
-            return ( ( StudioNamingEnumeration ) delegate ).getConnection();
+            return ( ( JndiStudioNamingEnumeration ) delegate ).getConnection();
         }
         else
         {

Modified: directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlRunnable.java?rev=1024334&r1=1024333&r2=1024334&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlRunnable.java (original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlRunnable.java Tue Oct 19 17:36:56 2010
@@ -57,7 +57,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.connection.core.Connection;
-import org.apache.directory.studio.connection.core.io.jndi.StudioNamingEnumeration;
+import org.apache.directory.studio.connection.core.io.StudioNamingEnumeration;
 import org.apache.directory.studio.connection.core.jobs.StudioConnectionRunnableWithProgress;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;

Modified: directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java?rev=1024334&r1=1024333&r2=1024334&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java (original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java Tue Oct 19 17:36:56 2010
@@ -42,7 +42,7 @@ import org.apache.directory.studio.commo
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.connection.core.StudioPagedResultsControl;
-import org.apache.directory.studio.connection.core.io.jndi.StudioNamingEnumeration;
+import org.apache.directory.studio.connection.core.io.StudioNamingEnumeration;
 import org.apache.directory.studio.connection.core.jobs.StudioConnectionRunnableWithProgress;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;

Modified: directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java?rev=1024334&r1=1024333&r2=1024334&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java (original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java Tue Oct 19 17:36:56 2010
@@ -71,7 +71,7 @@ import org.apache.directory.studio.conne
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.DnUtils;
-import org.apache.directory.studio.connection.core.io.jndi.StudioNamingEnumeration;
+import org.apache.directory.studio.connection.core.io.StudioNamingEnumeration;
 import org.apache.directory.studio.connection.core.jobs.StudioConnectionBulkRunnableWithProgress;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.BulkModificationEvent;

Modified: directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java?rev=1024334&r1=1024333&r2=1024334&view=diff
==============================================================================
--- directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java (original)
+++ directory/studio/branches/studio-connection-refactoring/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java Tue Oct 19 17:36:56 2010
@@ -48,7 +48,7 @@ import org.apache.directory.studio.conne
 import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.connection.core.StudioPagedResultsControl;
-import org.apache.directory.studio.connection.core.io.jndi.StudioNamingEnumeration;
+import org.apache.directory.studio.connection.core.io.StudioNamingEnumeration;
 import org.apache.directory.studio.connection.core.io.jndi.StudioSearchResult;
 import org.apache.directory.studio.connection.core.jobs.StudioConnectionBulkRunnableWithProgress;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
@@ -320,7 +320,7 @@ public class SearchRunnable implements S
                     // iterate through the search result
                     while ( !monitor.isCanceled() && enumeration != null && enumeration.hasMore() )
                     {
-                        StudioSearchResult sr = enumeration.next();
+                        StudioSearchResult sr = ( StudioSearchResult ) enumeration.next();
                         boolean isContinuedSearchResult = sr.isContinuedSearchResult();
                         LdapURL searchContinuationUrl = sr.getSearchContinuationUrl();
 



Mime
View raw message