directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r827920 [3/4] - in /directory/studio/trunk: connection-core/src/main/java/org/apache/directory/studio/connection/core/ connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/ connection-ui/src/main/java/org/apache...
Date Wed, 21 Oct 2009 08:35:58 GMT
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryRunnable.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryRunnable.java Wed Oct 21 08:35:55 2009
@@ -21,13 +21,18 @@
 package org.apache.directory.studio.ldapbrowser.core.jobs;
 
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttributes;
+import javax.naming.ldap.Control;
+import javax.naming.ldap.ManageReferralControl;
 
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
 import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
-import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryAddedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -113,7 +118,13 @@
 
         if ( !monitor.errorsReported() )
         {
-            createdEntry = ReadEntryRunnable.getEntry( browserConnection, entryToCreate.getDn(), monitor );
+            List<StudioControl> controls = new ArrayList<StudioControl>();
+            if ( entryToCreate.isReferral() )
+            {
+                controls.add( StudioControl.MANAGEDSAIT_CONTROL );
+            }
+
+            createdEntry = ReadEntryRunnable.getEntry( browserConnection, entryToCreate.getDn(), controls, monitor );
             createdEntry.setHasChildrenHint( false );
 
             // set some flags at the parent
@@ -194,12 +205,16 @@
             }
         }
 
-        // determine referrals handling method
-        ReferralHandlingMethod referralsHandlingMethod = entryToCreate.isReferral() ? ReferralHandlingMethod.MANAGE
-            : ReferralHandlingMethod.FOLLOW;
+        // ManageDsaIT control
+        Control[] controls = null;
+        if ( entryToCreate.isReferral() )
+        {
+            controls = new Control[]
+                { new ManageReferralControl( false ) };
+        }
 
-        browserConnection.getConnection().getJNDIConnectionWrapper().createEntry( dn, jndiAttributes,
-            referralsHandlingMethod, null, monitor, null );
+        browserConnection.getConnection().getJNDIConnectionWrapper().createEntry( dn, jndiAttributes, controls,
+            monitor, null );
     }
 
 }

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java Wed Oct 21 08:35:55 2009
@@ -35,9 +35,11 @@
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.BasicControl;
 import javax.naming.ldap.Control;
+import javax.naming.ldap.ManageReferralControl;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioControl;
 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.jobs.StudioProgressMonitor;
@@ -49,7 +51,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
 import org.apache.directory.studio.ldapbrowser.core.utils.JNDIUtils;
 
 
@@ -147,8 +148,8 @@
 
             // delete from directory
             int errorStatusSize1 = monitor.getErrorStatus( "" ).getChildren().length; //$NON-NLS-1$
-            num = optimisticDeleteEntryRecursive( browserConnection, entryToDelete.getDn(), useTreeDeleteControl, num,
-                dummyMonitor, monitor );
+            num = optimisticDeleteEntryRecursive( browserConnection, entryToDelete.getDn(), entryToDelete.isReferral(),
+                useTreeDeleteControl, num, dummyMonitor, monitor );
             int errorStatusSize2 = monitor.getErrorStatus( "" ).getChildren().length; //$NON-NLS-1$
 
             if ( !monitor.isCanceled() )
@@ -215,6 +216,7 @@
      * 
      * @param browserConnection the browser connection
      * @param dn the DN to delete
+     * @param useManageDsaItControl true to use the ManageDsaIT control
      * @param useTreeDeleteControl true to use the tree delete control
      * @param numberOfDeletedEntries the number of deleted entries
      * @param dummyMonitor the dummy monitor
@@ -223,12 +225,12 @@
      * @return the cumulative number of deleted entries
      */
     static int optimisticDeleteEntryRecursive( IBrowserConnection browserConnection, LdapDN dn,
-        boolean useTreeDeleteControl, int numberOfDeletedEntries, StudioProgressMonitor dummyMonitor,
-        StudioProgressMonitor monitor )
+        boolean useManageDsaItControl, boolean useTreeDeleteControl, int numberOfDeletedEntries,
+        StudioProgressMonitor dummyMonitor, StudioProgressMonitor monitor )
     {
         // try to delete entry
         dummyMonitor.reset();
-        deleteEntry( browserConnection, dn, useTreeDeleteControl, dummyMonitor );
+        deleteEntry( browserConnection, dn, useManageDsaItControl, useTreeDeleteControl, dummyMonitor );
 
         if ( !dummyMonitor.errorsReported() )
         {
@@ -241,9 +243,7 @@
         {
             // do not follow referrals or dereference aliases when deleting entries
             AliasDereferencingMethod aliasDereferencingMethod = AliasDereferencingMethod.NEVER;
-            ReferralHandlingMethod referralsHandlingMethod = browserConnection.getRootDSE().isControlSupported(
-                StudioControl.MANAGEDSAIT_CONTROL.getOid() ) ? ReferralHandlingMethod.MANAGE
-                : ReferralHandlingMethod.IGNORE;
+            ReferralHandlingMethod referralsHandlingMethod = ReferralHandlingMethod.IGNORE;
 
             // perform one-level search and delete recursively
             int numberInBatch;
@@ -269,7 +269,7 @@
                         LdapDN childDn = JNDIUtils.getDn( sr );
 
                         numberOfDeletedEntries = optimisticDeleteEntryRecursive( browserConnection, childDn, false,
-                            numberOfDeletedEntries, dummyMonitor, monitor );
+                            false, numberOfDeletedEntries, dummyMonitor, monitor );
                         numberInBatch++;
                     }
                 }
@@ -292,7 +292,7 @@
             // try to delete the entry again 
             if ( !dummyMonitor.errorsReported() )
             {
-                deleteEntry( browserConnection, dn, false, dummyMonitor );
+                deleteEntry( browserConnection, dn, false, false, dummyMonitor );
             }
             if ( !dummyMonitor.errorsReported() )
             {
@@ -340,8 +340,8 @@
     }
 
 
-    static void deleteEntry( IBrowserConnection browserConnection, LdapDN dn, boolean useTreeDeleteControl,
-        StudioProgressMonitor monitor )
+    static void deleteEntry( IBrowserConnection browserConnection, LdapDN dn, boolean useManageDsaItControl,
+        boolean useTreeDeleteControl, StudioProgressMonitor monitor )
     {
         // controls
         List<Control> controlList = new ArrayList<Control>();
@@ -352,18 +352,18 @@
                 StudioControl.TREEDELETE_CONTROL.isCritical(), StudioControl.TREEDELETE_CONTROL.getControlValue() );
             controlList.add( treeDeleteControl );
         }
+        if ( useManageDsaItControl
+            && browserConnection.getRootDSE().isControlSupported( StudioControl.MANAGEDSAIT_CONTROL.getOid() ) )
+        {
+            controlList.add( new ManageReferralControl( false ) );
+        }
         Control[] controls = controlList.toArray( new Control[controlList.size()] );
 
