directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r569899 [5/9] - in /directory/studio/trunk: studio-aciitemeditor/META-INF/ studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/ studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueedito...
Date Sun, 26 Aug 2007 22:36:14 GMT
Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ConnectionModifyHandler.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ConnectionModifyHandler.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ConnectionModifyHandler.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ConnectionModifyHandler.java Sun Aug 26 15:36:01 2007
@@ -29,13 +29,13 @@
 import java.util.Date;
 import java.util.LinkedList;
 
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 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.ExtendedProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IReferralHandler;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
@@ -64,39 +64,30 @@
 class ConnectionModifyHandler
 {
 
-    private Connection connection;
+    private BrowserConnection connection;
 
     private ModificationLogger modificationLogger;
 
-    private int suspendDepth;
-
     private LinkedList recordQueue;
 
 
-    ConnectionModifyHandler( Connection connection )
+    ConnectionModifyHandler( BrowserConnection connection )
     {
         this.connection = connection;
 
         this.modificationLogger = new ModificationLogger( connection );
+
+        this.recordQueue = new LinkedList();
     }
 
 
     void connectionClosed()
     {
-        this.suspendDepth = 0;
         this.recordQueue.clear();
-        this.recordQueue = null;
-    }
-
-
-    void connectionOpened()
-    {
-        this.suspendDepth = 0;
-        this.recordQueue = new LinkedList();
     }
 
 
-    void create( IValue[] valuesToCreate, ExtendedProgressMonitor monitor )
+    void create( IValue[] valuesToCreate, StudioProgressMonitor monitor )
     {
         for ( int i = 0; !monitor.isCanceled() && i < valuesToCreate.length; i++ )
         {
@@ -133,7 +124,7 @@
     }
 
 
-    void modify( IValue oldValue, IValue newValue, ExtendedProgressMonitor monitor )
+    void modify( IValue oldValue, IValue newValue, StudioProgressMonitor monitor )
     {
         try
         {
@@ -201,7 +192,7 @@
     }
 
 
-    void delete( IValue[] valuesToDelete, ExtendedProgressMonitor monitor )
+    void delete( IValue[] valuesToDelete, StudioProgressMonitor monitor )
     {
         try
         {
@@ -237,7 +228,7 @@
     }
 
 
-    void delete( IAttribute[] attriubtesToDelete, ExtendedProgressMonitor monitor )
+    void delete( IAttribute[] attriubtesToDelete, StudioProgressMonitor monitor )
     {
         try
         {
@@ -263,7 +254,7 @@
     }
 
 
-    void create( IEntry entryToCreate, ExtendedProgressMonitor monitor )
+    void create( IEntry entryToCreate, StudioProgressMonitor monitor )
     {
         try
         {
@@ -280,7 +271,7 @@
     }
 
 
-    void rename( IEntry entryToRename, DN newDn, boolean deleteOldRdn, ExtendedProgressMonitor monitor )
+    void rename( IEntry entryToRename, DN newDn, boolean deleteOldRdn, StudioProgressMonitor monitor )
     {
         try
         {
@@ -305,7 +296,7 @@
     }
 
 
-    void move( IEntry entryToMove, DN newSuperior, ExtendedProgressMonitor monitor )
+    void move( IEntry entryToMove, DN newSuperior, StudioProgressMonitor monitor )
     {
         try
         {
@@ -344,7 +335,7 @@
     }
 
 
-    void delete( IEntry entry, ExtendedProgressMonitor monitor )
+    void delete( IEntry entry, StudioProgressMonitor monitor )
     {
         try
         {
@@ -366,7 +357,7 @@
 
 
     void importLdif( LdifEnumeration enumeration, Writer logWriter, boolean continueOnError,
-        ExtendedProgressMonitor monitor )
+        StudioProgressMonitor monitor )
     {
         int importedCount = 0;
         int errorCount = 0;
@@ -481,42 +472,15 @@
     }
 
 
-    boolean isSuspended()
-    {
-        return this.suspendDepth > 0;
-    }
-
-
-    void suspend()
-    {
-        this.suspendDepth++;
-    }
-
-
-    void resume( ExtendedProgressMonitor monitor )
-    {
-        try
-        {
-            this.suspendDepth--;
-            this.commit( monitor );
-        }
-        catch ( Exception e )
-        {
-            monitor.reportError( e );
-        }
-    }
-
-
-    void reset()
+    private void reset()
     {
         this.recordQueue.clear();
-        this.suspendDepth = 0;
     }
 
 
-    private void commit( ExtendedProgressMonitor monitor ) throws ConnectionException
+    private void commit( StudioProgressMonitor monitor ) throws ConnectionException
     {
-        if ( this.suspendDepth == 0 && !recordQueue.isEmpty() )
+        if ( !recordQueue.isEmpty() )
         {
 
             final LdifRecord[] records = ( LdifRecord[] ) this.recordQueue.toArray( new LdifRecord[this.recordQueue
@@ -543,7 +507,7 @@
                     if ( ce instanceof ReferralException )
                     {
 
-                        if ( connection.getReferralsHandlingMethod() == IConnection.HANDLE_REFERRALS_FOLLOW )
+                        if ( connection.getReferralsHandlingMethod() == IBrowserConnection.HANDLE_REFERRALS_FOLLOW )
                         {
 
                             // get referral handler
@@ -563,7 +527,7 @@
                                 URL referralUrl = new URL( referral );
 
                                 // get referral connection
-                                IConnection referralConnection = referralHandler.getReferralConnection( referralUrl );
+                                IBrowserConnection referralConnection = referralHandler.getReferralConnection( referralUrl );
                                 if ( referralConnection == null )
                                 {
                                     // throw new
@@ -571,13 +535,7 @@
                                     continue;
                                 }
 
-                                // open connection
-                                if ( !referralConnection.isOpened() )
-                                {
-                                    referralConnection.open( monitor );
-                                }
-
-                                ( ( Connection ) referralConnection ).modifyHandler.applyModificationAndLog(
+                                ( ( BrowserConnection ) referralConnection ).modifyHandler.applyModificationAndLog(
                                     records[i], monitor );
 
                             }
@@ -605,7 +563,7 @@
     }
 
 
-    private void logModificationError( Writer logWriter, LdifRecord record, Exception e, ExtendedProgressMonitor monitor )
+    private void logModificationError( Writer logWriter, LdifRecord record, Exception e, StudioProgressMonitor monitor )
     {
         try
         {
@@ -630,7 +588,7 @@
     }
 
 
-    private void logModification( Writer logWriter, LdifRecord record, ExtendedProgressMonitor monitor )
+    private void logModification( Writer logWriter, LdifRecord record, StudioProgressMonitor monitor )
     {
         try
         {
@@ -648,7 +606,7 @@
     }
 
 
-    private void applyModificationAndLog( LdifRecord record, ExtendedProgressMonitor monitor )
+    private void applyModificationAndLog( LdifRecord record, StudioProgressMonitor monitor )
         throws ConnectionException
     {
         this.recordQueue.add( record );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ConnectionSearchHandler.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ConnectionSearchHandler.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ConnectionSearchHandler.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ConnectionSearchHandler.java Sun Aug 26 15:36:01 2007
@@ -29,13 +29,13 @@
 import java.util.List;
 import java.util.Set;
 
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ExtendedProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy;
 import org.apache.directory.studio.ldapbrowser.core.model.Control;
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 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;
@@ -53,10 +53,10 @@
 public class ConnectionSearchHandler
 {
 
-    private Connection connection;
+    private BrowserConnection connection;
 
 
-    ConnectionSearchHandler( Connection connection )
+    ConnectionSearchHandler( BrowserConnection connection )
     {
         this.connection = connection;
     }
@@ -72,7 +72,7 @@
     }
 
 
-    boolean existsEntry( DN dn, ExtendedProgressMonitor monitor )
+    boolean existsEntry( DN dn, StudioProgressMonitor monitor )
     {
         SearchParameter sp = new SearchParameter();
         sp.setSearchBase( dn );
@@ -93,7 +93,7 @@
     }
 
 
-    IEntry getEntry( DN dn, ExtendedProgressMonitor monitor )
+    IEntry getEntry( DN dn, StudioProgressMonitor monitor )
     {
         try
         {
@@ -106,7 +106,7 @@
 
             // search in directory
             ISearch search = new Search( null, connection, dn, null, ISearch.NO_ATTRIBUTES, ISearch.SCOPE_OBJECT, 1, 0,
-                IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, true, true, null );
+                IBrowserConnection.DEREFERENCE_ALIASES_NEVER, IBrowserConnection.HANDLE_REFERRALS_IGNORE, true, true, null );
             this.search( search, monitor );
             ISearchResult[] srs = search.getSearchResults();
             if ( srs.length > 0 )
@@ -127,7 +127,7 @@
     }
 
 
-    void search( ISearch search, ExtendedProgressMonitor monitor )
+    void search( ISearch search, StudioProgressMonitor monitor )
     {
 
         try
@@ -191,7 +191,7 @@
                     else if ( ce instanceof ReferralException )
                     {
 
-                        if ( search.getReferralsHandlingMethod() == IConnection.HANDLE_REFERRALS_FOLLOW )
+                        if ( search.getReferralsHandlingMethod() == IBrowserConnection.HANDLE_REFERRALS_FOLLOW )
                         {
 
                             ReferralException re = ( ReferralException ) ce;
@@ -200,13 +200,7 @@
                             {
                                 ISearch referralSearch = referralSearches[i];
 
-                                // open connection
-                                if ( !referralSearch.getConnection().isOpened() )
-                                {
-                                    referralSearch.getConnection().open( monitor );
-                                }
-
-                                referralSearch.getConnection().search( referralSearch, monitor );
+                                referralSearch.getBrowserConnection().search( referralSearch, monitor );
 
                                 ISearchResult[] referralSearchResults = referralSearch.getSearchResults();
                                 for ( int j = 0; referralSearchResults != null && j < referralSearchResults.length; j++ )
@@ -356,7 +350,7 @@
         // add children detetion attributes
         if ( search.isInitHasChildrenFlag() )
         {
-            if ( search.getConnection().getSchema().hasAttributeTypeDescription(
+            if ( search.getBrowserConnection().getSchema().hasAttributeTypeDescription(
                 IAttribute.OPERATIONAL_ATTRIBUTE_HAS_SUBORDINATES )
                 && !Utils.containsIgnoreCase( Arrays.asList( searchParameter.getReturningAttributes() ),
                     IAttribute.OPERATIONAL_ATTRIBUTE_HAS_SUBORDINATES ) )
@@ -367,7 +361,7 @@
                 returningAttributes[returningAttributes.length - 1] = IAttribute.OPERATIONAL_ATTRIBUTE_HAS_SUBORDINATES;
                 searchParameter.setReturningAttributes( returningAttributes );
             }
-            else if ( search.getConnection().getSchema().hasAttributeTypeDescription(
+            else if ( search.getBrowserConnection().getSchema().hasAttributeTypeDescription(
                 IAttribute.OPERATIONAL_ATTRIBUTE_NUM_SUBORDINATES )
                 && !Utils.containsIgnoreCase( Arrays.asList( searchParameter.getReturningAttributes() ),
                     IAttribute.OPERATIONAL_ATTRIBUTE_NUM_SUBORDINATES ) )
@@ -378,7 +372,7 @@
                 returningAttributes[returningAttributes.length - 1] = IAttribute.OPERATIONAL_ATTRIBUTE_NUM_SUBORDINATES;
                 searchParameter.setReturningAttributes( returningAttributes );
             }
-            else if ( search.getConnection().getSchema().hasAttributeTypeDescription(
+            else if ( search.getBrowserConnection().getSchema().hasAttributeTypeDescription(
                 IAttribute.OPERATIONAL_ATTRIBUTE_SUBORDINATE_COUNT )
                 && !Utils.containsIgnoreCase( Arrays.asList( searchParameter.getReturningAttributes() ),
                     IAttribute.OPERATIONAL_ATTRIBUTE_SUBORDINATE_COUNT ) )

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DelegateEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DelegateEntry.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DelegateEntry.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DelegateEntry.java Sun Aug 26 15:36:01 2007
@@ -39,7 +39,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy;
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.RDN;
@@ -68,7 +68,7 @@
     }
 
 
-    public DelegateEntry( IConnection connection, DN dn )
+    public DelegateEntry( IBrowserConnection connection, DN dn )
     {
         this.connectionName = connection.getName();
         this.dn = dn;
@@ -80,7 +80,7 @@
 
     protected IEntry getDelegate()
     {
-        if ( this.delegate != null && !this.delegate.getConnection().isOpened() )
+        if ( this.delegate != null && !this.delegate.getBrowserConnection().getConnection().getJNDIConnectionWrapper().isConnected() )
         {
             this.entryDoesNotExist = false;
             this.delegate = null;
@@ -95,10 +95,10 @@
     }
 
 
-    public IConnection getConnection()
+    public IBrowserConnection getBrowserConnection()
     {
         if ( this.getDelegate() != null )
-            return getDelegate().getConnection();
+            return getDelegate().getBrowserConnection();
         else
             return BrowserCorePlugin.getDefault().getConnectionManager().getConnection( this.connectionName );
         // return connection;
@@ -119,7 +119,7 @@
         if ( this.getDelegate() != null )
             return getDelegate().getUrl();
         else
-            return new URL( getConnection(), getDn() );
+            return new URL( getBrowserConnection(), getDn() );
     }
 
 
@@ -315,7 +315,7 @@
         /* if(b) */{
             if ( this.getDelegate() == null )
             {
-                setDelegate( this.getConnection().getEntryFromCache( this.dn ) );
+                setDelegate( this.getBrowserConnection().getEntryFromCache( this.dn ) );
                 if ( this.getDelegate() == null )
                 {
                     // entry doesn't exist!
@@ -374,7 +374,7 @@
         /* if(b) */{
             if ( this.getDelegate() == null )
             {
-                setDelegate( this.getConnection().getEntryFromCache( this.dn ) );
+                setDelegate( this.getBrowserConnection().getEntryFromCache( this.dn ) );
                 if ( this.getDelegate() == null )
                 {
                     // entry doesn't exist!
@@ -528,9 +528,9 @@
         {
             return new LdapSearchPageScoreComputer();
         }
-        if ( adapter == IConnection.class )
+        if ( adapter == IBrowserConnection.class )
         {
-            return this.getConnection();
+            return this.getBrowserConnection();
         }
         if ( adapter == IEntry.class )
         {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DirectoryMetadataEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DirectoryMetadataEntry.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DirectoryMetadataEntry.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DirectoryMetadataEntry.java Sun Aug 26 15:36:01 2007
@@ -22,7 +22,7 @@
 
 
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 
 
@@ -39,7 +39,7 @@
     }
 
 
-    public DirectoryMetadataEntry( DN dn, IConnection connection )
+    public DirectoryMetadataEntry( DN dn, IBrowserConnection connection )
         throws ModelModificationException
     {
         super();
@@ -52,7 +52,7 @@
 
     public boolean hasChildren()
     {
-        if ( getDn().equals( getConnection().getSchema().getDn() ) )
+        if ( getDn().equals( getBrowserConnection().getSchema().getDn() ) )
         {
             return false;
         }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyConnection.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyConnection.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyConnection.java Sun Aug 26 15:36:01 2007
@@ -23,13 +23,15 @@
 
 import java.io.Writer;
 
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.ConnectionParameter.AuthenticationMethod;
+import org.apache.directory.studio.connection.core.ConnectionParameter.EncryptionMethod;
 import org.apache.directory.studio.ldapbrowser.core.BookmarkManager;
 import org.apache.directory.studio.ldapbrowser.core.SearchManager;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ExtendedProgressMonitor;
-import org.apache.directory.studio.ldapbrowser.core.model.ConnectionParameter;
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 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;
@@ -40,7 +42,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 
 
-public class DummyConnection implements IConnection
+public class DummyConnection implements IBrowserConnection
 {
 
     private static final long serialVersionUID = 3671686808330691741L;
@@ -54,81 +56,54 @@
     }
 
 
-    public void bind( ExtendedProgressMonitor monitor )
+    public void create( IEntry entryToCreate, StudioProgressMonitor monitor )
     {
     }
 
 
-    public boolean canClose()
-    {
-        return false;
-    }
-
-
-    public boolean canOpen()
-    {
-        return false;
-    }
-
-
-    public void close()
+    public void create( IValue[] valuesToCreate, StudioProgressMonitor monitor )
     {
     }
 
 
-    public void connect( ExtendedProgressMonitor monitor )
+    public void delete( IEntry entryToDelete, StudioProgressMonitor monitor )
     {
     }
 
 
-    public void create( IEntry entryToCreate, ExtendedProgressMonitor monitor )
+    public void delete( IValue[] valuesToDelete, StudioProgressMonitor monitor )
     {
-    }
-
 
-    public void create( IValue[] valuesToCreate, ExtendedProgressMonitor monitor )
-    {
     }
 
 
-    public void delete( IEntry entryToDelete, ExtendedProgressMonitor monitor )
-    {
-    }
-
-
-    public void delete( IValue[] valuesToDelete, ExtendedProgressMonitor monitor )
+    public void delete( IAttribute[] attriubtesToDelete, StudioProgressMonitor monitor )
     {
 
     }
 
 
-    public void delete( IAttribute[] attriubtesToDelete, ExtendedProgressMonitor monitor )
-    {
-
-    }
-
-
-    public boolean existsEntry( DN dn, ExtendedProgressMonitor monitor )
+    public boolean existsEntry( DN dn, StudioProgressMonitor monitor )
     {
         return false;
     }
 
 
-    public LdifEnumeration exportLdif( SearchParameter searchParameter, ExtendedProgressMonitor pm )
+    public LdifEnumeration exportLdif( SearchParameter searchParameter, StudioProgressMonitor pm )
         throws ConnectionException
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public void fetchRootDSE( ExtendedProgressMonitor monitor )
+    public void fetchRootDSE( StudioProgressMonitor monitor )
     {
     }
 
 
-    public int getAuthMethod()
+    public AuthenticationMethod getAuthMethod()
     {
-        return AUTH_ANONYMOUS;
+        return AuthenticationMethod.NONE;
     }
 
 
@@ -138,12 +113,6 @@
     }
 
 
-    public IEntry[] getBaseDNEntries()
-    {
-        return new IEntry[0];
-    }
-
-
     public String getBindPrincipal()
     {
         return null;
@@ -162,12 +131,6 @@
     }
 
 
-    public ConnectionParameter getConnectionParameter()
-    {
-        return null;
-    }
-
-
     public int getCountLimit()
     {
         return 0;
@@ -180,13 +143,13 @@
     }
 
 
-    public int getEncryptionMethod()
+    public EncryptionMethod getEncryptionMethod()
     {
-        return ENCYRPTION_NONE;
+        return EncryptionMethod.NONE;
     }
 
 
-    public IEntry getEntry( DN dn, ExtendedProgressMonitor monitor )
+    public IEntry getEntry( DN dn, StudioProgressMonitor monitor )
     {
         return null;
     }
@@ -204,12 +167,6 @@
     }
 
 
-    public IEntry[] getMetadataEntries()
-    {
-        return new IEntry[0];
-    }
-
-
     public String getName()
     {
         return null;
@@ -247,7 +204,7 @@
 
 
     public void importLdif( LdifEnumeration enumeration, Writer logWriter, boolean continueOnError,
-        ExtendedProgressMonitor monitor )
+        StudioProgressMonitor monitor )
     {
 
     }
@@ -259,59 +216,32 @@
     }
 
 
-    public boolean isOpened()
+    public void modify( IValue oldValue, IValue newVaue, StudioProgressMonitor monitor )
     {
-        return true;
     }
 
 
-    public boolean isSuspended()
+    public void reloadSchema( StudioProgressMonitor monitor )
     {
-        return true;
     }
 
 
-    public void modify( IValue oldValue, IValue newVaue, ExtendedProgressMonitor monitor )
+    public void move( IEntry entryToMove, DN newSuperior, StudioProgressMonitor monitor )
     {
     }
 
 
-    public void open( ExtendedProgressMonitor monitor )
+    public void rename( IEntry entryToRename, DN newDn, boolean deleteOldRdn, StudioProgressMonitor monitor )
     {
     }
 
 
-    public void reloadSchema( ExtendedProgressMonitor monitor )
+    public void search( ISearch searchRequest, StudioProgressMonitor monitor )
     {
     }
 
 
-    public void move( IEntry entryToMove, DN newSuperior, ExtendedProgressMonitor monitor )
-    {
-    }
-
-
-    public void rename( IEntry entryToRename, DN newDn, boolean deleteOldRdn, ExtendedProgressMonitor monitor )
-    {
-    }
-
-
-    public void reset()
-    {
-    }
-
-
-    public void resume( ExtendedProgressMonitor monitor )
-    {
-    }
-
-
-    public void search( ISearch searchRequest, ExtendedProgressMonitor monitor )
-    {
-    }
-
-
-    public void setAuthMethod( int authMethod )
+    public void setAuthMethod( AuthenticationMethod authMethod )
     {
     }
 
@@ -331,11 +261,6 @@
     }
 
 
-    public void setConnectionParameter( ConnectionParameter connectionParameter )
-    {
-    }
-
-
     public void setCountLimit( int countLimit )
     {
     }
@@ -346,7 +271,7 @@
     }
 
 
-    public void setEncryptionMethod( int encryptionMethod )
+    public void setEncryptionMethod( EncryptionMethod encryptionMethod )
     {
     }
 
@@ -383,12 +308,6 @@
     }
 
 
-    public void suspend()
-    {
-
-    }
-
-
     public Object getAdapter( Class adapter )
     {
         return null;
@@ -419,6 +338,12 @@
 
 
     public URL getUrl()
+    {
+        return null;
+    }
+
+
+    public Connection getConnection()
     {
         return null;
     }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyEntry.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyEntry.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyEntry.java Sun Aug 26 15:36:01 2007
@@ -35,7 +35,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy;
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.RDN;
@@ -63,7 +63,7 @@
     }
 
 
-    public DummyEntry( DN dn, IConnection connection )
+    public DummyEntry( DN dn, IBrowserConnection connection )
     {
         if ( connection instanceof DummyConnection )
         {
@@ -88,7 +88,7 @@
     public void addAttribute( IAttribute attributeToAdd ) throws ModelModificationException
     {
         attributeMap.put( attributeToAdd.getDescription().toLowerCase(), attributeToAdd );
-        EventRegistry.fireEntryUpdated( new AttributeAddedEvent( attributeToAdd.getEntry().getConnection(), this,
+        EventRegistry.fireEntryUpdated( new AttributeAddedEvent( attributeToAdd.getEntry().getBrowserConnection(), this,
             attributeToAdd ), this );
     }
 
@@ -101,7 +101,7 @@
     public void deleteAttribute( IAttribute attributeToDelete ) throws ModelModificationException
     {
         attributeMap.remove( attributeToDelete.getDescription().toLowerCase() );
-        EventRegistry.fireEntryUpdated( new AttributeDeletedEvent( attributeToDelete.getEntry().getConnection(), this,
+        EventRegistry.fireEntryUpdated( new AttributeDeletedEvent( attributeToDelete.getEntry().getBrowserConnection(), this,
             attributeToDelete ), this );
     }
 
@@ -129,7 +129,7 @@
             IAttribute attribute = ( IAttribute ) iterator.next();
 
             AttributeDescription other = new AttributeDescription( attributeDescription );
-            if ( other.isSubtypeOf( ad, getConnection().getSchema() ) )
+            if ( other.isSubtypeOf( ad, getBrowserConnection().getSchema() ) )
             {
                 attributeList.add( attribute );
             }
@@ -154,7 +154,7 @@
     }
 
 
-    public IConnection getConnection()
+    public IBrowserConnection getBrowserConnection()
     {
         return dummyConnection != null ? dummyConnection : BrowserCorePlugin.getDefault().getConnectionManager()
             .getConnection( this.connectionName );
@@ -169,7 +169,7 @@
 
     public URL getUrl()
     {
-        return new URL( getConnection(), getDn() );
+        return new URL( getBrowserConnection(), getDn() );
     }
 
 
@@ -260,7 +260,7 @@
         boolean structuralObjectClassAvailable = false;
         for ( int i = 0; i < ocValues.length; i++ )
         {
-            ObjectClassDescription ocd = this.getConnection().getSchema().getObjectClassDescription( ocValues[i] );
+            ObjectClassDescription ocd = this.getBrowserConnection().getSchema().getObjectClassDescription( ocValues[i] );
             if ( ocd.isStructural() )
             {
                 structuralObjectClassAvailable = true;

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Entry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Entry.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Entry.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Entry.java Sun Aug 26 15:36:01 2007
@@ -23,7 +23,7 @@
 
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.RDN;
@@ -85,9 +85,9 @@
     }
 
 
-    public IConnection getConnection()
+    public IBrowserConnection getBrowserConnection()
     {
-        return this.getParententry().getConnection();
+        return this.getParententry().getBrowserConnection();
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/JNDIConnectionProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/JNDIConnectionProvider.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/JNDIConnectionProvider.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/JNDIConnectionProvider.java Sun Aug 26 15:36:01 2007
@@ -41,14 +41,16 @@
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.Control;
 
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.ConnectionParameter.AuthenticationMethod;
+import org.apache.directory.studio.connection.core.ConnectionParameter.EncryptionMethod;
+import org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ExtendedProgressMonitor;
-import org.apache.directory.studio.ldapbrowser.core.model.ConnectionParameter;
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnectionProvider;
-import org.apache.directory.studio.ldapbrowser.core.model.ICredentials;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.NameException;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
@@ -68,93 +70,51 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifSepLine;
 
 
-public class JNDIConnectionProvider implements IConnectionProvider
+public class JNDIConnectionProvider
 {
 
-    private JNDIConnectionContext context;
-
-
-    public JNDIConnectionProvider()
-    {
-    }
-
-
-    public void connect( ConnectionParameter parameter, ExtendedProgressMonitor monitor ) throws ConnectionException
-    {
-        try
-        {
-            this.context = new JNDIConnectionContext();
-            this.context.connect( parameter.getHost(), parameter.getPort(),
-                parameter.getEncryptionMethod() == IConnection.ENCYRPTION_LDAPS,
-                parameter.getEncryptionMethod() == IConnection.ENCYRPTION_STARTTLS, null, monitor );
-        }
-        catch ( NamingException ne )
-        {
-            this.context = null;
-            throw createConnectionException( null, ne );
-        }
-    }
-
-
-    public void bind( ConnectionParameter parameter, ICredentials credentials, ExtendedProgressMonitor monitor )
-        throws ConnectionException
+    private JNDIConnectionWrapper wrapper;
+    
+    public JNDIConnectionProvider(Connection connection)
     {
-        try
-        {
-            if ( parameter.getAuthMethod() == IConnection.AUTH_SIMPLE )
-            {
-                String bindPrincipal = credentials.getBindPrincipal();
-                String bindPassword = credentials.getBindPassword();
-                this.context.bindSimple( bindPrincipal, bindPassword, monitor );
-            }
-            
-            else if (parameter.getAuthMethod() == IConnection.AUTH_SASL_DIGMD5)
-            {
-            	String bindPrincipal = credentials.getBindPrincipal();
-                String bindPassword = credentials.getBindPassword();
-                this.context.bindSaslDigestMD5(bindPrincipal, bindPassword, monitor);
-            }
-            
-            else if (parameter.getAuthMethod() == IConnection.AUTH_SASL_CRAMD5)
-            {
-            	String bindPrincipal = credentials.getBindPrincipal();
-                String bindPassword = credentials.getBindPassword();
-                this.context.bindSaslCramMD5(bindPrincipal, bindPassword, monitor);
-            }
-            
-            else if ( parameter.getAuthMethod() == IConnection.AUTH_ANONYMOUS )
-            {
-                this.context.bindAnonymous( monitor );
-            }
-
-        }
-        catch ( NamingException ne )
-        {
-            this.context = null;
-            throw createConnectionException( null, ne );
-        }
+        wrapper = connection.getJNDIConnectionWrapper();
     }
 
 
-    public void close() throws ConnectionException
-    {
-        if ( this.context != null )
-        {
-            try
-            {
-                this.context.close();
-                this.context = null;
-            }
-            catch ( NamingException e )
-            {
-            }
-        }
-    }
+//    public void connect( Connection connection, ExtendedProgressMonitor monitor ) throws ConnectionException
+//    {
+//        wrapper = connection.getJNDIConnectionWrapper();
+//        wrapper.connect( monitor );
+//        if(monitor.errorsReported())
+//        {
+//            wrapper = null;
+//            throw createConnectionException( null, monitor.getException() );
+//        }
+//    }
+//
+//
+//    public void bind( BrowserConnectionParameter parameter, ExtendedProgressMonitor monitor )
+//        throws ConnectionException
+//    {
+//        wrapper.bind( monitor );
+//        if(monitor.errorsReported())
+//        {
+//            wrapper = null;
+//            throw createConnectionException( null, monitor.getException() );
+//        }
+//    }
+//
+//
+//    public void close() throws ConnectionException
+//    {
+//        wrapper.disconnect();
+//    }
 
 
-    public LdifEnumeration search( SearchParameter parameter, ExtendedProgressMonitor monitor )
+    public LdifEnumeration search( SearchParameter parameter, StudioProgressMonitor monitor )
         throws ConnectionException
     {
+        String searchBase = parameter.getSearchBase().toString();
         SearchControls controls = new SearchControls();
         switch ( parameter.getScope() )
         {
@@ -192,21 +152,16 @@
             // ldapControls = new Control[]{subEntryControl};
         }
 
-        try
+        NamingEnumeration list = wrapper.search( searchBase, filter, controls, derefAliasMethod, handleReferralsMethod, ldapControls, monitor );
+        if(monitor.errorsReported())
         {
-            NamingEnumeration list = this.context.search( parameter.getSearchBase().toString(), filter, controls,
-                derefAliasMethod, handleReferralsMethod, ldapControls, monitor );
-            return new LdifEnumerationImpl( list, parameter );
+            throw createConnectionException( null, monitor.getException() );
         }
-        catch ( NamingException e )
-        {
-            throw createConnectionException( parameter, e );
-        }
-
+        return new LdifEnumerationImpl( list, parameter );
     }
 
 
-    public void applyModification( LdifRecord record, int referralsHandlingMethod, ExtendedProgressMonitor monitor )
+    public void applyModification( LdifRecord record, int referralsHandlingMethod, StudioProgressMonitor monitor )
         throws ConnectionException
     {
 
@@ -239,13 +194,11 @@
                 }
             }
 
-            try
-            {
-                this.context.createSubcontext( dn, jndiAttributes, getControls( attrValRecord ), monitor );
-            }
-            catch ( NamingException ne )
+            
+            wrapper.createEntry( dn, jndiAttributes, getControls( attrValRecord ), monitor );
+            if(monitor.errorsReported())
             {
-                throw createConnectionException( null, ne );
+                throw createConnectionException( null, monitor.getException() );
             }
         }
         else if ( record instanceof LdifChangeAddRecord )
@@ -268,25 +221,19 @@
                 }
             }
 
-            try
+            wrapper.createEntry( dn, jndiAttributes, getControls( changeAddRecord ), monitor );
+            if(monitor.errorsReported())
             {
-                this.context.createSubcontext( dn, jndiAttributes, getControls( changeAddRecord ), monitor );
-            }
-            catch ( NamingException ne )
-            {
-                throw createConnectionException( null, ne );
+                throw createConnectionException( null, monitor.getException() );
             }
         }
         else if ( record instanceof LdifChangeDeleteRecord )
         {
             LdifChangeDeleteRecord changeDeleteRecord = ( LdifChangeDeleteRecord ) record;
-            try
+            wrapper.deleteEntry( dn, getControls( changeDeleteRecord ), monitor );
+            if(monitor.errorsReported())
             {
-                this.context.destroySubcontext( dn, getControls( changeDeleteRecord ), monitor );
-            }
-            catch ( NamingException ne )
-            {
-                throw createConnectionException( null, ne );
+                throw createConnectionException( null, monitor.getException() );
             }
         }
         else if ( record instanceof LdifChangeModifyRecord )
@@ -319,13 +266,10 @@
                 }
             }
 
-            try
-            {
-                this.context.modifyAttributes( dn, mis, getControls( modifyRecord ), monitor );
-            }
-            catch ( NamingException ne )
+            wrapper.modifyAttributes( dn, mis, getControls( modifyRecord ), monitor );
+            if(monitor.errorsReported())
             {
-                throw createConnectionException( null, ne );
+                throw createConnectionException( null, monitor.getException() );
             }
         }
         else if ( record instanceof LdifChangeModDnRecord )
@@ -347,14 +291,10 @@
                         newDn = new DN( newRdn.toString(), dnObject.getParentDn().toString() );
                     }
 
-                    try
-                    {
-                        this.context.rename( dn.toString(), newDn.toString(), deleteOldRdn, getControls( modDnRecord ),
-                            monitor );
-                    }
-                    catch ( NamingException ne )
+                    wrapper.rename( dn.toString(), newDn.toString(), deleteOldRdn, getControls( modDnRecord ), monitor );
+                    if(monitor.errorsReported())
                     {
-                        throw createConnectionException( null, ne );
+                        throw createConnectionException( null, monitor.getException() );
                     }
                 }
                 catch ( NameException ne )
@@ -399,7 +339,7 @@
         }
 
 
-        public boolean hasNext( ExtendedProgressMonitor monitor ) throws ConnectionException
+        public boolean hasNext( StudioProgressMonitor monitor ) throws ConnectionException
         {
             try
             {
@@ -412,14 +352,14 @@
         }
 
 
-        public LdifContainer next( ExtendedProgressMonitor monitor ) throws ConnectionException
+        public LdifContainer next( StudioProgressMonitor monitor ) throws ConnectionException
         {
 
             try
             {
                 SearchResult sr = ( SearchResult ) enumeration.next();
 
-                DN dn = JNDIUtils.getDn( sr, parameter.getSearchBase().toString(), context );
+                DN dn = JNDIUtils.getDn( sr, parameter.getSearchBase().toString() );
                 LdifContentRecord record = LdifContentRecord.create( dn.toString() );
 
                 NamingEnumeration attributeEnumeration = sr.getAttributes().getAll();
@@ -589,16 +529,16 @@
 
         switch ( parameter.getAliasesDereferencingMethod() )
         {
-            case IConnection.DEREFERENCE_ALIASES_NEVER:
+            case IBrowserConnection.DEREFERENCE_ALIASES_NEVER:
                 m = "never"; //$NON-NLS-1$
                 break;
-            case IConnection.DEREFERENCE_ALIASES_ALWAYS:
+            case IBrowserConnection.DEREFERENCE_ALIASES_ALWAYS:
                 m = "always"; //$NON-NLS-1$
                 break;
-            case IConnection.DEREFERENCE_ALIASES_FINDING:
+            case IBrowserConnection.DEREFERENCE_ALIASES_FINDING:
                 m = "finding"; //$NON-NLS-1$
                 break;
-            case IConnection.DEREFERENCE_ALIASES_SEARCH:
+            case IBrowserConnection.DEREFERENCE_ALIASES_SEARCH:
                 m = "searching"; //$NON-NLS-1$
                 break;
         }
@@ -613,10 +553,10 @@
 
         switch ( referralHandlingMethod )
         {
-            case IConnection.HANDLE_REFERRALS_IGNORE:
+            case IBrowserConnection.HANDLE_REFERRALS_IGNORE:
                 m = "ignore"; //$NON-NLS-1$
                 break;
-            case IConnection.HANDLE_REFERRALS_FOLLOW:
+            case IBrowserConnection.HANDLE_REFERRALS_FOLLOW:
                 // m = "follow"; //$NON-NLS-1$
                 m = "throw"; //$NON-NLS-1$
                 break;

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/JNDIUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/JNDIUtils.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/JNDIUtils.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/JNDIUtils.java Sun Aug 26 15:36:01 2007
@@ -20,18 +20,18 @@
 
 package org.apache.directory.studio.ldapbrowser.core.internal.model;
 
-
 import javax.naming.NamingException;
-import javax.naming.directory.SearchResult;
 
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.NameException;
 
 
+
+
 public class JNDIUtils
 {
 
-    public static DN getDn( SearchResult sr, String base, JNDIConnectionContext context ) throws NamingException,
+    public static DN getDn( javax.naming.directory.SearchResult sr, String base ) throws NamingException,
         NameException, NoSuchFieldException
     {
         String dn = sr.getNameInNamespace();

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ModificationLogger.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ModificationLogger.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ModificationLogger.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ModificationLogger.java Sun Aug 26 15:36:01 2007
@@ -31,20 +31,20 @@
 import java.util.logging.LogRecord;
 import java.util.logging.Logger;
 
-import org.apache.directory.studio.ldapbrowser.core.ConnectionManager;
+import org.apache.directory.studio.ldapbrowser.core.BrowserConnectionManager;
 
 
 public class ModificationLogger
 {
 
-    private Connection connection;
+    private BrowserConnection connection;
 
     private FileHandler fileHandler;
 
     private Logger logger;
 
 
-    public ModificationLogger( Connection connection )
+    public ModificationLogger( BrowserConnection connection )
     {
         this.connection = connection;
     }
@@ -55,7 +55,7 @@
         this.logger = Logger.getAnonymousLogger();
         this.logger.setLevel( Level.ALL );
 
-        String logfileName = ConnectionManager.getModificationLogFileName( connection.getName() );
+        String logfileName = BrowserConnectionManager.getModificationLogFileName( connection.getName() );
         try
         {
             fileHandler = new FileHandler( logfileName, 100000, 10, true );

Added: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/OpenBrowserConnectionsJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/OpenBrowserConnectionsJob.java?rev=569899&view=auto
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/OpenBrowserConnectionsJob.java (added)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/OpenBrowserConnectionsJob.java Sun Aug 26 15:36:01 2007
@@ -0,0 +1,80 @@
+/*
+ *  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.internal.model;
+
+
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
+import org.apache.directory.studio.ldapbrowser.core.jobs.AbstractAsyncBulkJob;
+
+
+public class OpenBrowserConnectionsJob extends AbstractAsyncBulkJob
+{
+
+    private BrowserConnection connection;
+
+
+    public OpenBrowserConnectionsJob( BrowserConnection connection )
+    {
+        this.connection = connection;
+        setName( BrowserCoreMessages.jobs__open_connections_name_1 );
+    }
+
+
+    protected Connection[] getConnections()
+    {
+        return new Connection[0];
+    }
+
+
+    protected Object[] getLockedObjects()
+    {
+        return new Object[]
+            { connection };
+    }
+
+
+    protected String getErrorMessage()
+    {
+        return BrowserCoreMessages.jobs__open_connections_error_1;
+    }
+
+
+    protected void executeBulkJob( StudioProgressMonitor monitor )
+    {
+
+        monitor.beginTask( " ", 1 * 6 + 1 ); //$NON-NLS-1$
+        monitor.reportProgress( " " ); //$NON-NLS-1$
+
+        monitor.setTaskName( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__open_connections_task, new String[]
+            { this.connection.getName() } ) );
+        monitor.worked( 1 );
+
+        connection.open( monitor );
+    }
+
+
+    protected void runNotification()
+    {
+    }
+
+}

Propchange: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/OpenBrowserConnectionsJob.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ReferralBaseEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ReferralBaseEntry.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ReferralBaseEntry.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ReferralBaseEntry.java Sun Aug 26 15:36:01 2007
@@ -22,7 +22,7 @@
 
 
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 
 
 public class ReferralBaseEntry extends DelegateEntry
@@ -36,7 +36,7 @@
     }
 
 
-    public ReferralBaseEntry( IConnection connection, DN dn )
+    public ReferralBaseEntry( IBrowserConnection connection, DN dn )
     {
         super( connection, dn );
     }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ReferralException.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ReferralException.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ReferralException.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/ReferralException.java Sun Aug 26 15:36:01 2007
@@ -26,7 +26,7 @@
 
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IReferralHandler;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
@@ -78,7 +78,7 @@
             URL referralUrl = new URL( referral );
 
             // get referral connection
-            IConnection referralConnection = referralHandler.getReferralConnection( referralUrl );
+            IBrowserConnection referralConnection = referralHandler.getReferralConnection( referralUrl );
             if ( referralConnection == null )
             {
                 // throw new

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/RootDSE.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/RootDSE.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/RootDSE.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/RootDSE.java Sun Aug 26 15:36:01 2007
@@ -25,7 +25,7 @@
 
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 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.ModelModificationException;
@@ -42,7 +42,7 @@
     }
 
 
-    public RootDSE( IConnection connection ) throws ModelModificationException
+    public RootDSE( IBrowserConnection connection ) throws ModelModificationException
     {
         super( new DN(), connection );
     }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Search.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Search.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Search.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Search.java Sun Aug 26 15:36:01 2007
@@ -24,12 +24,13 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.events.SearchUpdateEvent;
 import org.apache.directory.studio.ldapbrowser.core.internal.search.LdapSearchPageScoreComputer;
 import org.apache.directory.studio.ldapbrowser.core.model.Control;
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 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;
@@ -50,7 +51,7 @@
     private static final long serialVersionUID = -3482673086666351174L;
 
     /** The connection. */
-    private IConnection connection;
+    private IBrowserConnection connection;
 
     /** The search results. */
     private ISearchResult[] searchResults;
@@ -86,7 +87,7 @@
         this(
             new SimpleDateFormat( "yyyy-MM-dd HH-mm-ss" ).format( new Date() ), //$NON-NLS-1$
             null, EMPTY_SEARCH_BASE, FILTER_TRUE, NO_ATTRIBUTES, ISearch.SCOPE_ONELEVEL, 0, 0,
-            IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
+            IBrowserConnection.DEREFERENCE_ALIASES_NEVER, IBrowserConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
     }
 
 
@@ -96,7 +97,7 @@
      * @param conn the connection
      * @param searchParameter the search parameters
      */
-    public Search( IConnection conn, SearchParameter searchParameter )
+    public Search( IBrowserConnection conn, SearchParameter searchParameter )
     {
         this.connection = conn;
         this.searchResults = null;
@@ -140,7 +141,7 @@
      * @param initAliasAndReferralsFlag
      *                the init isAlias and isReferral flag
      */
-    public Search( String searchName, IConnection conn, DN searchBase, String filter, String[] returningAttributes,
+    public Search( String searchName, IBrowserConnection conn, DN searchBase, String filter, String[] returningAttributes,
         int scope, int countLimit, int timeLimit, int aliasesDereferencingMethod, int referralsHandlingMethod,
         boolean initHasChildrenFlag, boolean initAliasAndReferralsFlag, Control[] controls )
     {
@@ -428,7 +429,7 @@
     /**
      * {@inheritDoc}
      */
-    public IConnection getConnection()
+    public IBrowserConnection getBrowserConnection()
     {
         return connection;
     }
@@ -437,7 +438,7 @@
     /**
      * {@inheritDoc}
      */
-    public void setConnection( IConnection connection )
+    public void setConnection( IBrowserConnection connection )
     {
         this.connection = connection;
         this.searchParameter.setCountLimit( connection.getCountLimit() );
@@ -462,7 +463,7 @@
      */
     public Object clone()
     {
-        return new Search( this.getName(), this.getConnection(), this.getSearchBase(), this.getFilter(), this
+        return new Search( this.getName(), this.getBrowserConnection(), this.getSearchBase(), this.getFilter(), this
             .getReturningAttributes(), this.getScope(), this.getCountLimit(), this.getTimeLimit(), this
             .getAliasesDereferencingMethod(), this.getReferralsHandlingMethod(), this.isInitHasChildrenFlag(), this
             .isInitAliasAndReferralFlag(), this.getControls() );
@@ -492,15 +493,18 @@
      */
     public Object getAdapter( Class adapter )
     {
-
         Class<?> clazz = ( Class<?> ) adapter;
         if ( clazz.isAssignableFrom( ISearchPageScoreComputer.class ) )
         {
             return new LdapSearchPageScoreComputer();
         }
-        if ( clazz.isAssignableFrom( IConnection.class ) )
+        if ( clazz.isAssignableFrom( Connection.class ) )
+        {
+            return getBrowserConnection().getConnection();
+        }
+        if ( clazz.isAssignableFrom( IBrowserConnection.class ) )
         {
-            return getConnection();
+            return getBrowserConnection();
         }
         if ( clazz.isAssignableFrom( ISearch.class ) )
         {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/SearchResult.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/SearchResult.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/SearchResult.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/SearchResult.java Sun Aug 26 15:36:01 2007
@@ -23,11 +23,12 @@
 
 import java.util.ArrayList;
 
+import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.ldapbrowser.core.internal.search.LdapSearchPageScoreComputer;
 import org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy;
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 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;
@@ -96,25 +97,30 @@
 
     public Object getAdapter( Class adapter )
     {
-        if ( adapter.isAssignableFrom( ISearchPageScoreComputer.class ) )
+        Class<?> clazz = ( Class<?> ) adapter;
+        if ( clazz.isAssignableFrom( ISearchPageScoreComputer.class ) )
         {
             return new LdapSearchPageScoreComputer();
         }
-        if ( adapter == IConnection.class )
+        if ( clazz.isAssignableFrom( Connection.class ) )
         {
-            return this.getConnection();
+            return getConnection().getConnection();
         }
-        if ( adapter == IEntry.class )
+        if ( clazz.isAssignableFrom( IBrowserConnection.class ) )
         {
-            return this.getEntry();
+            return getConnection();
+        }
+        if ( clazz.isAssignableFrom( IEntry.class ) )
+        {
+            return getEntry();
         }
         return null;
     }
 
 
-    public IConnection getConnection()
+    public IBrowserConnection getConnection()
     {
-        return this.search.getConnection();
+        return this.search.getBrowserConnection();
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Value.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Value.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Value.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Value.java Sun Aug 26 15:36:01 2007
@@ -21,10 +21,11 @@
 package org.apache.directory.studio.ldapbrowser.core.internal.model;
 
 
+import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.internal.search.LdapSearchPageScoreComputer;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
@@ -285,9 +286,13 @@
         {
             return new LdapSearchPageScoreComputer();
         }
-        if ( clazz.isAssignableFrom( IConnection.class ) )
+        if ( clazz.isAssignableFrom( Connection.class ) )
         {
-            return getAttribute().getEntry().getConnection();
+            return getAttribute().getEntry().getBrowserConnection().getConnection();
+        }
+        if ( clazz.isAssignableFrom( IBrowserConnection.class ) )
+        {
+            return getAttribute().getEntry().getBrowserConnection();
         }
         if ( clazz.isAssignableFrom( IEntry.class ) )
         {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAsyncBulkJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAsyncBulkJob.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAsyncBulkJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAsyncBulkJob.java Sun Aug 26 15:36:01 2007
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.ldapbrowser.core.jobs;
 
 
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 
@@ -28,7 +29,7 @@
 public abstract class AbstractAsyncBulkJob extends AbstractEclipseJob
 {
 
-    protected final void executeAsyncJob( ExtendedProgressMonitor pm ) throws ModelModificationException
+    protected final void executeAsyncJob( StudioProgressMonitor pm ) throws ModelModificationException
     {
 
         EventRegistry.suspendEventFireingInCurrentThread();
@@ -47,7 +48,7 @@
     }
 
 
-    protected abstract void executeBulkJob( ExtendedProgressMonitor pm ) throws ModelModificationException;
+    protected abstract void executeBulkJob( StudioProgressMonitor pm ) throws ModelModificationException;
 
 
     protected abstract void runNotification();

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractEclipseJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractEclipseJob.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractEclipseJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractEclipseJob.java Sun Aug 26 15:36:01 2007
@@ -21,10 +21,14 @@
 package org.apache.directory.studio.ldapbrowser.core.jobs;
 
 
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.Messages;
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.event.ConnectionEventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 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.IValue;
@@ -49,10 +53,10 @@
     }
 
 
-    protected abstract IConnection[] getConnections();
+    protected abstract Connection[] getConnections();
 
 
-    protected abstract void executeAsyncJob( ExtendedProgressMonitor monitor ) throws Exception;
+    protected abstract void executeAsyncJob( StudioProgressMonitor monitor ) throws Exception;
 
 
     protected String getErrorMessage()
@@ -64,30 +68,25 @@
     protected final IStatus run( IProgressMonitor ipm )
     {
 
-        ExtendedProgressMonitor monitor = new ExtendedProgressMonitor( externalProgressMonitor == null ? ipm
+        StudioProgressMonitor monitor = new StudioProgressMonitor( externalProgressMonitor == null ? ipm
             : externalProgressMonitor );
 
-        // check if connection is opened
-        IConnection[] connections = getConnections();
+        // ensure that connections are opened
+        Connection[] connections = getConnections();
         for ( int i = 0; i < connections.length; i++ )
         {
-            IConnection connection = connections[i];
-            if ( !connection.isOpened() )
+            if ( connections[i] != null && !connections[i].getJNDIConnectionWrapper().isConnected() )
             {
-                // monitor.reportError("Connection is closed");
-
-                EventRegistry.suspendEventFireingInCurrentThread();
-                try
-                {
-                    connection.open( monitor );
-                }
-                finally
-                {
-                    EventRegistry.resumeEventFireingInCurrentThread();
-                }
+                monitor.setTaskName( Messages.bind( Messages.jobs__open_connections_task, new String[]
+                    { connections[i].getName() } ) );
+                monitor.worked( 1 );
+
+                connections[i].getJNDIConnectionWrapper().connect( monitor );
+                connections[i].getJNDIConnectionWrapper().bind( monitor );
+                ConnectionEventRegistry.fireConnectionOpened( connections[i], this );
             }
         }
-
+        
         // execute job
         if ( !monitor.errorsReported() )
         {
@@ -227,9 +226,9 @@
         for ( int i = 0; i < identifiers.length; i++ )
         {
             Object o = objects[i];
-            if ( o instanceof IConnection )
+            if ( o instanceof IBrowserConnection )
             {
-                identifiers[i] = getLockIdentifier( ( IConnection ) o );
+                identifiers[i] = getLockIdentifier( ( IBrowserConnection ) o );
             }
             else if ( o instanceof IEntry )
             {
@@ -256,7 +255,7 @@
     }
 
 
-    protected static String getLockIdentifier( IConnection connection )
+    protected static String getLockIdentifier( IBrowserConnection connection )
     {
         return connection.getHost() + ":" + connection.getPort();
     }
@@ -264,7 +263,7 @@
 
     protected static String getLockIdentifier( IEntry entry )
     {
-        return getLockIdentifier( entry.getConnection() ) + "_"
+        return getLockIdentifier( entry.getBrowserConnection() ) + "_"
             + new StringBuffer( entry.getDn().toString() ).reverse().toString();
     }
 
@@ -283,7 +282,7 @@
 
     protected static String getLockIdentifier( ISearch search )
     {
-        return getLockIdentifier( search.getConnection() ) + "_"
+        return getLockIdentifier( search.getBrowserConnection() ) + "_"
             + new StringBuffer( search.getSearchBase().toString() ).reverse().toString();
     }
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractModificationJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractModificationJob.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractModificationJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractModificationJob.java Sun Aug 26 15:36:01 2007
@@ -21,7 +21,8 @@
 package org.apache.directory.studio.ldapbrowser.core.jobs;
 
 
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 
@@ -29,7 +30,7 @@
 public abstract class AbstractModificationJob extends AbstractAsyncBulkJob
 {
 
-    protected void executeBulkJob( ExtendedProgressMonitor pm ) throws ModelModificationException
+    protected void executeBulkJob( StudioProgressMonitor pm ) throws ModelModificationException
     {
 
         try
@@ -39,19 +40,16 @@
         finally
         {
             // reload affected attributes
-            if ( !getModifiedEntry().getConnection().isSuspended() )
-            {
-                String[] affectedAttributeNames = getAffectedAttributeNames();
-                InitializeAttributesJob.initializeAttributes( getModifiedEntry(), affectedAttributeNames, pm );
-            }
+            String[] affectedAttributeNames = getAffectedAttributeNames();
+            InitializeAttributesJob.initializeAttributes( getModifiedEntry(), affectedAttributeNames, pm );
         }
     }
 
 
-    protected IConnection[] getConnections()
+    protected Connection[] getConnections()
     {
-        return new IConnection[]
-            { getModifiedEntry().getConnection() };
+        return new Connection[]
+            { getModifiedEntry().getBrowserConnection().getConnection() };
     }
 
 
@@ -62,7 +60,7 @@
     }
 
 
-    protected abstract void executeAsyncModificationJob( ExtendedProgressMonitor pm ) throws ModelModificationException;
+    protected abstract void executeAsyncModificationJob( StudioProgressMonitor pm ) throws ModelModificationException;
 
 
     protected abstract IEntry getModifiedEntry();

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java Sun Aug 26 15:36:01 2007
@@ -25,6 +25,8 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.ChildrenInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -33,7 +35,7 @@
 import org.apache.directory.studio.ldapbrowser.core.internal.model.Search;
 import org.apache.directory.studio.ldapbrowser.core.internal.model.Value;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 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;
@@ -65,10 +67,10 @@
     }
 
 
-    protected IConnection[] getConnections()
+    protected Connection[] getConnections()
     {
-        return new IConnection[]
-            { parent.getConnection() };
+        return new Connection[]
+            { parent.getBrowserConnection().getConnection() };
     }
 
 
@@ -81,7 +83,7 @@
     }
 
 
-    protected void executeBulkJob( ExtendedProgressMonitor monitor )
+    protected void executeBulkJob( StudioProgressMonitor monitor )
     {
 
         monitor.beginTask( entriesToCopy.length == 1 ? BrowserCoreMessages.bind(
@@ -128,7 +130,7 @@
 
 
     private int copyEntryRecursive( IEntry entryToCopy, IEntry parent, int scope, int num,
-        ExtendedProgressMonitor monitor )
+        StudioProgressMonitor monitor )
     {
         try
         {
@@ -136,12 +138,12 @@
             param.setSearchBase( entryToCopy.getDn() );
             param.setFilter( ISearch.FILTER_TRUE );
             param.setScope( ISearch.SCOPE_OBJECT );
-            param.setAliasesDereferencingMethod( IConnection.DEREFERENCE_ALIASES_NEVER );
-            param.setReferralsHandlingMethod( IConnection.HANDLE_REFERRALS_IGNORE );
+            param.setAliasesDereferencingMethod( IBrowserConnection.DEREFERENCE_ALIASES_NEVER );
+            param.setReferralsHandlingMethod( IBrowserConnection.HANDLE_REFERRALS_IGNORE );
             param.setReturningAttributes( new String[]
                 { ISearch.ALL_USER_ATTRIBUTES, IAttribute.REFERRAL_ATTRIBUTE } );
-            ISearch search = new Search( entryToCopy.getConnection(), param );
-            entryToCopy.getConnection().search( search, monitor );
+            ISearch search = new Search( entryToCopy.getBrowserConnection(), param );
+            entryToCopy.getBrowserConnection().search( search, monitor );
 
             ISearchResult[] srs = search.getSearchResults();
             if ( !monitor.isCanceled() && srs != null && srs.length == 1 )
@@ -154,21 +156,21 @@
                 IEntry newEntry = new Entry( parent, rdn );
 
                 // change RDN if entry already exists
-                ExtendedProgressMonitor testMonitor = new ExtendedProgressMonitor( monitor );
-                IEntry testEntry = parent.getConnection().getEntry( newEntry.getDn(), testMonitor );
+                StudioProgressMonitor testMonitor = new StudioProgressMonitor( monitor );
+                IEntry testEntry = parent.getBrowserConnection().getEntry( newEntry.getDn(), testMonitor );
                 if ( testEntry != null )
                 {
                     String rdnValue = rdn.getValue();
                     String newRdnValue = BrowserCoreMessages.bind( BrowserCoreMessages.copy_n_of_s, "", rdnValue ); //$NON-NLS-1$
                     RDN newRdn = getNewRdn( rdn, newRdnValue );
                     newEntry = new Entry( parent, newRdn );
-                    testEntry = parent.getConnection().getEntry( newEntry.getDn(), testMonitor );
+                    testEntry = parent.getBrowserConnection().getEntry( newEntry.getDn(), testMonitor );
                     for ( int i = 2; testEntry != null; i++ )
                     {
                         newRdnValue = BrowserCoreMessages.bind( BrowserCoreMessages.copy_n_of_s, i + " ", rdnValue ); //$NON-NLS-1$
                         newRdn = getNewRdn( rdn, newRdnValue );
                         newEntry = new Entry( parent, newRdn );
-                        testEntry = parent.getConnection().getEntry( newEntry.getDn(), testMonitor );
+                        testEntry = parent.getBrowserConnection().getEntry( newEntry.getDn(), testMonitor );
                     }
                 }
 
@@ -245,7 +247,7 @@
                     }
                 }
 
-                newEntry.getConnection().create( newEntry, monitor );
+                newEntry.getBrowserConnection().create( newEntry, monitor );
                 newEntry.getParententry().addChild( newEntry );
                 newEntry.setHasChildrenHint( false );
 
@@ -263,8 +265,8 @@
                     subParam.setFilter( ISearch.FILTER_TRUE );
                     subParam.setScope( ISearch.SCOPE_ONELEVEL );
                     subParam.setReturningAttributes( ISearch.NO_ATTRIBUTES );
-                    ISearch subSearch = new Search( entryToCopy.getConnection(), subParam );
-                    entryToCopy.getConnection().search( subSearch, monitor );
+                    ISearch subSearch = new Search( entryToCopy.getBrowserConnection(), subParam );
+                    entryToCopy.getBrowserConnection().search( subSearch, monitor );
 
                     ISearchResult[] subSrs = subSearch.getSearchResults();
                     if ( !monitor.isCanceled() && subSrs != null && subSrs.length > 0 )

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryJob.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryJob.java Sun Aug 26 15:36:01 2007
@@ -25,95 +25,83 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 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;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 
 
 public class CreateEntryJob extends AbstractAsyncBulkJob
 {
 
-    private IEntry[] entriesToCreate;
+    private IEntry entryToCreate;
+    
+    private IBrowserConnection browserConnection;
 
-    private IEntry[] createdEntries;
+    private IEntry createdEntry;
 
 
-    public CreateEntryJob( IEntry[] entriesToCreate )
+    public CreateEntryJob( IEntry entryToCreate, IBrowserConnection browserConnection )
     {
-        this.entriesToCreate = entriesToCreate;
-        createdEntries = new IEntry[entriesToCreate.length];
-        setName( entriesToCreate.length == 1 ? BrowserCoreMessages.jobs__create_entry_name_1
-            : BrowserCoreMessages.jobs__create_entry_name_n );
+        this.entryToCreate = entryToCreate;
+        this.browserConnection = browserConnection;
+        this.createdEntry = null;
+        
+        setName( BrowserCoreMessages.jobs__create_entry_name_1 );
     }
 
 
-    protected IConnection[] getConnections()
+    protected Connection[] getConnections()
     {
-        IConnection[] connections = new IConnection[entriesToCreate.length];
-        for ( int i = 0; i < connections.length; i++ )
-        {
-            connections[i] = entriesToCreate[i].getConnection();
-        }
-        return connections;
+        return new Connection[]
+            { browserConnection.getConnection() };
     }
 
 
     protected Object[] getLockedObjects()
     {
-        List l = new ArrayList();
-        l.addAll( Arrays.asList( entriesToCreate ) );
-        return l.toArray();
+        return new Object[]
+            { browserConnection };
     }
 
 
-    protected void executeBulkJob( ExtendedProgressMonitor monitor )
+    protected void executeBulkJob( StudioProgressMonitor monitor )
     {
 
-        monitor.beginTask( entriesToCreate.length == 1 ? BrowserCoreMessages.bind(
-            BrowserCoreMessages.jobs__create_entry_task_1, new String[]
-                { entriesToCreate[0].getDn().toString() } ) : BrowserCoreMessages.bind(
-            BrowserCoreMessages.jobs__create_entry_task_n, new String[]
-                { Integer.toString( entriesToCreate.length ) } ), 2 + entriesToCreate.length );
+        monitor.beginTask( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__create_entry_task_1, new String[]
+                { entryToCreate.getDn().toString() } ), 2 + 1 );
         monitor.reportProgress( " " ); //$NON-NLS-1$
         monitor.worked( 1 );
 
-        for ( int i = 0; !monitor.isCanceled() && i < entriesToCreate.length; i++ )
-        {
-            IEntry entryToCreate = entriesToCreate[i];
-
-            entryToCreate.getConnection().create( entryToCreate, monitor );
+        browserConnection.create( entryToCreate, monitor );
 
-            if ( !monitor.errorsReported() )
-            {
-                createdEntries[i] = entryToCreate.getConnection().getEntry( entryToCreate.getDn(), monitor );
-                // createdEntries[i].getParententry().addChild(entry, this);
-                createdEntries[i].setHasChildrenHint( false );
-            }
-
-            monitor.worked( 1 );
+        if ( !monitor.errorsReported() )
+        {
+            createdEntry = browserConnection.getEntry( entryToCreate.getDn(), monitor );
+            // createdEntries[i].getParententry().addChild(entry, this);
+            createdEntry.setHasChildrenHint( false );
         }
+
+        monitor.worked( 1 );
     }
 
 
     protected void runNotification()
     {
-        for ( int i = 0; i < createdEntries.length; i++ )
+        if ( createdEntry != null )
         {
-            if ( createdEntries[i] != null )
-            {
-                EventRegistry.fireEntryUpdated( new EntryAddedEvent( createdEntries[i].getConnection(),
-                    createdEntries[i] ), this );
-            }
+            EventRegistry.fireEntryUpdated( new EntryAddedEvent( browserConnection,
+                createdEntry ), this );
         }
     }
 
 
     protected String getErrorMessage()
     {
-        return entriesToCreate.length == 1 ? BrowserCoreMessages.jobs__create_entry_error_1
-            : BrowserCoreMessages.jobs__create_entry_error_n;
+        return BrowserCoreMessages.jobs__create_entry_error_1;
     }
 
 }



Mime
View raw message