directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r967024 [1/2] - in /directory/studio/trunk: ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/ ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/ ldapbrowser.core/src/main/java/o...
Date Fri, 23 Jul 2010 10:24:39 GMT
Author: pamarcelot
Date: Fri Jul 23 10:24:38 2010
New Revision: 967024

URL: http://svn.apache.org/viewvc?rev=967024&view=rev
Log:
Fix for DIRSTUDIO-684 (Convert remaining Eclipse Jobs in LDAP Browser to Studio runnable API).

Added:
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesRunnable.java
      - copied, changed from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesRunnable.java
      - copied, changed from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvRunnable.java
      - copied, changed from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlRunnable.java
      - copied, changed from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java
      - copied, changed from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportOdfRunnable.java
      - copied, changed from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportOdfJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsRunnable.java
      - copied, changed from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java
      - copied, changed from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifRunnable.java
      - copied, changed from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesRunnable.java
      - copied, changed from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryRunnable.java
      - copied, changed from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java
Removed:
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractEclipseJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractNotificationJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportOdfJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java
Modified:
    directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/DeleteAction.java
    directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RenameAction.java
    directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/RenameValueEditor.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryRunnable.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExecuteLdifRunnable.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/FetchBaseDNsRunnable.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeRootDSERunnable.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryRunnable.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemaRunnable.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
    directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/UpdateEntryRunnable.java
    directory/studio/trunk/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/BrowserPasteAction.java
    directory/studio/trunk/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java
    directory/studio/trunk/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/DropListener.java
    directory/studio/trunk/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportCsvWizard.java
    directory/studio/trunk/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportDsmlWizard.java
    directory/studio/trunk/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportExcelWizard.java
    directory/studio/trunk/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportLdifWizard.java
    directory/studio/trunk/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportOdfWizard.java
    directory/studio/trunk/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ImportDsmlWizard.java
    directory/studio/trunk/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ImportLdifWizard.java

Modified: directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/DeleteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/DeleteAction.java?rev=967024&r1=967023&r2=967024&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/DeleteAction.java (original)
+++ directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/DeleteAction.java Fri Jul 23 10:24:38 2010
@@ -35,7 +35,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.ldapbrowser.common.dialogs.DeleteDialog;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
-import org.apache.directory.studio.ldapbrowser.core.jobs.DeleteEntriesJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.DeleteEntriesRunnable;
+import org.apache.directory.studio.ldapbrowser.core.jobs.StudioBrowserJob;
 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.IBookmark;
@@ -135,8 +136,8 @@ public class DeleteAction extends Browse
             {
                 appendEntriesWarnMessage( message, entries );
 
-                if ( entries.iterator().next().getBrowserConnection().getRootDSE().isControlSupported(
-                    StudioControl.TREEDELETE_CONTROL.getOid() ) )
+                if ( entries.iterator().next().getBrowserConnection().getRootDSE()
+                    .isControlSupported( StudioControl.TREEDELETE_CONTROL.getOid() ) )
                 {
                     askForTreeDeleteControl = true;
                 }
@@ -298,7 +299,7 @@ public class DeleteAction extends Browse
      */
     protected void deleteEntries( Collection<IEntry> entries, boolean useTreeDeleteControl )
     {
-        new DeleteEntriesJob( entries, useTreeDeleteControl ).execute();
+        new StudioBrowserJob( new DeleteEntriesRunnable( entries, useTreeDeleteControl ) ).execute();
     }
 
 

Modified: directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RenameAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RenameAction.java?rev=967024&r1=967023&r2=967024&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RenameAction.java (original)
+++ directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RenameAction.java Fri Jul 23 10:24:38 2010
@@ -24,7 +24,8 @@ package org.apache.directory.studio.ldap
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.studio.ldapbrowser.common.dialogs.RenameEntryDialog;
 import org.apache.directory.studio.ldapbrowser.common.dialogs.SimulateRenameDialogImpl;
-import org.apache.directory.studio.ldapbrowser.core.jobs.RenameEntryJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.RenameEntryRunnable;
+import org.apache.directory.studio.ldapbrowser.core.jobs.StudioBrowserJob;
 import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IQuickSearch;
@@ -196,7 +197,8 @@ public class RenameAction extends Browse
             Rdn newRdn = renameDialog.getRdn();
             if ( newRdn != null && !newRdn.equals( entry.getRdn() ) )
             {
-                new RenameEntryJob( entry, newRdn, new SimulateRenameDialogImpl( getShell() ) ).execute();
+                new StudioBrowserJob(
+                    new RenameEntryRunnable( entry, newRdn, new SimulateRenameDialogImpl( getShell() ) ) ).execute();
             }
         }
     }

Modified: directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/RenameValueEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/RenameValueEditor.java?rev=967024&r1=967023&r2=967024&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/RenameValueEditor.java (original)
+++ directory/studio/trunk/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/RenameValueEditor.java Fri Jul 23 10:24:38 2010
@@ -29,7 +29,8 @@ import java.util.List;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.studio.ldapbrowser.common.dialogs.RenameEntryDialog;
 import org.apache.directory.studio.ldapbrowser.common.dialogs.SimulateRenameDialogImpl;
-import org.apache.directory.studio.ldapbrowser.core.jobs.RenameEntryJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.RenameEntryRunnable;
+import org.apache.directory.studio.ldapbrowser.core.jobs.StudioBrowserJob;
 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.IEntry;
@@ -144,8 +145,8 @@ public class RenameValueEditor extends C
                     if ( newRdn != null && !newRdn.equals( entry.getRdn() ) )
                     {
                         IEntry originalEntry = entry.getBrowserConnection().getEntryFromCache( entry.getDn() );
-                        new RenameEntryJob( originalEntry, newRdn, new SimulateRenameDialogImpl( parent.getShell() ) )
-                            .execute();
+                        new StudioBrowserJob( new RenameEntryRunnable( originalEntry, newRdn,
+                            new SimulateRenameDialogImpl( parent.getShell() ) ) ).execute();
                     }
                 }
             }