-        // do not follow referrals
-        ReferralHandlingMethod referralsHandlingMethod = browserConnection.getRootDSE().isControlSupported(
-            StudioControl.MANAGEDSAIT_CONTROL.getOid() ) ? ReferralHandlingMethod.MANAGE
-            : ReferralHandlingMethod.IGNORE;
-
         // delete entry
         if ( browserConnection.getConnection() != null )
         {
-            browserConnection.getConnection().getJNDIConnectionWrapper().deleteEntry( dn.getUpName(),
-                referralsHandlingMethod, controls, monitor, null );
+            browserConnection.getConnection().getJNDIConnectionWrapper().deleteEntry( dn.getUpName(), controls,
+                monitor, null );
         }
     }
 

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java Wed Oct 21 08:35:55 2009
@@ -259,7 +259,7 @@
             // Creating and adding a search result entry or reference for each result
             while ( ne.hasMore() )
             {
-                SearchResult searchResult = ( SearchResult ) ne.nextElement();
+                SearchResult searchResult = ( SearchResult ) ne.next();
                 sr.addResponse( convertSearchResultToDsml( searchResult, searchParameter ) );
             }
         }
@@ -398,7 +398,7 @@
             // Creating and adding an add request for each result
             while ( ne.hasMore() )
             {
-                SearchResult searchResult = ( SearchResult ) ne.nextElement();
+                SearchResult searchResult = ( SearchResult ) ne.next();
                 AddRequestDsml arDsml = convertToAddRequestDsml( searchResult );
                 batchRequest.addRequest( arDsml );
             }

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java Wed Oct 21 08:35:55 2009
@@ -38,13 +38,13 @@
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.directory.shared.ldap.name.LdapDN;
 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.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
-import org.apache.directory.studio.ldapbrowser.core.model.StudioPagedResultsControl;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
 import org.apache.directory.studio.ldapbrowser.core.utils.AttributeComparator;
 import org.apache.directory.studio.ldapbrowser.core.utils.JNDIUtils;

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlJob.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlJob.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlJob.java Wed Oct 21 08:35:55 2009
@@ -33,7 +33,7 @@
 import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
-import javax.naming.ldap.ExtendedRequest;
+import javax.naming.ldap.Control;
 
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
@@ -46,7 +46,9 @@
 import org.apache.directory.shared.dsmlv2.reponse.ModDNResponseDsml;
 import org.apache.directory.shared.dsmlv2.reponse.ModifyResponseDsml;
 import org.apache.directory.shared.dsmlv2.request.BatchRequest;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
+import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapResultCodec;
 import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
 import org.apache.directory.shared.ldap.codec.bind.BindRequestCodec;
@@ -78,6 +80,8 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
 
+import com.sun.jndi.ldap.BasicControl;
+
 
 /**
  * This class implements a Job for Importing a DSML File into a LDAP server
@@ -321,7 +325,7 @@
         // Executing the add request
         Entry entry = request.getEntry();
         browserConnection.getConnection().getJNDIConnectionWrapper().createEntry( entry.getDn().getUpName(),
-            AttributeUtils.toAttributes( entry ), ReferralHandlingMethod.IGNORE, null, monitor, null );
+            AttributeUtils.toAttributes( entry ), getControls( request ), monitor, null );
 
         // Creating the response
         if ( batchResponseDsml != null )
@@ -388,7 +392,7 @@
     {
         // Executing the del request
         browserConnection.getConnection().getJNDIConnectionWrapper().deleteEntry( request.getEntry().getUpName(),
-            ReferralHandlingMethod.IGNORE, null, monitor, null );
+            getControls( request ), monitor, null );
 
         // Creating the response
         if ( batchResponseDsml != null )
@@ -465,7 +469,7 @@
 
         // Executing the modify request
         browserConnection.getConnection().getJNDIConnectionWrapper().modifyEntry( request.getObject().getUpName(),
-            modificationItems.toArray( new ModificationItem[0] ), ReferralHandlingMethod.IGNORE, null, monitor, null );
+            modificationItems.toArray( new ModificationItem[0] ), getControls( request ), monitor, null );
 
         // Creating the response
         if ( batchResponseDsml != null )
@@ -522,8 +526,7 @@
     {
         // Executing the modify DN request
         browserConnection.getConnection().getJNDIConnectionWrapper().renameEntry( request.getEntry().getUpName(),
-            request.getNewRDN().getUpName(), request.isDeleteOldRDN(), ReferralHandlingMethod.IGNORE, null, monitor,
-            null );
+            request.getNewRDN().getUpName(), request.isDeleteOldRDN(), getControls( request ), monitor, null );
 
         // Creating the response
         if ( batchResponseDsml != null )
@@ -580,7 +583,8 @@
             // [Optimization] We're only searching if we need to produce a response
             StudioNamingEnumeration ne = browserConnection.getConnection().getJNDIConnectionWrapper().search(
                 request.getBaseObject().getUpName(), request.getFilter().toString(), getSearchControls( request ),
-                getAliasDereferencingMethod( request ), ReferralHandlingMethod.IGNORE, null, monitor, null );
+                getAliasDereferencingMethod( request ), ReferralHandlingMethod.IGNORE, getControls( request ), monitor,
+                null );
 
             SearchParameter sp = new SearchParameter();
             sp.setReferralsHandlingMethod( browserConnection.getReferralsHandlingMethod() );
@@ -670,6 +674,24 @@
     }
 
 
+    private Control[] getControls( LdapMessageCodec request )
+    {
+        List<ControlCodec> controls = request.getControls();
+        if ( controls != null )
+        {
+            List<Control> jndiControls = new ArrayList<Control>();
+            for ( ControlCodec control : controls )
+            {
+                Control jndiControl = new BasicControl( control.getControlType(), control.getCriticality(), control
+                    .getEncodedValue() );
+                jndiControls.add( jndiControl );
+            }
+            return jndiControls.toArray( new Control[jndiControls.size()] );
+        }
+        return null;
+    }
+
+
     /**
      * Get the LDAP Result corresponding to the given monitor
      *

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java Wed Oct 21 08:35:55 2009
@@ -52,7 +52,6 @@
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionCoreConstants;
 import org.apache.directory.studio.connection.core.DnUtils;
-import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.BulkModificationEvent;
@@ -456,7 +455,7 @@
             }
 
             browserConnection.getConnection().getJNDIConnectionWrapper().createEntry( dn, jndiAttributes,
-                ReferralHandlingMethod.IGNORE, getControls( record ), monitor, null );
+                getControls( record ), monitor, null );
 
             if ( monitor.errorsReported() && updateIfEntryExists
                 && monitor.getException() instanceof NameAlreadyBoundException )
@@ -466,14 +465,14 @@
 
                 ModificationItem[] mis = ModelConverter.entryToReplaceModificationItems( dummyEntry );
                 browserConnection.getConnection().getJNDIConnectionWrapper().modifyEntry( dn, mis,
-                    ReferralHandlingMethod.IGNORE, getControls( record ), monitor, null );
+                    getControls( record ), monitor, null );
             }
         }
         else if ( record instanceof LdifChangeDeleteRecord )
         {
             LdifChangeDeleteRecord changeDeleteRecord = ( LdifChangeDeleteRecord ) record;
             browserConnection.getConnection().getJNDIConnectionWrapper().deleteEntry( dn,
-                ReferralHandlingMethod.IGNORE, getControls( changeDeleteRecord ), monitor, null );
+                getControls( changeDeleteRecord ), monitor, null );
         }
         else if ( record instanceof LdifChangeModifyRecord )
         {
@@ -506,7 +505,7 @@
             }
 
             browserConnection.getConnection().getJNDIConnectionWrapper().modifyEntry( dn, mis,
-                ReferralHandlingMethod.IGNORE, getControls( modifyRecord ), monitor, null );
+                getControls( modifyRecord ), monitor, null );
         }
         else if ( record instanceof LdifChangeModDnRecord )
         {
@@ -529,7 +528,7 @@
                 }
 
                 browserConnection.getConnection().getJNDIConnectionWrapper().renameEntry( dn, newDn.toString(),
-                    deleteOldRdn, ReferralHandlingMethod.IGNORE, getControls( modDnRecord ), monitor, null );
+                    deleteOldRdn, getControls( modDnRecord ), monitor, null );
             }
         }
     }

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java Wed Oct 21 08:35:55 2009
@@ -30,6 +30,7 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescription;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioControl;
 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.jobs.StudioBulkRunnableWithProgress;
@@ -145,6 +146,11 @@
         {
             if ( entry.getBrowserConnection() != null && entry.isAttributesInitialized() )
             {
+                // lookup the entry from cache and fire event with real entry
+                if ( entry.getBrowserConnection().getEntryFromCache( entry.getDn() ) != null )
+                {
+                    entry = entry.getBrowserConnection().getEntryFromCache( entry.getDn() );
+                }
                 EventRegistry.fireEntryUpdated( new AttributesInitializedEvent( entry ), this );
             }
         }
@@ -219,10 +225,6 @@
                 aliasesDereferencingMethod = AliasDereferencingMethod.NEVER;
             }
             ReferralHandlingMethod referralsHandlingMethod = entry.getBrowserConnection().getReferralsHandlingMethod();
-            if ( entry.isReferral() )
-            {
-                referralsHandlingMethod = ReferralHandlingMethod.MANAGE;
-            }
 
             if ( clearAllAttributes )
             {
@@ -240,10 +242,18 @@
                 }
             }
 
-            // search
+            // create search
             ISearch search = new Search( null, entry.getBrowserConnection(), entry.getDn(),
                 entry.isSubentry() ? ISearch.FILTER_SUBENTRY : ISearch.FILTER_TRUE, attributes, SearchScope.OBJECT, 0,
                 0, aliasesDereferencingMethod, referralsHandlingMethod, false, null );
+
+            // add controls
+            if ( entry.isReferral() )
+            {
+                search.getControls().add( StudioControl.MANAGEDSAIT_CONTROL );
+            }
+
+            // search
             SearchRunnable.searchAndUpdateModel( entry.getBrowserConnection(), search, monitor );
 
             // we requested all attributes, set initialized state

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java Wed Oct 21 08:35:55 2009
@@ -26,6 +26,8 @@
 import java.util.List;
 
 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.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
@@ -36,15 +38,15 @@
 import org.apache.directory.studio.ldapbrowser.core.events.ChildrenInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IContinuation;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
-import org.apache.directory.studio.ldapbrowser.core.model.StudioPagedResultsControl;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
-import org.apache.directory.studio.ldapbrowser.core.model.impl.AliasBaseEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.impl.ContinuedSearchResultEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Search;
+import org.apache.directory.studio.ldapbrowser.core.model.impl.SearchContinuation;
 
 
 /**
@@ -60,7 +62,7 @@
     private IEntry[] entries;
 
     /** The purge all caches flag. */
-    boolean purgeAllCaches;
+    private boolean purgeAllCaches;
 
     /** The paged search control, only used internally. */
     private StudioControl pagedSearchControl;
@@ -208,10 +210,12 @@
         ISearch search = createSearch( parent, pagedSearchControl, false, false, false );
 
         // search
-        ISearchResult[] srs = executeSearch( parent, search, monitor );
+        executeSearch( parent, search, monitor );
+        ISearchResult[] srs = search.getSearchResults();
+        SearchContinuation[] scs = search.getSearchContinuations();
 
         // fill children in search result
-        if ( srs != null && srs.length > 0 )
+        if ( (srs != null && srs.length > 0) || (scs != null && scs.length > 0) )
         {
             // clearing old children before filling new children is
             // necessary to handle aliases and referrals.
@@ -219,20 +223,26 @@
 
             do
             {
-                for ( ISearchResult searchResult : srs )
+                if(srs != null)
                 {
-                    if ( parent.isAlias() && !( searchResult.getEntry() instanceof AliasBaseEntry ) )
+                    for ( ISearchResult searchResult : srs )
                     {
-                        AliasBaseEntry aliasBaseEntry = new AliasBaseEntry( searchResult.getEntry()
-                            .getBrowserConnection(), searchResult.getEntry().getDn() );
-                        parent.addChild( aliasBaseEntry );
+                        parent.addChild( searchResult.getEntry() );
                     }
-                    else
+                    srs = null;
+                }
+                
+                if(scs != null)
+                {
+                    for ( SearchContinuation searchContinuation : scs )
                     {
-                        parent.addChild( searchResult.getEntry() );
+                        ContinuedSearchResultEntry entry = new ContinuedSearchResultEntry( parent
+                            .getBrowserConnection(), searchContinuation.getUrl().getDn() );
+                        entry.setUnresolved( searchContinuation.getUrl() );
+                        parent.addChild( entry );
                     }
+                    scs = null;
                 }
-                srs = null;
 
                 StudioPagedResultsControl sprRequestControl = null;
                 StudioPagedResultsControl sprResponseControl = null;
@@ -285,7 +295,9 @@
                             search.getResponseControls().clear();
                             sprRequestControl.setCookie( sprResponseControl.getCookie() );
 
-                            srs = executeSearch( parent, search, monitor );
+                            executeSearch( parent, search, monitor );
+                            srs = search.getSearchResults();
+                            scs = search.getSearchContinuations();
                         }
                     }
                 }