Copied: directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesRunnable.java (from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesRunnable.java?p2=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesRunnable.java&p1=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java&r1=966736&r2=967024&rev=967024&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java (original)
+++ directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesRunnable.java Fri Jul 23 10:24:38 2010
@@ -48,6 +48,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.jobs.StudioConnectionBulkRunnableWithProgress;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.BulkModificationEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -60,16 +61,15 @@ import org.apache.directory.studio.ldapb
 
 
 /**
- * Job to copy entries asynchronously.
+ * Runnable to copy entries asynchronously.
  * 
  * TODO: implement overwrite strategy
  * TODO: implement remember selection
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CopyEntriesJob extends AbstractNotificationJob
+public class CopyEntriesRunnable implements StudioConnectionBulkRunnableWithProgress
 {
-
     /** The parent entry. */
     private IEntry parent;
 
@@ -84,29 +84,27 @@ public class CopyEntriesJob extends Abst
 
 
     /**
-     * Creates a new instance of CopyEntriesJob.
+     * Creates a new instance of CopyEntriesRunnable.
      * 
      * @param parent the parent entry
      * @param entriesToCopy the entries to copy
      * @param scope the copy scope
      * @param dialog the dialog
      */
-    public CopyEntriesJob( final IEntry parent, final IEntry[] entriesToCopy, SearchScope scope,
+    public CopyEntriesRunnable( final IEntry parent, final IEntry[] entriesToCopy, SearchScope scope,
         EntryExistsCopyStrategyDialog dialog )
     {
         this.parent = parent;
         this.entriesToCopy = entriesToCopy;
         this.scope = scope;
         this.dialog = dialog;
-        setName( entriesToCopy.length == 1 ? BrowserCoreMessages.jobs__copy_entries_name_1
-            : BrowserCoreMessages.jobs__copy_entries_name_n );
     }
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getConnections()
+     * {@inheritDoc}
      */
-    protected Connection[] getConnections()
+    public Connection[] getConnections()
     {
         return new Connection[]
             { parent.getBrowserConnection().getConnection() };
@@ -114,9 +112,19 @@ public class CopyEntriesJob extends Abst
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getLockedObjects()
+     * {@inheritDoc}
+     */
+    public String getName()
+    {
+        return entriesToCopy.length == 1 ? BrowserCoreMessages.jobs__copy_entries_name_1
+            : BrowserCoreMessages.jobs__copy_entries_name_n;
+    }
+
+
+    /**
+     * {@inheritDoc}
      */
-    protected Object[] getLockedObjects()
+    public Object[] getLockedObjects()
     {
         List<IEntry> l = new ArrayList<IEntry>();
         l.add( parent );
@@ -126,15 +134,27 @@ public class CopyEntriesJob extends Abst
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractNotificationJob#executeNotificationJob(org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor)
+     * {@inheritDoc}
      */
-    protected void executeNotificationJob( StudioProgressMonitor monitor )
+    public String getErrorMessage()
     {
-        monitor.beginTask( entriesToCopy.length == 1 ? BrowserCoreMessages.bind(
-            BrowserCoreMessages.jobs__copy_entries_task_1, new String[]
-                { entriesToCopy[0].getDn().getUpName(), parent.getDn().getUpName() } ) : BrowserCoreMessages.bind(
-            BrowserCoreMessages.jobs__copy_entries_task_n, new String[]
-                { Integer.toString( entriesToCopy.length ), parent.getDn().getUpName() } ), 2 + entriesToCopy.length );
+        return entriesToCopy.length == 1 ? BrowserCoreMessages.jobs__copy_entries_error_1
+            : BrowserCoreMessages.jobs__copy_entries_error_n;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run( StudioProgressMonitor monitor )
+    {
+        monitor.beginTask(
+            entriesToCopy.length == 1 ? BrowserCoreMessages.bind( BrowserCoreMessages.jobs__copy_entries_task_1,
+                new String[]
+                    { entriesToCopy[0].getDn().getUpName(), parent.getDn().getUpName() } ) : BrowserCoreMessages.bind(
+                BrowserCoreMessages.jobs__copy_entries_task_n, new String[]
+                    { Integer.toString( entriesToCopy.length ), parent.getDn().getUpName() } ),
+            2 + entriesToCopy.length );
 
         monitor.reportProgress( " " ); //$NON-NLS-1$
         monitor.worked( 1 );
@@ -169,9 +189,9 @@ public class CopyEntriesJob extends Abst
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractNotificationJob#runNotification()
+     * {@inheritDoc}
      */
-    protected void runNotification()
+    public void runNotification( StudioProgressMonitor monitor )
     {
         // don't fire an EntryCreatedEvent for each created entry
         // that would cause massive UI updates
@@ -181,16 +201,6 @@ public class CopyEntriesJob extends Abst
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getErrorMessage()
-     */
-    protected String getErrorMessage()
-    {
-        return entriesToCopy.length == 1 ? BrowserCoreMessages.jobs__copy_entries_error_1
-            : BrowserCoreMessages.jobs__copy_entries_error_n;
-    }
-
-
-    /**
      * Copy entry. If scope is SearchControls.SUBTREE_SCOPE the entry is copied
      * recursively.
      * 
@@ -225,8 +235,11 @@ public class CopyEntriesJob extends Abst
                 { new ManageReferralControl( false ) };
         }
 
-        NamingEnumeration<SearchResult> result = entryToCopy.getBrowserConnection().getConnection()
-            .getJNDIConnectionWrapper().search( entryToCopy.getDn().getUpName(), ISearch.FILTER_TRUE, searchControls,
+        NamingEnumeration<SearchResult> result = entryToCopy
+            .getBrowserConnection()
+            .getConnection()
+            .getJNDIConnectionWrapper()
+            .search( entryToCopy.getDn().getUpName(), ISearch.FILTER_TRUE, searchControls,
                 AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, controls, monitor, null );
 
         // In case the parent is the RootDSE: use the parent DN of the old entry
@@ -235,8 +248,9 @@ public class CopyEntriesJob extends Abst
         {
             parentDn = DnUtils.getParent( entryToCopy.getDn() );
         }
-        numberOfCopiedEntries = copyEntryRecursive( entryToCopy.getBrowserConnection(), result, parent
-            .getBrowserConnection(), parentDn, newRdn, scope, numberOfCopiedEntries, dialog, dummyMonitor, monitor );
+        numberOfCopiedEntries = copyEntryRecursive( entryToCopy.getBrowserConnection(), result,
+            parent.getBrowserConnection(), parentDn, newRdn, scope, numberOfCopiedEntries, dialog, dummyMonitor,
+            monitor );
 
         return numberOfCopiedEntries;
     }
@@ -299,8 +313,8 @@ public class CopyEntriesJob extends Abst
                 }
 
                 // create entry
-                targetBrowserConnection.getConnection().getJNDIConnectionWrapper().createEntry( newLdapDn.getUpName(),
-                    newAttributes, controls, dummyMonitor, null );
+                targetBrowserConnection.getConnection().getJNDIConnectionWrapper()
+                    .createEntry( newLdapDn.getUpName(), newAttributes, controls, dummyMonitor, null );
 
                 while ( dummyMonitor.errorsReported() )
                 {
@@ -337,9 +351,11 @@ public class CopyEntriesJob extends Abst
                                     }
 
                                     // modify entry
-                                    targetBrowserConnection.getConnection().getJNDIConnectionWrapper().modifyEntry(
-                                        newLdapDn.getUpName(), mis.toArray( new ModificationItem[mis.size()] ), null,
-                                        dummyMonitor, null );
+                                    targetBrowserConnection
+                                        .getConnection()
+                                        .getJNDIConnectionWrapper()
+                                        .modifyEntry( newLdapDn.getUpName(),
+                                            mis.toArray( new ModificationItem[mis.size()] ), null, dummyMonitor, null );
 
                                     // force reloading of attributes
                                     IEntry newEntry = targetBrowserConnection.getEntryFromCache( newLdapDn );
@@ -360,8 +376,8 @@ public class CopyEntriesJob extends Abst
                                     newLdapDn = DnUtils.composeDn( renamedRdn, parentDn );
 
                                     // create entry
-                                    targetBrowserConnection.getConnection().getJNDIConnectionWrapper().createEntry(
-                                        newLdapDn.getUpName(), newAttributes, null, dummyMonitor, null );
+                                    targetBrowserConnection.getConnection().getJNDIConnectionWrapper()
+                                        .createEntry( newLdapDn.getUpName(), newAttributes, null, dummyMonitor, null );
 
                                     break;
                             }
@@ -395,10 +411,11 @@ public class CopyEntriesJob extends Abst
                         searchControls.setReturningAttributes( new String[]
                             { SchemaConstants.ALL_USER_ATTRIBUTES, SchemaConstants.REF_AT } );
                         searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-                        NamingEnumeration<SearchResult> childEntries = sourceBrowserConnection.getConnection()
-                            .getJNDIConnectionWrapper().search( oldLdapDn.getUpName(), ISearch.FILTER_TRUE,
-                                searchControls, AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, null,
-                                monitor, null );
+                        NamingEnumeration<SearchResult> childEntries = sourceBrowserConnection
+                            .getConnection()
+                            .getJNDIConnectionWrapper()
+                            .search( oldLdapDn.getUpName(), ISearch.FILTER_TRUE, searchControls,
+                                AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, null, monitor, null );
 
                         if ( scope == SearchControls.ONELEVEL_SCOPE )
                         {

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=967024&r1=967023&r2=967024&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 Fri Jul 23 10:24:38 2010
@@ -49,7 +49,6 @@ import org.apache.directory.studio.ldapb
  */
 public class CreateEntryRunnable implements StudioConnectionBulkRunnableWithProgress
 {
-
     /** The entry to create. */
     private IEntry entryToCreate;
 
@@ -106,6 +105,15 @@ public class CreateEntryRunnable impleme
     /**
      * {@inheritDoc}
      */
+    public String getErrorMessage()
+    {
+        return BrowserCoreMessages.jobs__create_entry_error_1;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
     public void run( StudioProgressMonitor monitor )
     {
         monitor.beginTask( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__create_entry_task_1, new String[]
@@ -172,15 +180,6 @@ public class CreateEntryRunnable impleme
 
 
     /**
-     * {@inheritDoc}
-     */
-    public String getErrorMessage()
-    {
-        return BrowserCoreMessages.jobs__create_entry_error_1;
-    }
-
-
-    /**
      * Creates the entry using the underlying JNDI connection wrapper.
      * 
      * @param browserConnection the browser connection
@@ -222,8 +221,7 @@ public class CreateEntryRunnable impleme
                 { new ManageReferralControl( false ) };
         }
 
-        browserConnection.getConnection().getJNDIConnectionWrapper().createEntry( dn, jndiAttributes, controls,
-            monitor, null );
+        browserConnection.getConnection().getJNDIConnectionWrapper()
+            .createEntry( dn, jndiAttributes, controls, monitor, null );
     }
-
 }

Copied: directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesRunnable.java (from r966736, 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/DeleteEntriesRunnable.java?p2=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesRunnable.java&p1=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java&r1=966736&r2=967024&rev=967024&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/DeleteEntriesRunnable.java Fri Jul 23 10:24:38 2010
@@ -42,6 +42,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.jobs.StudioConnectionBulkRunnableWithProgress;
 import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.BulkModificationEvent;
@@ -55,7 +56,7 @@ import org.apache.directory.studio.ldapb
 
 
 /**
- * Job to delete entries.
+ * Runnable to delete entries.
  * 
  * Deletes the entry recursively in a optimistic way:
  * <ol>
@@ -68,9 +69,8 @@ import org.apache.directory.studio.ldapb
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DeleteEntriesJob extends AbstractNotificationJob
+public class DeleteEntriesRunnable implements StudioConnectionBulkRunnableWithProgress
 {
-
     /** The entries to delete. */
     private Collection<IEntry> entriesToDelete;
 
@@ -85,24 +85,24 @@ public class DeleteEntriesJob extends Ab
 
 
     /**
-     * Creates a new instance of DeleteEntriesJob. 
+     * Creates a new instance of DeleteEntriesRunnable. 
      * 
      * @param entriesToDelete the entries to delete
      */
-    public DeleteEntriesJob( final Collection<IEntry> entriesToDelete, boolean useTreeDeleteControl )
+    public DeleteEntriesRunnable( final Collection<IEntry> entriesToDelete, boolean useTreeDeleteControl )
     {
         this.entriesToDelete = entriesToDelete;
         this.useTreeDeleteControl = useTreeDeleteControl;
 
         this.deletedEntriesSet = new HashSet<IEntry>();
         this.searchesToUpdateSet = new HashSet<ISearch>();
-
-        setName( entriesToDelete.size() == 1 ? BrowserCoreMessages.jobs__delete_entries_name_1
-            : BrowserCoreMessages.jobs__delete_entries_name_n );
     }
 
 
-    protected Connection[] getConnections()
+    /**
+     * {@inheritDoc}
+     */
+    public Connection[] getConnections()
     {
         Connection[] connections = new Connection[entriesToDelete.size()];
         int i = 0;
@@ -115,7 +115,20 @@ public class DeleteEntriesJob extends Ab
     }
 
 
-    protected Object[] getLockedObjects()
+    /**
+     * {@inheritDoc}
+     */
+    public String getName()
+    {
+        return entriesToDelete.size() == 1 ? BrowserCoreMessages.jobs__delete_entries_name_1
+            : BrowserCoreMessages.jobs__delete_entries_name_n;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Object[] getLockedObjects()
     {
         List<IEntry> l = new ArrayList<IEntry>();
         l.addAll( entriesToDelete );
@@ -123,13 +136,27 @@ public class DeleteEntriesJob extends Ab
     }
 
 
-    protected void executeNotificationJob( StudioProgressMonitor monitor )
+    /**
+     * {@inheritDoc}
+     */
+    public String getErrorMessage()
     {
-        monitor.beginTask( entriesToDelete.size() == 1 ? BrowserCoreMessages.bind(
-            BrowserCoreMessages.jobs__delete_entries_task_1, new String[]
-                { entriesToDelete.iterator().next().getDn().getUpName() } ) : BrowserCoreMessages.bind(
-            BrowserCoreMessages.jobs__delete_entries_task_n, new String[]
-                { Integer.toString( entriesToDelete.size() ) } ), 2 + entriesToDelete.size() );
+        return entriesToDelete.size() == 1 ? BrowserCoreMessages.jobs__delete_entries_error_1
+            : BrowserCoreMessages.jobs__delete_entries_error_n;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run( StudioProgressMonitor monitor )
+    {
+        monitor.beginTask(
+            entriesToDelete.size() == 1 ? BrowserCoreMessages.bind( BrowserCoreMessages.jobs__delete_entries_task_1,
+                new String[]
+                    { entriesToDelete.iterator().next().getDn().getUpName() } ) : BrowserCoreMessages.bind(
+                BrowserCoreMessages.jobs__delete_entries_task_n, new String[]
+                    { Integer.toString( entriesToDelete.size() ) } ), 2 + entriesToDelete.size() );
         monitor.reportProgress( " " ); //$NON-NLS-1$
         monitor.worked( 1 );
 
@@ -200,6 +227,25 @@ public class DeleteEntriesJob extends Ab
 
 
     /**
+     * {@inheritDoc}
+     */
+    public void runNotification( StudioProgressMonitor monitor )
+    {
+        // don't fire an EntryDeletedEvent for each deleted entry
+        // that would cause massive UI updates
+        // instead we unset children information and fire a BulkModificationEvent
+        IBrowserConnection browserConnection = entriesToDelete.iterator().next().getBrowserConnection();
+        EventRegistry.fireEntryUpdated( new BulkModificationEvent( browserConnection ), this );
+
+        for ( ISearch search : searchesToUpdateSet )
+        {
+            EventRegistry.fireSearchUpdated( new SearchUpdateEvent( search,
+                SearchUpdateEvent.EventDetail.SEARCH_PERFORMED ), this );
+        }
+    }
+
+
+    /**
      * Deletes the entry recursively in a optimistic way:
      * <ol>
      * <li>Deletes the entry
@@ -249,7 +295,9 @@ public class DeleteEntriesJob extends Ab
                 searchControls.setCountLimit( 1000 );
                 searchControls.setReturningAttributes( new String[0] );
                 searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-                NamingEnumeration<SearchResult> result = browserConnection.getConnection().getJNDIConnectionWrapper()
+                NamingEnumeration<SearchResult> result = browserConnection
+                    .getConnection()
+                    .getJNDIConnectionWrapper()
                     .search( dn.getUpName(), ISearch.FILTER_TRUE, searchControls, aliasDereferencingMethod,
                         referralsHandlingMethod, null, dummyMonitor, null );
 
@@ -309,29 +357,6 @@ public class DeleteEntriesJob extends Ab
     }
 
 
-    protected void runNotification()
-    {
-        // don't fire an EntryDeletedEvent for each deleted entry
-        // that would cause massive UI updates
-        // instead we unset children information and fire a BulkModificationEvent
-        IBrowserConnection browserConnection = entriesToDelete.iterator().next().getBrowserConnection();
-        EventRegistry.fireEntryUpdated( new BulkModificationEvent( browserConnection ), this );
-
-        for ( ISearch search : searchesToUpdateSet )
-        {
-            EventRegistry.fireSearchUpdated( new SearchUpdateEvent( search,
-                SearchUpdateEvent.EventDetail.SEARCH_PERFORMED ), this );
-        }
-    }
-
-
-    protected String getErrorMessage()
-    {
-        return entriesToDelete.size() == 1 ? BrowserCoreMessages.jobs__delete_entries_error_1
-            : BrowserCoreMessages.jobs__delete_entries_error_n;
-    }
-
-
     static void deleteEntry( IBrowserConnection browserConnection, LdapDN dn, boolean useManageDsaItControl,
         boolean useTreeDeleteControl, StudioProgressMonitor monitor )
     {
@@ -354,9 +379,8 @@ public class DeleteEntriesJob extends Ab
         // delete entry
         if ( browserConnection.getConnection() != null )
         {
-            browserConnection.getConnection().getJNDIConnectionWrapper().deleteEntry( dn.getUpName(), 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/ExecuteLdifRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExecuteLdifRunnable.java?rev=967024&r1=967023&r2=967024&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExecuteLdifRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExecuteLdifRunnable.java Fri Jul 23 10:24:38 2010
@@ -46,7 +46,6 @@ import org.apache.directory.studio.ldifp
  */
 public class ExecuteLdifRunnable implements StudioConnectionBulkRunnableWithProgress
 {
-
     /** The browser connection. */
     private IBrowserConnection browserConnection;
 
@@ -110,6 +109,15 @@ public class ExecuteLdifRunnable impleme
     /**
      * {@inheritDoc}
      */
+    public String getErrorMessage()
+    {
+        return BrowserCoreMessages.jobs__execute_ldif_error;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
     public void run( StudioProgressMonitor monitor )
     {
         monitor.beginTask( BrowserCoreMessages.jobs__execute_ldif_task, 2 );
@@ -139,8 +147,8 @@ public class ExecuteLdifRunnable impleme
                 }
             };
 
-            ImportLdifJob.importLdif( browserConnection, enumeration, logWriter, updateIfEntryExists, continueOnError,
-                monitor );
+            ImportLdifRunnable.importLdif( browserConnection, enumeration, logWriter, updateIfEntryExists,
+                continueOnError, monitor );
 
             logWriter.close();
             ldifReader.close();
@@ -155,15 +163,6 @@ public class ExecuteLdifRunnable impleme
     /**
      * {@inheritDoc}
      */
-    public String getErrorMessage()
-    {
-        return BrowserCoreMessages.jobs__execute_ldif_error;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public void runNotification( StudioProgressMonitor monitor )
     {
         EventRegistry.fireEntryUpdated( new BulkModificationEvent( browserConnection ), this );

Copied: directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvRunnable.java (from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvJob.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvRunnable.java?p2=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvRunnable.java&p1=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvJob.java&r1=966736&r2=967024&rev=967024&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvJob.java (original)
+++ directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvRunnable.java Fri Jul 23 10:24:38 2010
@@ -34,10 +34,11 @@ import javax.naming.NamingException;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.jobs.StudioConnectionRunnableWithProgress;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ExportLdifJob.JndiLdifEnumeration;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ExportLdifRunnable.JndiLdifEnumeration;
 import org.apache.directory.studio.ldapbrowser.core.model.AttributeDescription;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
@@ -50,13 +51,12 @@ import org.eclipse.core.runtime.Preferen
 
 
 /**
- * Job to export directory content to an CSV file.
+ * Runnable to export directory content to an CSV file.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExportCsvJob extends AbstractEclipseJob
+public class ExportCsvRunnable implements StudioConnectionRunnableWithProgress
 {
-
     /** The filename of the CSV file. */
     private String exportCsvFilename;
 
@@ -71,29 +71,27 @@ public class ExportCsvJob extends Abstra
 
 
     /**
-     * Creates a new instance of ExportCsvJob.
+     * Creates a new instance of ExportCsvRunnable.
      * 
      * @param exportCsvFilename the filename of the csv file
      * @param browserConnection the browser connection
      * @param searchParameter the search parameter
      * @param exportDn true to export the DN
      */
-    public ExportCsvJob( String exportCsvFilename, IBrowserConnection browserConnection,
+    public ExportCsvRunnable( String exportCsvFilename, IBrowserConnection browserConnection,
         SearchParameter searchParameter, boolean exportDn )
     {
         this.exportCsvFilename = exportCsvFilename;
         this.browserConnection = browserConnection;
         this.searchParameter = searchParameter;
         this.exportDn = exportDn;
-
-        setName( BrowserCoreMessages.jobs__export_csv_name );
     }
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getConnections()
+     * {@inheritDoc}
      */
-    protected Connection[] getConnections()
+    public Connection[] getConnections()
     {
         return new Connection[]
             { browserConnection.getConnection() };
@@ -101,9 +99,18 @@ public class ExportCsvJob extends Abstra
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getLockedObjects()
+     * {@inheritDoc}
+     */
+    public String getName()
+    {
+        return BrowserCoreMessages.jobs__export_csv_name;
+    }
+
+
+    /**
+     * {@inheritDoc}
      */
-    protected Object[] getLockedObjects()
+    public Object[] getLockedObjects()
     {
         return new Object[]
             { browserConnection.getUrl() + "_" + DigestUtils.shaHex( exportCsvFilename ) };
@@ -111,9 +118,18 @@ public class ExportCsvJob extends Abstra
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#executeAsyncJob(org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor)
+     * {@inheritDoc}
      */
-    protected void executeAsyncJob( StudioProgressMonitor monitor )
+    public String getErrorMessage()
+    {
+        return BrowserCoreMessages.jobs__export_cvs_error;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run( StudioProgressMonitor monitor )
     {
         monitor.beginTask( BrowserCoreMessages.jobs__export_csv_task, 2 );
         monitor.reportProgress( " " ); //$NON-NLS-1$
@@ -195,7 +211,7 @@ public class ExportCsvJob extends Abstra
     {
         try
         {
-            JndiLdifEnumeration enumeration = ExportLdifJob.search( browserConnection, searchParameter, monitor );
+            JndiLdifEnumeration enumeration = ExportLdifRunnable.search( browserConnection, searchParameter, monitor );
             while ( !monitor.isCanceled() && !monitor.errorsReported() && enumeration.hasNext() )
             {
                 LdifContainer container = enumeration.next();
@@ -364,14 +380,4 @@ public class ExportCsvJob extends Abstra
         }
         return attributeMap;
     }
-
-
-    /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getErrorMessage()
-     */
-    protected String getErrorMessage()
-    {
-        return BrowserCoreMessages.jobs__export_cvs_error;
-    }
-
 }

Copied: directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlRunnable.java (from r966736, 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/ExportDsmlRunnable.java?p2=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlRunnable.java&p1=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java&r1=966736&r2=967024&rev=967024&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/ExportDsmlRunnable.java Fri Jul 23 10:24:38 2010
@@ -58,17 +58,18 @@ import org.apache.directory.shared.ldap.
 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.jobs.StudioConnectionRunnableWithProgress;
 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;
 
 
 /**
- * This class implements a Job for Exporting a part of a LDAP Server into a DSML File.
+ * Runnable for Exporting a part of a LDAP Server into a DSML File.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExportDsmlJob extends AbstractEclipseJob
+public class ExportDsmlRunnable implements StudioConnectionRunnableWithProgress
 {
     private static final String OBJECTCLASS_OBJECTCLASS_OID = "objectClass";
     private static final String OBJECTCLASS_OBJECTCLASS_NAME = "2.5.4.0";
@@ -103,7 +104,7 @@ public class ExportDsmlJob extends Abstr
 
 
     /**
-     * Creates a new instance of ExportDsmlJob.
+     * Creates a new instance of ExportDsmlRunnable.
      *
      * @param exportDsmlFilename
      *          the name of the DSML file to export to
@@ -112,8 +113,8 @@ public class ExportDsmlJob extends Abstr
      * @param searchParameter
      *          the Search Parameter of the export
      */
-    public ExportDsmlJob( String exportDsmlFilename, IBrowserConnection connection, SearchParameter searchParameter,
-        ExportDsmlJobType type )
+    public ExportDsmlRunnable( String exportDsmlFilename, IBrowserConnection connection,
+        SearchParameter searchParameter, ExportDsmlJobType type )
     {
         this.exportDsmlFilename = exportDsmlFilename;
         this.browserConnection = connection;
@@ -127,25 +128,32 @@ public class ExportDsmlJob extends Abstr
         returningAttributes.add( REF_ATTRIBUTETYPE_NAME );
         returningAttributes.add( REF_ATTRIBUTETYPE_OID );
         searchParameter.setReturningAttributes( returningAttributes.toArray( new String[0] ) );
-
-        setName( BrowserCoreMessages.jobs__export_dsml_name );
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getConnections()
+    /**
+     * {@inheritDoc}
      */
-    protected Connection[] getConnections()
+    public Connection[] getConnections()
     {
         return new Connection[]
             { browserConnection.getConnection() };
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getLockedObjects()
+    /**
+     * {@inheritDoc}
+     */
+    public String getName()
+    {
+        return BrowserCoreMessages.jobs__export_dsml_name;
+    }
+
+
+    /**
+     * {@inheritDoc}
      */
-    protected Object[] getLockedObjects()
+    public Object[] getLockedObjects()
     {
         List<String> l = new ArrayList<String>();
         l.add( browserConnection.getUrl() + "_" + DigestUtils.shaHex( exportDsmlFilename ) );
@@ -153,10 +161,19 @@ public class ExportDsmlJob extends Abstr
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#executeAsyncJob(org.apache.directory.studio.ldapbrowser.core.jobs.ExtendedProgressMonitor)
+    /**
+     * {@inheritDoc}
      */
-    protected void executeAsyncJob( StudioProgressMonitor monitor )
+    public String getErrorMessage()
+    {
+        return BrowserCoreMessages.jobs__export_dsml_error;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run( StudioProgressMonitor monitor )
     {
         monitor.beginTask( BrowserCoreMessages.jobs__export_dsml_task, 4 );
         monitor.reportProgress( " " ); //$NON-NLS-1$
@@ -302,8 +319,8 @@ public class ExportDsmlJob extends Abstr
     private static DsmlDecorator convertSearchResultToDsml( SearchResult searchResult, SearchParameter searchParameter )
         throws InvalidAttributeIdentifierException, InvalidNameException, LdapURLEncodingException
     {
-        Entry entry = AttributeUtils.toClientEntry( searchResult.getAttributes(), new LdapDN( searchResult
-            .getNameInNamespace() ) );
+        Entry entry = AttributeUtils.toClientEntry( searchResult.getAttributes(),
+            new LdapDN( searchResult.getNameInNamespace() ) );
 
         if ( isReferral( entry ) )
         {
@@ -311,11 +328,11 @@ public class ExportDsmlJob extends Abstr
             SearchResultReferenceDsml srr = new SearchResultReferenceDsml();
 
             // Getting the 'ref' attribute
-            EntryAttribute refAttribute = entry.get( ExportDsmlJob.REF_ATTRIBUTETYPE_NAME );
+            EntryAttribute refAttribute = entry.get( ExportDsmlRunnable.REF_ATTRIBUTETYPE_NAME );
             if ( refAttribute == null )
             {
                 // If we did not get it by its name, let's get it by its OID
-                refAttribute = entry.get( ExportDsmlJob.REF_ATTRIBUTETYPE_OID );
+                refAttribute = entry.get( ExportDsmlRunnable.REF_ATTRIBUTETYPE_OID );
             }
 
             // Adding references
@@ -355,18 +372,18 @@ public class ExportDsmlJob extends Abstr
         if ( entry != null )
         {
             // Getting the 'objectClass' Attribute
-            EntryAttribute objectClassAttribute = entry.get( ExportDsmlJob.OBJECTCLASS_OBJECTCLASS_NAME );
+            EntryAttribute objectClassAttribute = entry.get( ExportDsmlRunnable.OBJECTCLASS_OBJECTCLASS_NAME );
             if ( objectClassAttribute == null )
             {
-                objectClassAttribute = entry.get( ExportDsmlJob.OBJECTCLASS_OBJECTCLASS_OID );
+                objectClassAttribute = entry.get( ExportDsmlRunnable.OBJECTCLASS_OBJECTCLASS_OID );
             }
 
             if ( objectClassAttribute != null )
             {
                 // Checking if the 'objectClass' attribute contains the 
                 // 'referral' object class as value
-                return ( ( objectClassAttribute.contains( ExportDsmlJob.REFERRAL_OBJECTCLASS_NAME ) ) || ( objectClassAttribute
-                    .contains( ExportDsmlJob.REFERRAL_OBJECTCLASS_OID ) ) );
+                return ( ( objectClassAttribute.contains( ExportDsmlRunnable.REFERRAL_OBJECTCLASS_NAME ) ) || ( objectClassAttribute
+                    .contains( ExportDsmlRunnable.REFERRAL_OBJECTCLASS_OID ) ) );
             }
         }
 
@@ -421,19 +438,10 @@ public class ExportDsmlJob extends Abstr
         throws InvalidAttributeIdentifierException, InvalidNameException
     {
         AddRequestDsml ar = new AddRequestDsml();
-        Entry entry = AttributeUtils.toClientEntry( searchResult.getAttributes(), new LdapDN( searchResult
-            .getNameInNamespace() ) );
+        Entry entry = AttributeUtils.toClientEntry( searchResult.getAttributes(),
+            new LdapDN( searchResult.getNameInNamespace() ) );
         ar.setEntry( entry );
 
         return ar;
     }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getErrorMessage()
-     */
-    protected String getErrorMessage()
-    {
-        return BrowserCoreMessages.jobs__export_dsml_error;
-    }
 }

Copied: directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java (from r966736, 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/ExportLdifRunnable.java?p2=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifRunnable.java&p1=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java&r1=966736&r2=967024&rev=967024&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/ExportLdifRunnable.java Fri Jul 23 10:24:38 2010
@@ -42,6 +42,7 @@ import org.apache.directory.studio.conne
 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.StudioConnectionRunnableWithProgress;
 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;
@@ -61,13 +62,12 @@ import org.apache.directory.studio.ldifp
 
 
 /**
- * Job to export directory content to an LDIF file.
+ * Runnable to export directory content to an LDIF file.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExportLdifJob extends AbstractEclipseJob
+public class ExportLdifRunnable implements StudioConnectionRunnableWithProgress
 {
-
     /** The filename of the LDIF file. */
     private String exportLdifFilename;
 
@@ -79,27 +79,25 @@ public class ExportLdifJob extends Abstr
 
 
     /**
-     * Creates a new instance of ExportLdifJob.
+     * Creates a new instance of ExportLdifRunnable.
      * 
      * @param exportLdifFilename the filename of the LDIF file
      * @param browserConnection the browser connection
      * @param searchParameter the search parameter
      */
-    public ExportLdifJob( String exportLdifFilename, IBrowserConnection browserConnection,
+    public ExportLdifRunnable( String exportLdifFilename, IBrowserConnection browserConnection,
         SearchParameter searchParameter )
     {
         this.exportLdifFilename = exportLdifFilename;
         this.browserConnection = browserConnection;
         this.searchParameter = searchParameter;
-
-        setName( BrowserCoreMessages.jobs__export_ldif_name );
     }
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getConnections()
+     * {@inheritDoc}
      */
-    protected Connection[] getConnections()
+    public Connection[] getConnections()
     {
         return new Connection[]
             { browserConnection.getConnection() };
@@ -107,9 +105,18 @@ public class ExportLdifJob extends Abstr
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getLockedObjects()
+     * {@inheritDoc}
      */
-    protected Object[] getLockedObjects()
+    public String getName()
+    {
+        return BrowserCoreMessages.jobs__export_ldif_name;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Object[] getLockedObjects()
     {
         List<Object> l = new ArrayList<Object>();
         l.add( browserConnection.getUrl() + "_" + DigestUtils.shaHex( exportLdifFilename ) );
@@ -118,9 +125,18 @@ public class ExportLdifJob extends Abstr
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#executeAsyncJob(org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor)
+     * {@inheritDoc}
      */
-    protected void executeAsyncJob( StudioProgressMonitor monitor )
+    public String getErrorMessage()
+    {
+        return BrowserCoreMessages.jobs__export_ldif_error;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run( StudioProgressMonitor monitor )
     {
         monitor.beginTask( BrowserCoreMessages.jobs__export_ldif_task, 2 );
         monitor.reportProgress( " " ); //$NON-NLS-1$
@@ -213,12 +229,6 @@ public class ExportLdifJob extends Abstr
     }
 
 
-    protected String getErrorMessage()
-    {
-        return BrowserCoreMessages.jobs__export_ldif_error;
-    }
-
-
     static JndiLdifEnumeration search( IBrowserConnection browserConnection, SearchParameter parameter,
         StudioProgressMonitor monitor )
     {
@@ -321,5 +331,4 @@ public class ExportLdifJob extends Abstr
         }
 
     }
-
 }

Copied: directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportOdfRunnable.java (from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportOdfJob.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportOdfRunnable.java?p2=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportOdfRunnable.java&p1=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportOdfJob.java&r1=966736&r2=967024&rev=967024&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportOdfJob.java (original)
+++ directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportOdfRunnable.java Fri Jul 23 10:24:38 2010
@@ -30,10 +30,11 @@ import javax.naming.NamingException;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.jobs.StudioConnectionRunnableWithProgress;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ExportLdifJob.JndiLdifEnumeration;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ExportLdifRunnable.JndiLdifEnumeration;
 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.utils.JNDIUtils;
@@ -51,13 +52,12 @@ import org.w3c.dom.Element;
 
 
 /**
- * Job to export directory content to an ODF file.
+ * Runnable to export directory content to an ODF file.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExportOdfJob extends AbstractEclipseJob
+public class ExportOdfRunnable implements StudioConnectionRunnableWithProgress
 {
-
     /** The maximum count limit */
     public static final int MAX_COUNT_LIMIT = 65000;
 
@@ -75,29 +75,27 @@ public class ExportOdfJob extends Abstra
 
 
     /**
-     * Creates a new instance of ExportOdfJob.
+     * Creates a new instance of ExportOdfRunnable.
      * 
      * @param exportOdfFilename the ODF filename
      * @param browserConnection the browser connection
      * @param searchParameter the search parameter
      * @param exportDn true to export the DN
      */
-    public ExportOdfJob( String exportOdfFilename, IBrowserConnection browserConnection,
+    public ExportOdfRunnable( String exportOdfFilename, IBrowserConnection browserConnection,
         SearchParameter searchParameter, boolean exportDn )
     {
         this.exportOdfFilename = exportOdfFilename;
         this.browserConnection = browserConnection;
         this.searchParameter = searchParameter;
         this.exportDn = exportDn;
-
-        setName( BrowserCoreMessages.jobs__export_odf_name );
     }
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getConnections()
+     * {@inheritDoc}
      */
-    protected Connection[] getConnections()
+    public Connection[] getConnections()
     {
         return new Connection[]
             { browserConnection.getConnection() };
@@ -105,9 +103,18 @@ public class ExportOdfJob extends Abstra
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getLockedObjects()
+     * {@inheritDoc}
+     */
+    public String getName()
+    {
+        return BrowserCoreMessages.jobs__export_odf_name;
+    }
+
+
+    /**
+     * {@inheritDoc}
      */
-    protected Object[] getLockedObjects()
+    public Object[] getLockedObjects()
     {
         return new Object[]
             { browserConnection.getUrl() + "_" + DigestUtils.shaHex( exportOdfFilename ) };
@@ -115,9 +122,18 @@ public class ExportOdfJob extends Abstra
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#executeAsyncJob(org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor)
+     * {@inheritDoc}
      */
-    protected void executeAsyncJob( StudioProgressMonitor monitor )
+    public String getErrorMessage()
+    {
+        return BrowserCoreMessages.jobs__export_odf_error;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run( StudioProgressMonitor monitor )
     {
         monitor.beginTask( BrowserCoreMessages.jobs__export_odf_task, 2 );
         monitor.reportProgress( " " ); //$NON-NLS-1$
@@ -153,7 +169,7 @@ public class ExportOdfJob extends Abstra
             LinkedHashMap<String, Short> attributeNameMap = new LinkedHashMap<String, Short>();
             if ( this.exportDn )
             {
-                short cellNum = ( short ) 0;
+                //                short cellNum = ( short ) 0;
                 //attributeNameMap.put( "dn", new Short( cellNum ) ); //$NON-NLS-1$
                 OdfTableCell cell = new OdfTableCell( contentDoc );
                 cell.setValueType( OdfValueType.STRING );
@@ -204,7 +220,7 @@ public class ExportOdfJob extends Abstra
     {
         try
         {
-            JndiLdifEnumeration enumeration = ExportLdifJob.search( browserConnection, searchParameter, monitor );
+            JndiLdifEnumeration enumeration = ExportLdifRunnable.search( browserConnection, searchParameter, monitor );
             while ( !monitor.isCanceled() && !monitor.errorsReported() && enumeration.hasNext() )
             {
                 LdifContainer container = enumeration.next();
@@ -256,7 +272,7 @@ public class ExportOdfJob extends Abstra
         String valueDelimiter, int binaryEncoding, boolean exportDn )
     {
         // group multi-valued attributes
-        Map<String, String> attributeMap = ExportCsvJob.getAttributeMap( null, record, valueDelimiter, "UTF-16",
+        Map<String, String> attributeMap = ExportCsvRunnable.getAttributeMap( null, record, valueDelimiter, "UTF-16",
             binaryEncoding );
 
         // output attributes
@@ -298,14 +314,4 @@ public class ExportOdfJob extends Abstra
             row.appendCell( cell );
         }
     }
-
-
-    /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getErrorMessage()
-     */
-    protected String getErrorMessage()
-    {
-        return BrowserCoreMessages.jobs__export_odf_error;
-    }
-
 }

Copied: directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsRunnable.java (from r966736, directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsRunnable.java?p2=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsRunnable.java&p1=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java&r1=966736&r2=967024&rev=967024&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java (original)
+++ directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsRunnable.java Fri Jul 23 10:24:38 2010
@@ -31,10 +31,11 @@ import javax.naming.NamingException;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.jobs.StudioConnectionRunnableWithProgress;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ExportLdifJob.JndiLdifEnumeration;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ExportLdifRunnable.JndiLdifEnumeration;
 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.utils.JNDIUtils;
@@ -48,13 +49,12 @@ import org.eclipse.core.runtime.Preferen
 
 
 /**
- * Job to export directory content to an XLS file.
+ * Runnable to export directory content to an XLS file.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExportXlsJob extends AbstractEclipseJob
+public class ExportXlsRunnable implements StudioConnectionRunnableWithProgress
 {
-
     /** The maximum count limit */
     public static final int MAX_COUNT_LIMIT = 65000;
 
@@ -72,29 +72,27 @@ public class ExportXlsJob extends Abstra
 
 
     /**
-     * Creates a new instance of ExportXlsJob.
+     * Creates a new instance of ExportXlsRunnable.
      * 
      * @param exportLdifFilename the export ldif filename
      * @param browserConnection the browser connection
      * @param searchParameter the search parameter
      * @param exportDn true to export the DN
      */
-    public ExportXlsJob( String exportLdifFilename, IBrowserConnection browserConnection,
+    public ExportXlsRunnable( String exportLdifFilename, IBrowserConnection browserConnection,
         SearchParameter searchParameter, boolean exportDn )
     {
         this.exportXlsFilename = exportLdifFilename;
         this.browserConnection = browserConnection;
         this.searchParameter = searchParameter;
         this.exportDn = exportDn;
-
-        setName( BrowserCoreMessages.jobs__export_xls_name );
     }
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getConnections()
+     * {@inheritDoc}
      */
-    protected Connection[] getConnections()
+    public Connection[] getConnections()
     {
         return new Connection[]
             { browserConnection.getConnection() };
@@ -102,9 +100,18 @@ public class ExportXlsJob extends Abstra
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getLockedObjects()
+     * {@inheritDoc}
+     */
+    public String getName()
+    {
+        return BrowserCoreMessages.jobs__export_xls_name;
+    }
+
+
+    /**
+     * {@inheritDoc}
      */
-    protected Object[] getLockedObjects()
+    public Object[] getLockedObjects()
     {
         return new Object[]
             { browserConnection.getUrl() + "_" + DigestUtils.shaHex( exportXlsFilename ) };
@@ -112,9 +119,18 @@ public class ExportXlsJob extends Abstra
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#executeAsyncJob(org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor)
+     * {@inheritDoc}
      */
-    protected void executeAsyncJob( StudioProgressMonitor monitor )
+    public String getErrorMessage()
+    {
+        return BrowserCoreMessages.jobs__export_xls_error;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run( StudioProgressMonitor monitor )
     {
         monitor.beginTask( BrowserCoreMessages.jobs__export_xls_task, 2 );
         monitor.reportProgress( " " ); //$NON-NLS-1$
@@ -220,7 +236,7 @@ public class ExportXlsJob extends Abstra
     {
         try
         {
-            JndiLdifEnumeration enumeration = ExportLdifJob.search( browserConnection, searchParameter, monitor );
+            JndiLdifEnumeration enumeration = ExportLdifRunnable.search( browserConnection, searchParameter, monitor );
             while ( !monitor.isCanceled() && !monitor.errorsReported() && enumeration.hasNext() )
             {
                 LdifContainer container = enumeration.next();
@@ -271,7 +287,7 @@ public class ExportXlsJob extends Abstra
         int binaryEncoding, boolean exportDn )
     {
         // group multi-valued attributes
-        Map<String, String> attributeMap = ExportCsvJob.getAttributeMap( null, record, valueDelimiter, "UTF-16",
+        Map<String, String> attributeMap = ExportCsvRunnable.getAttributeMap( null, record, valueDelimiter, "UTF-16",
             binaryEncoding );
 
         // output attributes
@@ -315,14 +331,4 @@ public class ExportXlsJob extends Abstra
         // }
 
     }
-
-
-    /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getErrorMessage()
-     */
-    protected String getErrorMessage()
-    {
-        return BrowserCoreMessages.jobs__export_xls_error;
-    }
-
 }

Modified: directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/FetchBaseDNsRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/FetchBaseDNsRunnable.java?rev=967024&r1=967023&r2=967024&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/FetchBaseDNsRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/FetchBaseDNsRunnable.java Fri Jul 23 10:24:38 2010
@@ -40,9 +40,10 @@ import org.apache.directory.studio.ldapb
  */
 public class FetchBaseDNsRunnable implements StudioConnectionBulkRunnableWithProgress
 {
-
+    /** The connection */
     private IBrowserConnection connection;
 
+    /** The base DNs*/
     private List<String> baseDNs;
 
 
@@ -89,6 +90,15 @@ public class FetchBaseDNsRunnable implem
     /**
      * {@inheritDoc}
      */
+    public String getErrorMessage()
+    {
+        return BrowserCoreMessages.jobs__fetch_basedns_error;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
     public void run( StudioProgressMonitor monitor )
     {
         monitor.beginTask( BrowserCoreMessages.jobs__fetch_basedns_task, 5 );
@@ -116,9 +126,8 @@ public class FetchBaseDNsRunnable implem
     /**
      * {@inheritDoc}
      */
-    public String getErrorMessage()
+    public void runNotification( StudioProgressMonitor monitor )
     {
-        return BrowserCoreMessages.jobs__fetch_basedns_error;
     }
 
 
@@ -131,13 +140,4 @@ public class FetchBaseDNsRunnable implem
     {
         return baseDNs;
     }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void runNotification( StudioProgressMonitor monitor )
-    {
-    }
-
 }

Copied: directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java (from r966736, 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/ImportDsmlRunnable.java?p2=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java&p1=directory/studio/trunk/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlJob.java&r1=966736&r2=967024&rev=967024&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/ImportDsmlRunnable.java Fri Jul 23 10:24:38 2010
@@ -73,6 +73,7 @@ import org.apache.directory.studio.conne
 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.jobs.StudioConnectionBulkRunnableWithProgress;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.BulkModificationEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -84,11 +85,11 @@ import com.sun.jndi.ldap.BasicControl;
 
 
 /**
- * This class implements a Job for Importing a DSML File into a LDAP server
+ * Runnable to import a DSML File into a LDAP server
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ImportDsmlJob extends AbstractNotificationJob
+public class ImportDsmlRunnable implements StudioConnectionBulkRunnableWithProgress
 {
     /** The connection to use */
     private IBrowserConnection browserConnection;
@@ -101,7 +102,7 @@ public class ImportDsmlJob extends Abstr
 
 
     /**
-     * Creates a new instance of ImportDsmlJob.
+     * Creates a new instance of ImportDsmlRunnable.
      *
      * @param connection
      *          The connection to use
@@ -112,18 +113,16 @@ public class ImportDsmlJob extends Abstr
      * @param continueOnError
      *          The ContinueOnError flag
      */
-    public ImportDsmlJob( IBrowserConnection connection, File dsmlFile, File saveFile )
+    public ImportDsmlRunnable( IBrowserConnection connection, File dsmlFile, File saveFile )
     {
         this.browserConnection = connection;
         this.dsmlFile = dsmlFile;
         this.responseFile = saveFile;
-
-        setName( BrowserCoreMessages.jobs__import_dsml_name );
     }
 
 
     /**
-     * Creates a new instance of ImportDsmlJob.
+     * Creates a new instance of ImportDsmlRunnable.
      *
      * @param connection
      *          The Connection to use
@@ -132,7 +131,7 @@ public class ImportDsmlJob extends Abstr
      * @param continueOnError
      *          The ContinueOnError flag
      */
-    public ImportDsmlJob( IBrowserConnection connection, File dsmlFile )
+    public ImportDsmlRunnable( IBrowserConnection connection, File dsmlFile )
     {
         this( connection, dsmlFile, null );
     }
@@ -141,7 +140,7 @@ public class ImportDsmlJob extends Abstr
     /**
      * {@inheritDoc}
      */
-    protected Connection[] getConnections()
+    public Connection[] getConnections()
     {
         return new Connection[]
             { browserConnection.getConnection() };
@@ -151,7 +150,16 @@ public class ImportDsmlJob extends Abstr
     /**
      * {@inheritDoc}
      */
-    protected Object[] getLockedObjects()
+    public String getName()
+    {
+        return BrowserCoreMessages.jobs__import_dsml_name;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Object[] getLockedObjects()
     {
         List<Object> l = new ArrayList<Object>();
         l.add( browserConnection.getUrl() + "_" + DigestUtils.shaHex( dsmlFile.toString() ) );
@@ -162,7 +170,16 @@ public class ImportDsmlJob extends Abstr
     /**
      * {@inheritDoc}
      */
-    protected void executeNotificationJob( StudioProgressMonitor monitor )
+    public String getErrorMessage()
+    {
+        return BrowserCoreMessages.jobs__import_dsml_error;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run( StudioProgressMonitor monitor )
     {
         monitor.beginTask( BrowserCoreMessages.jobs__import_dsml_task, 2 );
         monitor.reportProgress( " " ); //$NON-NLS-1$
@@ -236,6 +253,15 @@ public class ImportDsmlJob extends Abstr
 
 
     /**
+     * {@inheritDoc}
+     */
+    public void runNotification( StudioProgressMonitor monitor )
+    {
+        EventRegistry.fireEntryUpdated( new BulkModificationEvent( browserConnection ), this );
+    }
+
+
+    /**
      * Processes the request.
      *
      * @param request
@@ -323,8 +349,11 @@ public class ImportDsmlJob extends Abstr
     {
         // Executing the add request
         Entry entry = request.getEntry();
-        browserConnection.getConnection().getJNDIConnectionWrapper().createEntry( entry.getDn().getUpName(),
-            AttributeUtils.toAttributes( entry ), getControls( request ), monitor, null );
+        browserConnection
+            .getConnection()
+            .getJNDIConnectionWrapper()
+            .createEntry( entry.getDn().getUpName(), AttributeUtils.toAttributes( entry ), getControls( request ),
+                monitor, null );
 
         // Creating the response
         if ( batchResponseDsml != null )
@@ -390,8 +419,8 @@ public class ImportDsmlJob extends Abstr
         StudioProgressMonitor monitor )
     {
         // Executing the del request
-        browserConnection.getConnection().getJNDIConnectionWrapper().deleteEntry( request.getEntry().getUpName(),
-            getControls( request ), monitor, null );
+        browserConnection.getConnection().getJNDIConnectionWrapper()
+            .deleteEntry( request.getEntry().getUpName(), getControls( request ), monitor, null );
 
         // Creating the response
         if ( batchResponseDsml != null )
@@ -466,8 +495,11 @@ public class ImportDsmlJob extends Abstr
         }
 
         // Executing the modify request
-        browserConnection.getConnection().getJNDIConnectionWrapper().modifyEntry( request.getObject().getUpName(),
-            modificationItems.toArray( new ModificationItem[0] ), getControls( request ), monitor, null );
+        browserConnection
+            .getConnection()
+            .getJNDIConnectionWrapper()
+            .modifyEntry( request.getObject().getUpName(), modificationItems.toArray( new ModificationItem[0] ),
+                getControls( request ), monitor, null );
 
         // Creating the response
         if ( batchResponseDsml != null )
@@ -523,8 +555,11 @@ public class ImportDsmlJob extends Abstr
         StudioProgressMonitor monitor )
     {
         // Executing the modify DN request
-        browserConnection.getConnection().getJNDIConnectionWrapper().renameEntry( request.getEntry().getUpName(),
-            request.getNewRDN().getUpName(), request.isDeleteOldRDN(), getControls( request ), monitor, null );
+        browserConnection
+            .getConnection()
+            .getJNDIConnectionWrapper()
+            .renameEntry( request.getEntry().getUpName(), request.getNewRDN().getUpName(), request.isDeleteOldRDN(),
+                getControls( request ), monitor, null );
 
         // Creating the response
         if ( batchResponseDsml != null )
@@ -578,14 +613,16 @@ public class ImportDsmlJob extends Abstr
         if ( batchResponseDsml != null )
         {
             // [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, getControls( request ), monitor,
-                null );
+            StudioNamingEnumeration ne = browserConnection
+                .getConnection()
+                .getJNDIConnectionWrapper()
+                .search( request.getBaseObject().getUpName(), request.getFilter().toString(),
+                    getSearchControls( request ), getAliasDereferencingMethod( request ),
+                    ReferralHandlingMethod.IGNORE, getControls( request ), monitor, null );
 
             SearchParameter sp = new SearchParameter();
             sp.setReferralsHandlingMethod( browserConnection.getReferralsHandlingMethod() );
-            ExportDsmlJob.processAsDsmlResponse( ne, batchResponseDsml, monitor, sp );
+            ExportDsmlRunnable.processAsDsmlResponse( ne, batchResponseDsml, monitor, sp );
         }
     }
 
@@ -679,8 +716,8 @@ public class ImportDsmlJob extends Abstr
             List<Control> jndiControls = new ArrayList<Control>();
             for ( ControlCodec control : controls )
             {
-                Control jndiControl = new BasicControl( control.getControlType(), control.getCriticality(), control
-                    .getEncodedValue() );
+                Control jndiControl = new BasicControl( control.getControlType(), control.getCriticality(),
+                    control.getEncodedValue() );
                 jndiControls.add( jndiControl );
             }
             return jndiControls.toArray( new Control[jndiControls.size()] );
@@ -722,23 +759,4 @@ public class ImportDsmlJob extends Abstr
 
         return ldapResult;
     }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    protected String getErrorMessage()
-    {
-        return BrowserCoreMessages.jobs__import_dsml_error;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    protected void runNotification()
-    {
-        EventRegistry.fireEntryUpdated( new BulkModificationEvent( browserConnection ), this );
-    }
-
 }



Mime
View raw message