@@ -322,7 +334,9 @@
 
     private void executeSubSearch( IEntry parent, ISearch subSearch, StudioProgressMonitor monitor )
     {
-        ISearchResult[] subSrs = executeSearch( parent, subSearch, monitor );
+        executeSearch( parent, subSearch, monitor );
+        ISearchResult[] subSrs = subSearch.getSearchResults();
+        SearchContinuation[] subScs = subSearch.getSearchContinuations();
 
         // fill children in search result
         if ( subSrs != null && subSrs.length > 0 )
@@ -331,81 +345,90 @@
             {
                 parent.addChild( searchResult.getEntry() );
             }
+            for ( SearchContinuation searchContinuation : subScs )
+            {
+                ContinuedSearchResultEntry entry = new ContinuedSearchResultEntry( parent
+                    .getBrowserConnection(), searchContinuation.getUrl().getDn() );
+                entry.setUnresolved( searchContinuation.getUrl() );
+                parent.addChild( entry );
+            }
         }
     }
 
 
-    private static ISearchResult[] executeSearch( IEntry parent, ISearch search, StudioProgressMonitor monitor )
+    private static void executeSearch( IEntry parent, ISearch search, StudioProgressMonitor monitor )
     {
         SearchRunnable.searchAndUpdateModel( parent.getBrowserConnection(), search, monitor );
         ISearchResult[] srs = search.getSearchResults();
         monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_progress_subcount,
             new String[]
                 { srs == null ? Integer.toString( 0 ) : Integer.toString( srs.length ), parent.getDn().getUpName() } ) );
-        return srs;
     }
 
 
     private static ISearch createSearch( IEntry parent, StudioControl pagedSearchControl, boolean isSubSearch,
         boolean isAliasSearch, boolean isReferralsSearch )
     {
-        // determine alias and referral handling
+        // scope
         SearchScope scope = SearchScope.ONELEVEL;
+
+        // filter
+        String filter = parent.getChildrenFilter();
+        if ( isSubSearch )
+        {
+            filter = ISearch.FILTER_SUBENTRY;
+        }
+        else if ( isAliasSearch && isReferralsSearch )
+        {
+            filter = ISearch.FILTER_ALIAS_OR_REFERRAL;
+        }
+        else if ( isAliasSearch )
+        {
+            filter = ISearch.FILTER_ALIAS;
+        }
+        else if ( isReferralsSearch )
+        {
+            filter = ISearch.FILTER_REFERRAL;
+        }
+
+        // alias handling
         AliasDereferencingMethod aliasesDereferencingMethod = parent.getBrowserConnection()
             .getAliasesDereferencingMethod();
         if ( parent.isAlias() || isAliasSearch )
         {
             aliasesDereferencingMethod = AliasDereferencingMethod.NEVER;
         }
+
+        // referral handling
         ReferralHandlingMethod referralsHandlingMethod = parent.getBrowserConnection().getReferralsHandlingMethod();
-        if ( parent.isReferral() || isReferralsSearch )
-        {
-            referralsHandlingMethod = ReferralHandlingMethod.MANAGE;
-        }
 
-        if ( isSubSearch )
+        // create search
+        ISearch search = new Search( null, parent.getBrowserConnection(), parent.getDn(), filter,
+            ISearch.NO_ATTRIBUTES, scope, parent.getBrowserConnection().getCountLimit(), parent.getBrowserConnection()
+                .getTimeLimit(), aliasesDereferencingMethod, referralsHandlingMethod, BrowserCorePlugin.getDefault()
+                .getPluginPreferences().getBoolean( BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ), null );
+
+        // controls
+        if ( parent.isReferral() || isReferralsSearch || parent.getBrowserConnection().isManageDsaIT() )
         {
-            ISearch subSearch = new Search( null, parent.getBrowserConnection(), parent.getDn(), parent
-                .getChildrenFilter() != null ? parent.getChildrenFilter() : ISearch.FILTER_SUBENTRY,
-                ISearch.NO_ATTRIBUTES, scope, parent.getBrowserConnection().getCountLimit(), parent
-                    .getBrowserConnection().getTimeLimit(), aliasesDereferencingMethod, referralsHandlingMethod,
-                BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
-                    BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ), null );
-            subSearch.getSearchParameter().getControls().add( StudioControl.SUBENTRIES_CONTROL );
-            return subSearch;
+            search.getSearchParameter().getControls().add( StudioControl.MANAGEDSAIT_CONTROL );
         }
-        else
+        if ( pagedSearchControl != null )
         {
-            String filter = parent.getChildrenFilter();
-            if ( isAliasSearch && isReferralsSearch )
-            {
-                filter = ISearch.FILTER_ALIAS_OR_REFERRAL;
-            }
-            else if ( isAliasSearch )
-            {
-                filter = ISearch.FILTER_ALIAS;
-            }
-            else if ( isReferralsSearch )
-            {
-                filter = ISearch.FILTER_REFERRAL;
-            }
-
-            ISearch search = new Search( null, parent.getBrowserConnection(), parent.getDn(), filter,
-                ISearch.NO_ATTRIBUTES, scope, parent.getBrowserConnection().getCountLimit(), parent
-                    .getBrowserConnection().getTimeLimit(), aliasesDereferencingMethod, referralsHandlingMethod,
-                BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
-                    BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ), null );
-            if ( pagedSearchControl != null )
-            {
-                search.getSearchParameter().getControls().add( pagedSearchControl );
-            }
-            return search;
+            search.getSearchParameter().getControls().add( pagedSearchControl );
         }
+
+        return search;
     }
 
 
     static void clearCaches( IEntry entry, boolean purgeAllCaches )
     {
+        if(entry instanceof IContinuation)
+        {
+            return;
+        }
+        
         // clear the parent-child relationship, recursively
         IEntry[] children = entry.getChildren();
         if ( children != null )

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java Wed Oct 21 08:35:55 2009
@@ -33,6 +33,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.DnUtils;
+import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.BulkModificationEvent;
@@ -174,8 +175,8 @@
                         if ( !dummyMonitor.errorsReported() )
                         {
                             dummyMonitor.reset();
-                            numDel = DeleteEntriesJob.optimisticDeleteEntryRecursive( browserConnection, oldDn, false,
-                                numDel, dummyMonitor, monitor );
+                            numDel = DeleteEntriesJob.optimisticDeleteEntryRecursive( browserConnection, oldDn,
+                                oldEntry.isReferral(), false, numDel, dummyMonitor, monitor );
                         }
                     }
                     else
@@ -206,7 +207,12 @@
 
                 // add new entry to new parent
                 boolean hasMoreChildren = newParent.hasMoreChildren() || !newParent.isChildrenInitialized();
-                IEntry newEntry = ReadEntryRunnable.getEntry( browserConnection, newDn, monitor );
+                List<StudioControl> controls = new ArrayList<StudioControl>();
+                if ( oldEntry.isReferral() )
+                {
+                    controls.add( StudioControl.MANAGEDSAIT_CONTROL );
+                }
+                IEntry newEntry = ReadEntryRunnable.getEntry( browserConnection, newDn, controls, monitor );
                 newEntries[i] = newEntry;
                 newParent.addChild( newEntry );
                 newParent.setHasMoreChildren( hasMoreChildren );

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryRunnable.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryRunnable.java Wed Oct 21 08:35:55 2009
@@ -21,8 +21,11 @@
 package org.apache.directory.studio.ldapbrowser.core.jobs;
 
 
+import java.util.List;
+
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioControl;
 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.jobs.StudioBulkRunnableWithProgress;
@@ -131,7 +134,7 @@
             pm.reportProgress( " " ); //$NON-NLS-1$
             pm.worked( 1 );
 
-            readEntry = getEntry( browserConnection, dn, pm );
+            readEntry = getEntry( browserConnection, dn, null, pm );
         }
     }
 
@@ -149,11 +152,12 @@
      * 
      * @param browserConnection the browser connection
      * @param dn the DN of the entry
+     * @param controls the LDAP controls
      * @param monitor the progress monitor
      * 
      * @return the read entry
      */
-    static IEntry getEntry( IBrowserConnection browserConnection, LdapDN dn, StudioProgressMonitor monitor )
+    static IEntry getEntry( IBrowserConnection browserConnection, LdapDN dn, List<StudioControl> controls, StudioProgressMonitor monitor )
     {
         try
         {
@@ -166,7 +170,7 @@
 
             // search in directory
             ISearch search = new Search( null, browserConnection, dn, null, ISearch.NO_ATTRIBUTES, SearchScope.OBJECT,
-                1, 0, AliasDereferencingMethod.NEVER, ReferralHandlingMethod.MANAGE, true, null );
+                1, 0, AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, true, controls );
             SearchRunnable.searchAndUpdateModel( browserConnection, search, monitor );
             ISearchResult[] srs = search.getSearchResults();
             if ( srs.length > 0 )

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java Wed Oct 21 08:35:55 2009
@@ -28,13 +28,15 @@
 
 import javax.naming.ContextNotEmptyException;
 import javax.naming.directory.SearchControls;
+import javax.naming.ldap.Control;
+import javax.naming.ldap.ManageReferralControl;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.DnUtils;
+import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
-import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryRenamedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -158,8 +160,8 @@
                     if ( !dummyMonitor.errorsReported() )
                     {
                         dummyMonitor.reset();
-                        DeleteEntriesJob.optimisticDeleteEntryRecursive( browserConnection, oldDn, false, 0,
-                            dummyMonitor, monitor );
+                        DeleteEntriesJob.optimisticDeleteEntryRecursive( browserConnection, oldDn, oldEntry
+                            .isReferral(), false, 0, dummyMonitor, monitor );
                     }
                 }
                 else
@@ -189,7 +191,12 @@
             IEntry parent = oldEntry.getParententry();
             boolean hasMoreChildren = parent.hasMoreChildren();
             parent.deleteChild( oldEntry );
-            newEntry = ReadEntryRunnable.getEntry( browserConnection, newDn, monitor );
+            List<StudioControl> controls = new ArrayList<StudioControl>();
+            if ( oldEntry.isReferral() )
+            {
+                controls.add( StudioControl.MANAGEDSAIT_CONTROL );
+            }
+            newEntry = ReadEntryRunnable.getEntry( browserConnection, newDn, controls, monitor );
             parent.addChild( newEntry );
             parent.setHasMoreChildren( hasMoreChildren );
 
@@ -242,7 +249,6 @@
     }
 
 
-    
     /**
      * Moves/Renames an entry.
      * 
@@ -258,14 +264,18 @@
         String oldDnString = entry.getDn().getUpName();
         String newDnString = newDn.getUpName();
 
-        // determine referrals handling method
-        ReferralHandlingMethod referralsHandlingMethod = entry.isReferral() ? ReferralHandlingMethod.MANAGE
-            : ReferralHandlingMethod.FOLLOW;
+        // ManageDsaIT control
+        Control[] controls = null;
+        if ( entry.isReferral() )
+        {
+            controls = new Control[]
+                { new ManageReferralControl( false ) };
+        }
 
         if ( browserConnection.getConnection() != null )
         {
             browserConnection.getConnection().getJNDIConnectionWrapper().renameEntry( oldDnString, newDnString, true,
-                referralsHandlingMethod, null, monitor, null );
+                controls, monitor, null );
         }
     }
 

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java Wed Oct 21 08:35:55 2009
@@ -40,8 +40,11 @@
 
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.studio.connection.core.Connection;
 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.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.io.jndi.StudioNamingEnumeration;
@@ -59,12 +62,11 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
-import org.apache.directory.studio.ldapbrowser.core.model.StudioPagedResultsControl;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.BaseDNEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.impl.ContinuedSearchResultEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Entry;
-import org.apache.directory.studio.ldapbrowser.core.model.impl.ReferralBaseEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.impl.SearchContinuation;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Value;
 import org.apache.directory.studio.ldapbrowser.core.utils.JNDIUtils;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
@@ -309,6 +311,7 @@
                 // add returning attributes for children and alias detection
                 SearchParameter searchParameter = getSearchParameter( search );
                 ArrayList<ISearchResult> searchResultList = new ArrayList<ISearchResult>();
+                ArrayList<SearchContinuation> searchContinuationList = new ArrayList<SearchContinuation>();
 
                 StudioNamingEnumeration enumeration = null;
                 // search
@@ -320,37 +323,54 @@
                     while ( !monitor.isCanceled() && enumeration != null && enumeration.hasMore() )
                     {
                         StudioSearchResult sr = enumeration.next();
-                        LdapDN dn = JNDIUtils.getDn( sr );
-                        boolean isReferral = sr.isReferral();
-                        Connection resultConnection = sr.getConnection();
-                        IBrowserConnection resultBrowserConnection = BrowserCorePlugin.getDefault()
-                            .getConnectionManager().getBrowserConnection( resultConnection );
-                        if ( resultBrowserConnection == null )
-                        {
-                            resultBrowserConnection = browserConnection;
-                        }
+                        boolean isContinuedSearchResult = sr.isContinuedSearchResult();
+                        LdapURL searchContinuationUrl = sr.getSearchContinuationUrl();
 
-                        // get entry from cache or create it
-                        IEntry entry = resultBrowserConnection.getEntryFromCache( dn );
-                        if ( entry == null )
+                        if ( searchContinuationUrl == null )
                         {
-                            entry = createAndCacheEntry( resultBrowserConnection, dn, monitor );
-                        }
+                            LdapDN dn = JNDIUtils.getDn( sr );
+                            IEntry entry = null;
+
+                            Connection resultConnection = sr.getConnection();
+                            IBrowserConnection resultBrowserConnection = BrowserCorePlugin.getDefault()
+                                .getConnectionManager().getBrowserConnection( resultConnection );
+                            if ( resultBrowserConnection == null )
+                            {
+                                resultBrowserConnection = browserConnection;
+                            }
+
+                            // get entry from cache or create it
+                            entry = resultBrowserConnection.getEntryFromCache( dn );
+                            if ( entry == null )
+                            {
+                                entry = createAndCacheEntry( resultBrowserConnection, dn, monitor );
+                            }
+
+                            // initialize special flags
+                            initFlags( entry, sr, searchParameter );
 
-                        // initialize special flags
-                        initFlags( entry, sr, searchParameter );
+                            // fill the attributes
+                            fillAttributes( entry, sr, search.getSearchParameter() );
 
-                        // fill the attributes
-                        fillAttributes( entry, sr, search.getSearchParameter() );
+                            if ( isContinuedSearchResult )
+                            {
+                                // the result is from a continued search
+                                // we create a special entry that displays the URL of the entry
+                                entry = new ContinuedSearchResultEntry( resultBrowserConnection, dn );
+                            }
 
-                        if ( isReferral )
+                            searchResultList
+                                .add( new org.apache.directory.studio.ldapbrowser.core.model.impl.SearchResult( entry,
+                                    search ) );
+                        }
+                        else
                         {
-                            entry = new ReferralBaseEntry( resultBrowserConnection, dn );
+                            //entry = new ContinuedSearchResultEntry( resultBrowserConnection, dn );
+                            SearchContinuation searchContinuation = new SearchContinuation( search,
+                                searchContinuationUrl );
+                            searchContinuationList.add( searchContinuation );
                         }
 
-                        searchResultList.add( new org.apache.directory.studio.ldapbrowser.core.model.impl.SearchResult(
-                            entry, search ) );
-
                         monitor
                             .reportProgress( searchResultList.size() == 1 ? BrowserCoreMessages.model__retrieved_1_entry
                                 : BrowserCoreMessages.bind( BrowserCoreMessages.model__retrieved_n_entries,
@@ -414,6 +434,8 @@
 
                 search.setSearchResults( ( ISearchResult[] ) searchResultList
                     .toArray( new ISearchResult[searchResultList.size()] ) );
+                search.setSearchContinuations( ( SearchContinuation[] ) searchContinuationList
+                    .toArray( new SearchContinuation[searchContinuationList.size()] ) );
             }
         }
         catch ( Exception e )
@@ -639,6 +661,7 @@
                         entry = new BaseDNEntry( aDN, browserConnection );
                         browserConnection.getRootDSE().addChild( entry );
                         browserConnection.cacheEntry( entry );
+                        enumeration.close();
                     }
                 }
                 catch ( NamingException e )
@@ -725,7 +748,7 @@
                             entry.setReferral( true );
                             entry.setHasChildrenHint( false );
                         }
-                        
+
                         IAttribute ocAttribute = entry.getAttribute( attributeDescription );
                         Value ocValue = new Value( ocAttribute, value );
                         ocAttribute.addValue( ocValue );

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java Wed Oct 21 08:35:55 2009
@@ -204,6 +204,9 @@
     /** The key for the connection parameter "Modify add delete order". */
     public static String CONNECTION_PARAMETER_MODIFY_ORDER = "ldapbrowser.modifyOrder";
 
+    /** The key for the connection parameter "Use ManageDsaIT Control" */
+    public static String CONNECTION_PARAMETER_MANAGE_DSA_IT = "ldapbrowser.manageDsaIT";
+
 
     /**
      * Gets the URL of this connection.
@@ -330,6 +333,22 @@
 
 
     /**
+     * Checks if ManageDsaIT control should be used.
+     * 
+     * @return true if ManageDsaIT control should be used
+     */
+    public abstract boolean isManageDsaIT();
+
+
+    /**
+     * Sets if ManageDsaIT control should be used.
+     * 
+     * @param manageDsaIT true to use ManageDsaIT control
+     */
+    public abstract void setManageDsaIT( boolean manageDsaIT );
+
+
+    /**
      * Checks if operational attributes should be fetched.
      * 
      * @return the true if operational attributes should be fetched

Added: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ICompareableEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ICompareableEntry.java?rev=827920&view=auto
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ICompareableEntry.java (added)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ICompareableEntry.java Wed Oct 21 08:35:55 2009
@@ -0,0 +1,32 @@
+/*
+ *  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.ldapbrowser.core.model;
+
+
+/**
+ * A tagging interface for comparable entries.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public interface ICompareableEntry extends IEntry
+{
+}

Added: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IContinuation.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IContinuation.java?rev=827920&view=auto
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IContinuation.java (added)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IContinuation.java Wed Oct 21 08:35:55 2009
@@ -0,0 +1,69 @@
+/*
+ *  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.ldapbrowser.core.model;
+
+
+import org.apache.directory.shared.ldap.util.LdapURL;
+
+
+/**
+ * A tagging interface for search continuations.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public interface IContinuation
+{
+
+    public enum State
+    {
+        /** The search continuation URL is unresolved.*/
+        UNRESOLVED,
+
+        /** The search continuation URL is unresolved. The user didn't select a suitable connection for the URL. */
+        CANCELED,
+
+        /** The search continuation URL is resolved. The user selected a suitable connection for the URL. */
+        RESOLVED
+    }
+
+
+    /**
+     * Gets the resolve state.
+     * 
+     * @return the resolve state
+     */
+    State getState();
+
+
+    /**
+     * Resolves the search continuation URL, asks the user which connection to use.
+     */
+    void resolve();
+
+
+    /**
+     * Gets the search continuation URL.
+     * 
+     * @return the search continuation URL
+     */
+    LdapURL getUrl();
+}

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java Wed Oct 21 08:35:55 2009
@@ -28,7 +28,9 @@
 import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionPropertyPageProvider;
+import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
+import org.apache.directory.studio.ldapbrowser.core.model.impl.SearchContinuation;
 import org.apache.directory.studio.ldapbrowser.core.propertypageproviders.SearchPropertyPageProvider;
 import org.eclipse.core.runtime.IAdaptable;
 
@@ -63,7 +65,7 @@
 
     /** Filter for fetching referrals (objectClass=referral) */
     public static final String FILTER_REFERRAL = "(objectClass=referral)"; //$NON-NLS-1$
-    
+
     /** Filter for fetching aliases and referrals (|(objectClass=alias)(objectClass=referral)) */
     public static final String FILTER_ALIAS_OR_REFERRAL = "(|(objectClass=alias)(objectClass=referral))"; //$NON-NLS-1$
 
@@ -435,4 +437,20 @@
      */
     public abstract void setTopPageSearchRunnable( StudioBulkRunnableWithProgress nextSearchRunnable );
 
+
+    /**
+     * Gets the search continuations.
+     * 
+     * @return the search continuations
+     */
+    public abstract SearchContinuation[] getSearchContinuations();
+
+
+    /**
+     * Sets the search continuations 
+     *
+     * @param the search continuations
+     */
+    public abstract void setSearchContinuations( SearchContinuation[] searchContinuations );
+
 }

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java Wed Oct 21 08:35:55 2009
@@ -27,6 +27,7 @@
 
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java Wed Oct 21 08:35:55 2009
@@ -47,6 +47,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.ICompareableEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
@@ -64,7 +65,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public abstract class AbstractEntry implements IEntry
+public abstract class AbstractEntry implements IEntry, ICompareableEntry
 {
 
     private static final long serialVersionUID = -2431637532526418774L;
@@ -876,11 +877,11 @@
     public boolean equals( Object o )
     {
         // check argument
-        if ( o == null || !( o instanceof IEntry ) )
+        if ( o == null || !( o instanceof ICompareableEntry ) )
         {
             return false;
         }
-        IEntry e = ( IEntry ) o;
+        ICompareableEntry e = ( ICompareableEntry ) o;
 
         // compare dn and connection
         return getDn() == null ? e.getDn() == null : ( getDn().equals( e.getDn() ) && getBrowserConnection().equals(

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Bookmark.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Bookmark.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Bookmark.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Bookmark.java Wed Oct 21 08:35:55 2009
@@ -73,7 +73,7 @@
     {
         this.connection = connection;
         this.bookmarkParameter = bookmarkParameter;
-        this.bookmarkEntry = new DelegateEntry( connection, bookmarkParameter.getDn() );
+        this.bookmarkEntry = new BookmarkEntry( connection, bookmarkParameter.getDn() );
     }
 
 
@@ -88,7 +88,7 @@
     {
         this.connection = connection;
         this.bookmarkParameter = new BookmarkParameter( dn, name );
-        this.bookmarkEntry = new DelegateEntry( connection, dn );
+        this.bookmarkEntry = new BookmarkEntry( connection, dn );
     }
 
 

Added: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BookmarkEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BookmarkEntry.java?rev=827920&view=auto
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BookmarkEntry.java (added)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BookmarkEntry.java Wed Oct 21 08:35:55 2009
@@ -0,0 +1,83 @@
+/*
+ *  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.ldapbrowser.core.model.impl;
+
+
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.ICompareableEntry;
+
+
+/**
+ * An {@link BookmarkEntry} represents the target of a {@link Bookmark}.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class BookmarkEntry extends DelegateEntry implements ICompareableEntry
+{
+
+    private static final long serialVersionUID = -6351277968774226912L;
+
+
+    protected BookmarkEntry()
+    {
+    }
+
+
+    /**
+     * Creates a new instance of BookmarkEntry.
+     * 
+     * @param connection the connection of the bookmark target
+     * @param dn the DN of the bookmark target
+     */
+    public BookmarkEntry( IBrowserConnection connection, LdapDN dn )
+    {
+        super( connection, dn );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public int hashCode()
+    {
+        return getDn().hashCode();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean equals( Object o )
+    {
+        // check argument
+        if ( o == null || !( o instanceof ICompareableEntry ) )
+        {
+            return false;
+        }
+        ICompareableEntry e = ( ICompareableEntry ) o;
+
+        // compare dn and connection
+        return getDn() == null ? e.getDn() == null : ( getDn().equals( e.getDn() ) && getBrowserConnection().equals(
+            e.getBrowserConnection() ) );
+    }
+}

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java Wed Oct 21 08:35:55 2009
@@ -100,7 +100,7 @@
             connection.getConnectionParameter().setExtendedIntProperty(
                 CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD, AliasDereferencingMethod.ALWAYS.getOrdinal() );
             connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD,
-                ReferralHandlingMethod.FOLLOW.getOrdinal() );
+                ReferralHandlingMethod.FOLLOW_MANUALLY.getOrdinal() );
             connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_FETCH_BASE_DNS, true );
             connection.getConnectionParameter().setExtendedProperty( CONNECTION_PARAMETER_BASE_DN, "" );
             connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_FETCH_SUBENTRIES, false );
@@ -316,6 +316,25 @@
     /**
      * {@inheritDoc}
      */
+    public boolean isManageDsaIT()
+    {
+        return connection.getConnectionParameter().getExtendedBoolProperty( CONNECTION_PARAMETER_MANAGE_DSA_IT );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setManageDsaIT( boolean manageDsaIT )
+    {
+        connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_MANAGE_DSA_IT, manageDsaIT );
+        ConnectionEventRegistry.fireConnectionUpdated( connection, this );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
     public boolean isFetchSubentries()
     {
         return connection.getConnectionParameter().getExtendedBoolProperty( CONNECTION_PARAMETER_FETCH_SUBENTRIES );

Copied: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ContinuedSearchResultEntry.java (from r824908, directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ReferralBaseEntry.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ContinuedSearchResultEntry.java?p2=directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ContinuedSearchResultEntry.java&p1=directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ReferralBaseEntry.java&r1=824908&r2=827920&rev=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ReferralBaseEntry.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ContinuedSearchResultEntry.java Wed Oct 21 08:35:55 2009
@@ -21,37 +21,176 @@
 package org.apache.directory.studio.ldapbrowser.core.model.impl;
 
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
+import org.apache.directory.studio.ldapbrowser.core.jobs.InitializeAttributesRunnable;
+import org.apache.directory.studio.ldapbrowser.core.jobs.StudioBrowserJob;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IContinuation;
+import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 
 
 /**
- * An {@link ReferralBaseEntry} represents the target 
- * (named by the ref attribute) of an referral entry.
+ * An {@link ContinuedSearchResultEntry} represents a result entry of a search continuation.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ReferralBaseEntry extends DelegateEntry
+public class ContinuedSearchResultEntry extends DelegateEntry implements IContinuation
 {
 
     private static final long serialVersionUID = -6351277968774226912L;
 
+    /** The search continuation URL. */
+    private LdapURL url;
+
+    /** The state. */
+    private State state;
+
+    /** The dummy connection. */
+    private DummyConnection dummyConnection;
+
 
-    protected ReferralBaseEntry()
+    protected ContinuedSearchResultEntry()
     {
     }
 
 
     /**
-     * Creates a new instance of ReferralBaseEntry.
+     * Creates a new instance of ContinuedSearchResultEntry.
      * 
-     * @param connection the connection of the referral target
-     * @param dn the DN of the referral target
+     * Sets the internal state of the target connection to "resolved".
+     * 
+     * @param connection the connection of the continued search
+     * @param dn the DN of the entry
      */
-    public ReferralBaseEntry( IBrowserConnection connection, LdapDN dn )
+    public ContinuedSearchResultEntry( IBrowserConnection connection, LdapDN dn )
     {
         super( connection, dn );
+        this.state = State.RESOLVED;
     }
 
+
+    /**
+     * Sets the internal state of the target connection to "unresolved".
+     * This means, when calling {@link #getAttributes()} or {@link #getChildren()}
+     * the user is asked for the target connection to use. 
+     * 
+     * @param url the new unresolved
+     */
+    public void setUnresolved( LdapURL url )
+    {
+        this.state = State.UNRESOLVED;
+        this.url = url;
+        super.connectionId = null;
+    }
+
+
+    @Override
+    public IBrowserConnection getBrowserConnection()
+    {
+        if ( state == State.RESOLVED )
+        {
+            return super.getBrowserConnection();
+        }
+        else
+        {
+            if ( dummyConnection == null )
+            {
+                dummyConnection = new DummyConnection( Schema.DEFAULT_SCHEMA );
+            }
+            return dummyConnection;
+        }
+    }
+
+
+    @Override
+    protected IEntry getDelegate()
+    {
+        if ( state == State.RESOLVED )
+        {
+            return super.getDelegate();
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public State getState()
+    {
+        return state;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public LdapURL getUrl()
+    {
+        return url != null ? url : super.getUrl();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void resolve()
+    {
+        // get referral connection, exit if canceled
+        List<LdapURL> urls = new ArrayList<LdapURL>();
+        urls.add( url );
+        Connection referralConnection = ConnectionCorePlugin.getDefault().getReferralHandler().getReferralConnection(
+            urls );
+        if ( referralConnection == null )
+        {
+            state = State.CANCELED;
+            entryDoesNotExist = true;
+        }
+        else
+        {
+            state = State.RESOLVED;
+            super.connectionId = referralConnection.getId();
+
+            InitializeAttributesRunnable iar = new InitializeAttributesRunnable( this );
+            new StudioBrowserJob( iar ).execute();
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public int hashCode()
+    {
+        return getDn().hashCode();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean equals( Object o )
+    {
+        // check argument
+        if ( o == null || !( o instanceof ContinuedSearchResultEntry ) )
+        {
+            return false;
+        }
+        ContinuedSearchResultEntry e = ( ContinuedSearchResultEntry ) o;
+
+        // compare dn and connection
+        return getDn() == null ? e.getDn() == null : ( getDn().equals( e.getDn() ) && getBrowserConnection().equals(
+            e.getBrowserConnection() ) );
+    }
 }

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java Wed Oct 21 08:35:55 2009
@@ -46,22 +46,22 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class DelegateEntry implements IEntry
+public abstract class DelegateEntry implements IEntry
 {
 
     private static final long serialVersionUID = -4488685394817691963L;
 
     /** The connection id. */
-    private String connectionId;
+    protected String connectionId;
 
     /** The DN. */
-    private LdapDN dn;
+    protected LdapDN dn;
 
     /** The entry does not exist flag. */
-    private boolean entryDoesNotExist;
+    protected boolean entryDoesNotExist;
 
     /** The delegate. */
-    private IEntry delegate;
+    protected IEntry delegate;
 
 
     protected DelegateEntry()
@@ -75,7 +75,7 @@
      * @param browserConnection the browser connection of the delegate
      * @param dn the DN of the delegate
      */
-    public DelegateEntry( IBrowserConnection browserConnection, LdapDN dn )
+    protected DelegateEntry( IBrowserConnection browserConnection, LdapDN dn )
     {
         this.connectionId = browserConnection.getConnection() != null ? browserConnection.getConnection().getId()
             : null;
@@ -207,10 +207,6 @@
         {
             return getDelegate().isInitOperationalAttributes();
         }
-        else if ( entryDoesNotExist )
-        {
-            return true;
-        }
         else
         {
             return false;
@@ -227,10 +223,6 @@
         {
             return getDelegate().isFetchAliases();
         }
-        else if ( entryDoesNotExist )
-        {
-            return true;
-        }
         else
         {
             return false;
@@ -247,10 +239,6 @@
         {
             return getDelegate().isFetchReferrals();
         }
-        else if ( entryDoesNotExist )
-        {
-            return true;
-        }
         else
         {
             return false;
@@ -267,10 +255,6 @@
         {
             return getDelegate().isFetchSubentries();
         }
-        else if ( entryDoesNotExist )
-        {
-            return true;
-        }
         else
         {
             return false;
@@ -389,7 +373,7 @@
         }
         else
         {
-            return null;
+            return new IAttribute[0];
         }
     }
 
@@ -438,7 +422,7 @@
         }
         else
         {
-            return null;
+            return new IEntry[0];
         }
     }
 
@@ -933,33 +917,6 @@
     /**
      * {@inheritDoc}
      */
-    public int hashCode()
-    {
-        return getDn().hashCode();
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public boolean equals( Object o )
-    {
-        // check argument
-        if ( o == null || !( o instanceof IEntry ) )
-        {
-            return false;
-        }
-        IEntry e = ( IEntry ) o;
-
-        // compare dn and connection
-        return getDn() == null ? e.getDn() == null : ( getDn().equals( e.getDn() ) && getBrowserConnection().equals(
-            e.getBrowserConnection() ) );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public Collection<ObjectClassDescription> getObjectClassDescriptions()
     {
         if ( getDelegate() != null )

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java Wed Oct 21 08:35:55 2009
@@ -237,6 +237,23 @@
     /** 
      * {@inheritDoc}
      */
+    public boolean isManageDsaIT()
+    {
+        return false;
+    }
+
+
+    /** 
+     * {@inheritDoc}
+     */
+    public void setManageDsaIT( boolean manageDsaIT )
+    {
+    }
+
+
+    /** 
+     * {@inheritDoc}
+     */
     public boolean isFetchSubentries()
     {
         return false;

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java Wed Oct 21 08:35:55 2009
@@ -40,6 +40,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.ICompareableEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
@@ -58,7 +59,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class DummyEntry implements IEntry
+public class DummyEntry implements IEntry, ICompareableEntry
 {
 
     private static final long serialVersionUID = 4833907766031149971L;
@@ -557,11 +558,11 @@
     public boolean equals( Object o )
     {
         // check argument
-        if ( o == null || !( o instanceof IEntry ) )
+        if ( o == null || !( o instanceof ICompareableEntry ) )
         {
             return false;
         }
-        IEntry e = ( IEntry ) o;
+        ICompareableEntry e = ( ICompareableEntry ) o;
 
         // compare dn and connection
         return getDn() == null ? e.getDn() == null : ( getDn().equals( e.getDn() ) && getBrowserConnection().equals(



Mime
View raw message