directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r570754 - in /directory/studio/trunk: studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ studio-connection-ui/src/main/ja...
Date Wed, 29 Aug 2007 11:22:31 GMT
Author: seelmann
Date: Wed Aug 29 04:22:15 2007
New Revision: 570754

URL: http://svn.apache.org/viewvc?rev=570754&view=rev
Log:
Fix for DIRSTUDIO-174. Added an ID as connection identifier.

Modified:
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Connection.java
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionParameter.java
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionEventRegistry.java
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionUpdateListener.java
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/EntryTransfer.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/SearchTransfer.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/ValuesTransfer.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserUniversalListener.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/BrowserConnection.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DelegateEntry.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyEntry.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorNavigationLocation.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/ConnectionComboContributionItem.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaBrowserNavigationLocation.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorNavigationLocation.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java
    directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Connection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Connection.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Connection.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Connection.java Wed Aug 29 04:22:15 2007
@@ -100,15 +100,8 @@
      */
     public void setConnectionParameter( ConnectionParameter connectionParameter )
     {
-        String oldName = this.connectionParameter.getName();
-        
         this.connectionParameter = connectionParameter;
-        
         ConnectionEventRegistry.fireConnectionUpdated( this, this );
-        if(!oldName.equals( connectionParameter.getName() ))
-        {
-            ConnectionEventRegistry.fireConnectionRenamed( this, oldName, this );
-        }
     }
 
 
@@ -157,6 +150,17 @@
 
 
     /**
+     * Gets the id.
+     * 
+     * @return the id
+     */
+    public String getId()
+    {
+        return connectionParameter.getId();
+    }
+    
+    
+    /**
      * Gets the host.
      * 
      * @return the host
@@ -256,9 +260,8 @@
      */
     public void setName( String name )
     {
-        String oldName = getName();
         connectionParameter.setName( name );
-        ConnectionEventRegistry.fireConnectionRenamed( this, oldName, this );
+        ConnectionEventRegistry.fireConnectionUpdated( this, this );
     }
 
 

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java Wed Aug 29 04:22:15 2007
@@ -135,11 +135,11 @@
      */
     public void addConnection( int index, Connection connection )
     {
-        if ( getConnection( connection.getConnectionParameter().getName() ) != null )
+        if ( getConnectionByName( connection.getConnectionParameter().getName() ) != null )
         {
             String newConnectionName = Messages.bind( Messages.copy_n_of_s,
                 "", connection.getConnectionParameter().getName() ); //$NON-NLS-1$
-            for ( int i = 2; getConnection( newConnectionName ) != null; i++ )
+            for ( int i = 2; getConnectionByName( newConnectionName ) != null; i++ )
             {
                 newConnectionName = Messages.bind( Messages.copy_n_of_s,
                     i + " ", connection.getConnectionParameter().getName() ); //$NON-NLS-1$
@@ -153,6 +153,28 @@
 
 
     /**
+     * Gets a connection from its id.
+     *
+     * @param id
+     *      the id of the Connection
+     * @return
+     *      the corresponding Connection
+     */
+    public Connection getConnectionById( String id )
+    {
+        for ( Iterator it = connectionList.iterator(); it.hasNext(); )
+        {
+            Connection conn = ( Connection ) it.next();
+            if ( conn.getConnectionParameter().getId().equals( id ) )
+            {
+                return conn;
+            }
+        }
+        return null;
+    }
+    
+    
+    /**
      * Gets a connection from its name.
      *
      * @param name
@@ -160,7 +182,7 @@
      * @return
      *      the corresponding Connection
      */
-    public Connection getConnection( String name )
+    public Connection getConnectionByName( String name )
     {
         for ( Iterator it = connectionList.iterator(); it.hasNext(); )
         {
@@ -238,15 +260,6 @@
      * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRemoved(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionRemoved( Connection connection )
-    {
-        saveConnections();
-    }
-
-
-    /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRenamed(org.apache.directory.studio.connection.core.Connection, java.lang.String)
-     */
-    public void connectionRenamed( Connection connection, String oldName )
     {
         saveConnections();
     }

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionParameter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionParameter.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionParameter.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionParameter.java Wed Aug 29 04:22:15 2007
@@ -23,6 +23,7 @@
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Random;
 
 
 /**
@@ -80,9 +81,12 @@
 
     }
 
+    /** The unique id. */
+    private String id;
+
     /** The symbolic name. */
     private String name;
-
+    
     /** The host name or IP address of the LDAP server. */
     private String host;
 
@@ -105,23 +109,6 @@
     private Map<String, String> extendedProperties;
 
 
-    //    /** Flag indicating if base DNs should be fetched from namingContexts attribute of the Root DSE. */
-    //    private boolean fetchBaseDNs;
-    //
-    //    /** The user provided base DN. */
-    //    private DN baseDN;
-    //
-    //    /** The time limit im milliseconds. */
-    //    private int timeLimit;
-    //
-    //    /** The count limit. */
-    //    private int countLimit;
-    //
-    //    /** The alias dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING or IConnection.DEREFERENCE_ALIASES_SEARCH. */
-    //    private int aliasesDereferencingMethod;
-    //
-    //    /** The referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE or IConnection.HANDLE_REFERRALS_FOLLOW. */
-    //    private int referralsHandlingMethod;
 
     /**
      * Creates a new instance of ConnectionParameter.
@@ -148,6 +135,7 @@
         AuthenticationMethod authMethod, String bindPrincipal, String bindPassword,
         Map<String, String> extendedProperties )
     {
+        this.id = createId();
         this.name = name;
         this.host = host;
         this.port = port;
@@ -252,6 +240,32 @@
 
 
     /**
+     * Gets the id.
+     * 
+     * @return the id
+     */
+    public String getId()
+    {
+        if ( id == null )
+        {
+            id = createId();
+        }
+        return id;
+    }
+
+
+    /**
+     * Sets the id.
+     * 
+     * @param id the id
+     */
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+
+    /**
      * Gets the host.
      * 
      * @return the host
@@ -427,6 +441,18 @@
         {
             return false;
         }
+    }
+
+
+    /**
+     * Creates a unique id.
+     * 
+     * @return the created id
+     */
+    private String createId()
+    {
+        long id = new Random( System.currentTimeMillis() ).nextLong();
+        return Long.valueOf( id ).toString();
     }
 
 }

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionEventRegistry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionEventRegistry.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionEventRegistry.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionEventRegistry.java Wed Aug 29 04:22:15 2007
@@ -223,44 +223,6 @@
 
 
     /**
-     * Notifies each {@link ConnectionUpdateListener} about the renamed connection.
-     * Uses the {@link EventRunner}s.
-     *
-     * @param connection the renamed connection
-     * @param oldName the old name
-     * @param source the source
-     */
-    public static void fireConnectionRenamed( final Connection connection, final String oldName, final Object source )
-    {
-        if ( isEventFireingSuspendedInCurrentThread() )
-        {
-            return;
-        }
-
-        Map<ConnectionUpdateListener, EventRunner> listeners = new HashMap<ConnectionUpdateListener, EventRunner>(
-            connectionUpdateListeners );
-        Iterator<ConnectionUpdateListener> it = listeners.keySet().iterator();
-        while ( it.hasNext() )
-        {
-            final ConnectionUpdateListener listener = it.next();
-            EventRunnable runnable = new EventRunnable()
-            {
-                public void run()
-                {
-                    listener.connectionRenamed( connection, oldName );
-                }
-            };
-
-            EventRunner runner = listeners.get( listener );
-            synchronized ( lock )
-            {
-                runner.execute( runnable );
-            }
-        }
-    }
-
-
-    /**
      * Notifies each {@link ConnectionUpdateListener} about the added connection.
      * Uses the {@link EventRunner}s.
      *

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionUpdateListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionUpdateListener.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionUpdateListener.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/event/ConnectionUpdateListener.java Wed Aug 29 04:22:15 2007
@@ -68,15 +68,6 @@
 
 
     /**
-     * Called when an {@link Connection} was renamed.
-     *
-     * @param connection the renamed connection 
-     * @param oldName the old connection name
-     */
-    public void connectionRenamed( Connection connection, String oldName );
-
-
-    /**
      * Called when {@link Connection} parameters were updated.
      *
      * @param connection the updated connection 

Modified: directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java (original)
+++ directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java Wed Aug 29 04:22:15 2007
@@ -148,7 +148,7 @@
             {
                 if ( connection.getName().equals( newName ) )
                     return null;
-                else if ( ConnectionCorePlugin.getDefault().getConnectionManager().getConnection( newName ) != null )
+                else if ( ConnectionCorePlugin.getDefault().getConnectionManager().getConnectionByName( newName ) != null )
                     return "A connection with this name already exists.";
                 else
                     return null;

Modified: directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java (original)
+++ directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java Wed Aug 29 04:22:15 2007
@@ -150,15 +150,6 @@
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRenamed(org.apache.directory.studio.connection.core.Connection, java.lang.String)
-     */
-    public void connectionRenamed( Connection connection, String oldName )
-    {
-        connectionUpdated( connection );
-    }
-
-
-    /**
      * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionOpened(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionOpened( Connection connection )

Modified: directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java (original)
+++ directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java Wed Aug 29 04:22:15 2007
@@ -39,9 +39,9 @@
 
 /**
  * A {@link Transfer} that could be used to transfer {@link Connection} objects.
- * Note that only the connection name is converted to a platform specific 
+ * Note that only the connection id is converted to a platform specific 
  * representation, not the complete object. To convert it back to an {@link Connection} 
- * object the {@link ConnectionManager#getConnection(String)} method is invoked.
+ * object the {@link ConnectionManager#getConnectionById(String)} method is invoked.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -82,7 +82,7 @@
      * {@inheritDoc}
      * 
      * This implementation only accepts {@link Connection} objects. 
-     * It just converts the name of the connection to the platform 
+     * It just converts the id of the connection to the platform 
      * specific representation.
      */
     public void javaToNative( Object object, TransferData transferData )
@@ -102,9 +102,9 @@
 
                 for ( int i = 0; i < connections.length; i++ )
                 {
-                    byte[] name = connections[i].getName().getBytes();
-                    writeOut.writeInt( name.length );
-                    writeOut.write( name );
+                    byte[] id = connections[i].getConnectionParameter().getId().getBytes();
+                    writeOut.writeInt( id.length );
+                    writeOut.write( id );
                 }
 
                 byte[] buffer = out.toByteArray();
@@ -124,8 +124,8 @@
      * {@inheritDoc}
      * 
      * This implementation just converts the platform specific representation
-     * to the connection name and invokes 
-     * {@link ConnectionManager#getConnection(String)} to get the
+     * to the connection id and invokes 
+     * {@link ConnectionManager#getConnectionById(String)} to get the
      * {@link Connection} object.
      */
     public Object nativeToJava( TransferData transferData )
@@ -149,10 +149,10 @@
                     if ( readIn.available() > 1 )
                     {
                         int size = readIn.readInt();
-                        byte[] connectionName = new byte[size];
-                        readIn.read( connectionName );
-                        Connection connection = ConnectionCorePlugin.getDefault().getConnectionManager().getConnection(
-                            new String( connectionName ) );
+                        byte[] id = new byte[size];
+                        readIn.read( id );
+                        Connection connection = ConnectionCorePlugin.getDefault().getConnectionManager().getConnectionById(
+                            new String( id ) );
                         connectionList.add( connection );
                     }
                 }

Modified: directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java (original)
+++ directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java Wed Aug 29 04:22:15 2007
@@ -81,15 +81,6 @@
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRenamed(org.apache.directory.studio.connection.core.Connection, java.lang.String)
-     */
-    public void connectionRenamed( Connection connection, String oldName )
-    {
-        connectionUpdated( connection );
-    }
-
-
-    /**
      * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionAdded(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionAdded( Connection connection )

Modified: directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java (original)
+++ directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java Wed Aug 29 04:22:15 2007
@@ -288,7 +288,7 @@
         {
             message = "Please enter a connection name.";
         }
-        if ( ConnectionCorePlugin.getDefault().getConnectionManager().getConnection( nameText.getText() ) != null
+        if ( ConnectionCorePlugin.getDefault().getConnectionManager().getConnectionByName( nameText.getText() ) != null
             && ( connectionParameter == null || !nameText.getText().equals( connectionParameter.getName() ) ) )
         {
             errorMessage = "A connection named '" + nameText.getText() + "' already exists.";

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/proxy/BrowserActionProxy.java Wed Aug 29 04:22:15 2007
@@ -167,15 +167,6 @@
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRenamed(org.apache.directory.studio.connection.core.Connection, java.lang.String)
-     */
-    public void connectionRenamed( Connection connection, String oldName )
-    {
-        connectionUpdated( connection );
-    }
-
-
-    /**
      * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionOpened(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionOpened( Connection connection )

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/EntryTransfer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/EntryTransfer.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/EntryTransfer.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/EntryTransfer.java Wed Aug 29 04:22:15 2007
@@ -42,7 +42,7 @@
 
 /**
  * A {@link Transfer} that could be used to transfer {@link IEntry} objects.
- * Note that only the connection name and entry's DN is converted to a platform specific 
+ * Note that only the connection id and entry's DN is converted to a platform specific 
  * representation, not the complete object.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -84,7 +84,7 @@
      * {@inheritDoc}
      * 
      * This implementation only accepts {@link IEntry} objects. 
-     * It just converts the name of the connection and the entry's DN
+     * It just converts the id of the connection and the entry's DN
      * to the platform specific representation.
      */
     public void javaToNative( Object object, TransferData transferData )
@@ -104,9 +104,9 @@
 
                 for ( int i = 0; i < entries.length; i++ )
                 {
-                    byte[] connectionName = entries[i].getBrowserConnection().getName().getBytes();
-                    writeOut.writeInt( connectionName.length );
-                    writeOut.write( connectionName );
+                    byte[] connectionId = entries[i].getBrowserConnection().getConnection().getId().getBytes();
+                    writeOut.writeInt( connectionId.length );
+                    writeOut.write( connectionId );
                     byte[] dn = entries[i].getDn().toString().getBytes();
                     writeOut.writeInt( dn.length );
                     writeOut.write( dn );
@@ -129,8 +129,8 @@
      * {@inheritDoc}
      * 
      * This implementation just converts the platform specific representation
-     * to the connection name and entry DN and invokes 
-     * {@link BrowserConnectionManager#getConnection(String)} to get the
+     * to the connection id and entry DN and invokes 
+     * {@link BrowserConnectionManager#getBrowserConnectionById(String)} to get the
      * {@link IBrowserConnection} object and {@link IBrowserConnection#getEntryFromCache(DN)}
      * to get the {@link IEntry} object.
      */
@@ -158,10 +158,10 @@
                         if ( readIn.available() > 1 )
                         {
                             int size = readIn.readInt();
-                            byte[] connectionName = new byte[size];
-                            readIn.read( connectionName );
-                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
-                                new String( connectionName ) );
+                            byte[] connectionId = new byte[size];
+                            readIn.read( connectionId );
+                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
+                                new String( connectionId ) );
                         }
 
                         IEntry entry = null;

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/SearchTransfer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/SearchTransfer.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/SearchTransfer.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/SearchTransfer.java Wed Aug 29 04:22:15 2007
@@ -29,8 +29,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.BrowserConnectionManager;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.eclipse.swt.dnd.ByteArrayTransfer;
@@ -40,7 +40,7 @@
 
 /**
  * A {@link Transfer} that could be used to transfer {@link ISearch} objects.
- * Note that only the connection name and search name is converted to a platform specific 
+ * Note that only the connection id and search name is converted to a platform specific 
  * representation, not the complete object.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -82,7 +82,7 @@
      * {@inheritDoc}
      * 
      * This implementation only accepts {@link ISearch} objects. 
-     * It just converts the name of the connection and the name of the search
+     * It just converts the id of the connection and the name of the search
      * to the platform specific representation.
      */
     public void javaToNative( Object object, TransferData transferData )
@@ -102,9 +102,9 @@
 
                 for ( int i = 0; i < searches.length; i++ )
                 {
-                    byte[] connectionName = searches[i].getBrowserConnection().getName().getBytes();
-                    writeOut.writeInt( connectionName.length );
-                    writeOut.write( connectionName );
+                    byte[] connectionId = searches[i].getBrowserConnection().getConnection().getId().getBytes();
+                    writeOut.writeInt( connectionId.length );
+                    writeOut.write( connectionId );
                     byte[] searchName = searches[i].getName().getBytes();
                     writeOut.writeInt( searchName.length );
                     writeOut.write( searchName );
@@ -127,8 +127,8 @@
      * {@inheritDoc}
      * 
      * This implementation just converts the platform specific representation
-     * to the connection name and search name and invokes 
-     * {@link BrowserConnectionManager#getConnection(String)} to get the
+     * to the connection id and search name and invokes 
+     * {@link BrowserConnectionManager#getBrowserConnectionById(String)} to get the
      * {@link IBrowserConnection} object and {@link IBrowserConnection#getSearchManager()}
      * to get the {@link ISearch} object.
      */
@@ -156,10 +156,10 @@
                         if ( readIn.available() > 1 )
                         {
                             int size = readIn.readInt();
-                            byte[] connectionName = new byte[size];
-                            readIn.read( connectionName );
-                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
-                                new String( connectionName ) );
+                            byte[] connectionId = new byte[size];
+                            readIn.read( connectionId );
+                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
+                                new String( connectionId ) );
                         }
 
                         ISearch search = null;

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/ValuesTransfer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/ValuesTransfer.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/ValuesTransfer.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dnd/ValuesTransfer.java Wed Aug 29 04:22:15 2007
@@ -82,7 +82,7 @@
      * {@inheritDoc}
      * 
      * This implementation only accepts {@link IValue} objects. 
-     * It converts the name of the connection, the entry's DN, the 
+     * It converts the id of the connection, the entry's DN, the 
      * attribute description and the value to the platform specific 
      * representation.
      */
@@ -103,9 +103,9 @@
 
                 for ( int i = 0; i < values.length; i++ )
                 {
-                    byte[] connectionName = values[i].getAttribute().getEntry().getBrowserConnection().getName().getBytes();
-                    writeOut.writeInt( connectionName.length );
-                    writeOut.write( connectionName );
+                    byte[] connectionId = values[i].getAttribute().getEntry().getBrowserConnection().getConnection().getId().getBytes();
+                    writeOut.writeInt( connectionId.length );
+                    writeOut.write( connectionId );
                     byte[] dn = values[i].getAttribute().getEntry().getDn().toString().getBytes();
                     writeOut.writeInt( dn.length );
                     writeOut.write( dn );
@@ -172,10 +172,10 @@
                         if ( readIn.available() > 1 )
                         {
                             int size = readIn.readInt();
-                            byte[] connectionName = new byte[size];
-                            readIn.read( connectionName );
-                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
-                                new String( connectionName ) );
+                            byte[] connectionId = new byte[size];
+                            readIn.read( connectionId );
+                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
+                                new String( connectionId ) );
                         }
 
                         IEntry entry = null;

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserUniversalListener.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserUniversalListener.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserUniversalListener.java Wed Aug 29 04:22:15 2007
@@ -173,15 +173,6 @@
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRenamed(org.apache.directory.studio.connection.core.Connection, java.lang.String)
-     */
-    public void connectionRenamed( Connection connection, String oldName )
-    {
-        viewer.refresh();
-    }
-
-
-    /**
      * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionAdded(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionAdded( Connection connection )

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java Wed Aug 29 04:22:15 2007
@@ -203,31 +203,60 @@
     }
 
 
+//    /**
+//     * Gets a connection from its name.
+//     *
+//     * @param name
+//     *      the name of the Connection
+//     * @return
+//     *      the corresponding IConnection
+//     */
+//    public IBrowserConnection getConnectionByName( String name )
+//    {
+//        return connectionMap.get( name );
+//    }
+    
+    
     /**
-     * Gets a connection from its name.
+     * Gets a browser connection from its id.
      *
-     * @param name
-     *      the name of the Connection
+     * @param id
+     *      the id of the Connection
      * @return
-     *      the corresponding IConnection
+     *      the corresponding IBrowserConnection
      */
-    public IBrowserConnection getConnection( String name )
+    public IBrowserConnection getBrowserConnectionById( String id )
     {
-        return connectionMap.get( name );
+        return connectionMap.get( id );
     }
 
 
     /**
-     * Gets a connection from its underlying connection.
+     * Gets a browser connection from its name.
+     *
+     * @param name
+     *      the name of the Connection
+     * @return
+     *      the corresponding IBrowserConnection
+     */
+    public IBrowserConnection getBrowserConnectionByName( String name )
+    {
+        Connection connection = ConnectionCorePlugin.getDefault().getConnectionManager().getConnectionByName( name );
+        return getBrowserConnection( connection );
+    }
+    
+    
+    /**
+     * Gets a browser connection from its underlying connection.
      *
      * @param connection
      *      the underlying connection
      * @return
-     *      the corresponding IConnection
+     *      the corresponding IBrowserConnection
      */
     public IBrowserConnection getBrowserConnection( Connection connection )
     {
-        return getConnection( connection.getName() );
+        return connection != null ? getBrowserConnectionById( connection.getId() ) : null;
     }
 
 
@@ -244,48 +273,15 @@
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRenamed(org.apache.directory.studio.connection.core.Connection, java.lang.String)
-     */
-    public void connectionRenamed( Connection connection, String oldName )
-    {
-        String newName = connection.getName();
-        
-        // update connection list
-        IBrowserConnection browserConnection = connectionMap.remove( oldName );
-        connectionMap.put( newName, browserConnection );
-
-        // rename schema file
-        String oldSchemaFileName = getSchemaCacheFileName( oldName );
-        String newSchemaFileName = getSchemaCacheFileName( newName );
-        File oldSchemaFile = new File( oldSchemaFileName );
-        File newSchemaFile = new File( newSchemaFileName );
-        if ( oldSchemaFile.exists() )
-        {
-            oldSchemaFile.renameTo( newSchemaFile );
-        }
-
-        // TODO: schema
-        //        if ( connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.SCHEMA_LOADED
-        //            || connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.CONNECTION_OPENED )
-        //        {
-        //            saveSchema( connectionUpdateEvent.getConnection() );
-        //        }
-        
-        // make persistent
-        saveBrowserConnections();
-    }
-
-
-    /**
      * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRemoved(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionRemoved( Connection connection )
     {
         // update connection list
-        connectionMap.remove( connection.getName() );
+        connectionMap.remove( connection.getId() );
 
         // remove schema file
-        File schemaFile = new File( getSchemaCacheFileName( connection.getName() ) );
+        File schemaFile = new File( getSchemaCacheFileName( connection.getId() ) );
         if ( schemaFile.exists() )
         {
             schemaFile.delete();
@@ -303,7 +299,7 @@
     {
         // update connection list
         BrowserConnection browserConnection = new BrowserConnection( connection );
-        connectionMap.put( connection.getName(), browserConnection );
+        connectionMap.put( connection.getId(), browserConnection );
 
         // make persistent
         saveBrowserConnections();
@@ -390,7 +386,7 @@
                 bookmarkParameters[k] = bookmarks[k].getBookmarkParameter();
             }
 
-            object[i][0] = browserConnection.getName();
+            object[i][0] = browserConnection.getConnection().getId();
             object[i][1] = searchParameters;
             object[i][2] = bookmarkParameters;
         }
@@ -409,7 +405,7 @@
     {
         try
         {
-            String filename = getSchemaCacheFileName( connection.getName() );
+            String filename = getSchemaCacheFileName( connection.getConnection().getId() );
             FileWriter writer = new FileWriter( filename );
             connection.getSchema().saveToLdif( writer );
             writer.close();
@@ -431,7 +427,7 @@
         {
             Connection connection = connections[i];
             BrowserConnection browserConnection = new BrowserConnection( connection );
-            connectionMap.put( connection.getName(), browserConnection );
+            connectionMap.put( connection.getId(), browserConnection );
         }
 
         //        try
@@ -458,8 +454,8 @@
                 {
                     for ( int i = 0; i < object.length; i++ )
                     {
-                        String connectionName = ( String ) object[i][0];
-                        IBrowserConnection browserConnection = getConnection( connectionName );
+                        String connectionId = ( String ) object[i][0];
+                        IBrowserConnection browserConnection = getBrowserConnectionById( connectionId );
                         
                         if( browserConnection != null )
                         {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/BrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/BrowserConnection.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/BrowserConnection.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/BrowserConnection.java Wed Aug 29 04:22:15 2007
@@ -1029,9 +1029,6 @@
     public void connectionUpdated( org.apache.directory.studio.connection.core.Connection connection )
     {
     }
-    public void connectionRenamed( org.apache.directory.studio.connection.core.Connection connection, String oldName )
-    {
-    }
     public void connectionOpened( org.apache.directory.studio.connection.core.Connection connection )
     {
         if(this.connection == connection)

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=570754&r1=570753&r2=570754&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 Wed Aug 29 04:22:15 2007
@@ -54,7 +54,7 @@
     private static final long serialVersionUID = -4488685394817691963L;
 
     // private IConnection connection;
-    private String connectionName;
+    private String connectionId;
 
     private DN dn;
 
@@ -70,7 +70,7 @@
 
     public DelegateEntry( IBrowserConnection connection, DN dn )
     {
-        this.connectionName = connection.getName();
+        this.connectionId = connection.getConnection().getId();
         this.dn = dn;
         this.entryDoesNotExist = false;
         this.delegate = null;
@@ -100,7 +100,7 @@
         if ( this.getDelegate() != null )
             return getDelegate().getBrowserConnection();
         else
-            return BrowserCorePlugin.getDefault().getConnectionManager().getConnection( this.connectionName );
+            return BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById( this.connectionId );
         // return connection;
     }
 

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=570754&r1=570753&r2=570754&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 Wed Aug 29 04:22:15 2007
@@ -53,7 +53,7 @@
 
     private DummyConnection dummyConnection;
 
-    private String connectionName;
+    private String connectionId;
 
     private Map attributeMap;
 
@@ -71,7 +71,7 @@
         }
         else
         {
-            this.connectionName = connection.getName();
+            this.connectionId = connection.getConnection().getId();
         }
 
         this.dn = dn;
@@ -157,7 +157,7 @@
     public IBrowserConnection getBrowserConnection()
     {
         return dummyConnection != null ? dummyConnection : BrowserCorePlugin.getDefault().getConnectionManager()
-            .getConnection( this.connectionName );
+            .getBrowserConnectionById( this.connectionId );
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorNavigationLocation.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorNavigationLocation.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorNavigationLocation.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorNavigationLocation.java Wed Aug 29 04:22:15 2007
@@ -115,7 +115,7 @@
                 IEntry entry = eei.getEntryInput();
                 memento.putString( "TYPE", "IEntry" );
                 memento.putString( "DN", entry.getDn().toString() );
-                memento.putString( "CONNECTION", entry.getBrowserConnection().getName() );
+                memento.putString( "CONNECTION", entry.getBrowserConnection().getConnection().getId() );
             }
             else if ( eei.getSearchResultInput() != null )
             {
@@ -123,14 +123,14 @@
                 memento.putString( "TYPE", "ISearchResult" );
                 memento.putString( "DN", searchResult.getDn().toString() );
                 memento.putString( "SEARCH", searchResult.getSearch().getName() );
-                memento.putString( "CONNECTION", searchResult.getSearch().getBrowserConnection().getName() );
+                memento.putString( "CONNECTION", searchResult.getSearch().getBrowserConnection().getConnection().getId() );
             }
             else if ( eei.getBookmarkInput() != null )
             {
                 IBookmark bookmark = eei.getBookmarkInput();
                 memento.putString( "TYPE", "IBookmark" );
                 memento.putString( "BOOKMARK", bookmark.getName() );
-                memento.putString( "CONNECTION", bookmark.getBrowserConnection().getName() );
+                memento.putString( "CONNECTION", bookmark.getBrowserConnection().getConnection().getId() );
             }
         }
 
@@ -147,7 +147,7 @@
             String type = memento.getString( "TYPE" );
             if ( "IEntry".equals( type ) )
             {
-                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
+                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
                     memento.getString( "CONNECTION" ) );
                 DN dn = new DN( memento.getString( "DN" ) );
                 IEntry entry = connection.getEntryFromCache( dn );
@@ -155,7 +155,7 @@
             }
             else if ( "ISearchResult".equals( type ) )
             {
-                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
+                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
                     memento.getString( "CONNECTION" ) );
                 ISearch search = connection.getSearchManager().getSearch( memento.getString( "SEARCH" ) );
                 ISearchResult[] searchResults = search.getSearchResults();
@@ -171,7 +171,7 @@
             }
             else if ( "IBookmark".equals( type ) )
             {
-                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
+                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
                     memento.getString( "CONNECTION" ) );
                 IBookmark bookmark = connection.getBookmarkManager().getBookmark( memento.getString( "BOOKMARK" ) );
                 super.setInput( new EntryEditorInput( bookmark ) );

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/ConnectionComboContributionItem.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/ConnectionComboContributionItem.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/ConnectionComboContributionItem.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/ConnectionComboContributionItem.java Wed Aug 29 04:22:15 2007
@@ -198,15 +198,6 @@
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRenamed(org.apache.directory.studio.connection.core.Connection, java.lang.String)
-     */
-    public void connectionRenamed( Connection connection, String oldName )
-    {
-        connectionUpdated( connection );
-    }
-
-
-    /**
      * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionOpened(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionOpened( Connection connection )

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaBrowserNavigationLocation.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaBrowserNavigationLocation.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaBrowserNavigationLocation.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaBrowserNavigationLocation.java Wed Aug 29 04:22:15 2007
@@ -102,7 +102,7 @@
     {
         IBrowserConnection connection = getConnection();
         SchemaPart schemaElement = getSchemElement();
-        memento.putString( "CONNECTION", connection.getName() );
+        memento.putString( "CONNECTION", connection.getConnection().getId() );
         memento.putString( "SCHEMAELEMENTYPE", schemaElement.getClass().getName() );
         memento.putString( "SCHEMAELEMENTOID", schemaElement.getNumericOID() );
     }
@@ -113,7 +113,7 @@
      */
     public void restoreState( IMemento memento )
     {
-        IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
+        IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
             memento.getString( "CONNECTION" ) );
         String schemaElementType = memento.getString( "SCHEMAELEMENTYPE" );
         String schemaElementOid = memento.getString( "SCHEMAELEMENTOID" );

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorNavigationLocation.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorNavigationLocation.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorNavigationLocation.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorNavigationLocation.java Wed Aug 29 04:22:15 2007
@@ -74,7 +74,7 @@
     {
         ISearch search = getSearch();
         memento.putString( "SEARCH", search.getName() );
-        memento.putString( "CONNECTION", search.getBrowserConnection().getName() );
+        memento.putString( "CONNECTION", search.getBrowserConnection().getConnection().getId() );
     }
 
 
@@ -83,7 +83,7 @@
      */
     public void restoreState( IMemento memento )
     {
-        IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
+        IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
             memento.getString( "CONNECTION" ) );
         ISearch search = connection.getSearchManager().getSearch( memento.getString( "SEARCH" ) );
         super.setInput( new SearchResultEditorInput( search ) );

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java Wed Aug 29 04:22:15 2007
@@ -74,7 +74,7 @@
                     Connection[] connections = BrowserSelectionUtils.getConnections( selection );
                     if ( connections.length == 1 )
                     {
-                        IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection( connections[0].getName() );
+                        IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById( connections[0].getId() );
                         ModificationLogsViewInput input = new ModificationLogsViewInput( connection, 0 );
                         setInput( input );
                         scrollToNewest();

Modified: directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java?rev=570754&r1=570753&r2=570754&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java (original)
+++ directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java Wed Aug 29 04:22:15 2007
@@ -476,7 +476,7 @@
         {
             public void modifyText( ModifyEvent e )
             {
-                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
+                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionByName(
                     connectionCombo.getText() );
                 setConnection( connection );
                 IAction action = getAction( ExecuteLdifAction.class.getName() );
@@ -623,15 +623,6 @@
      * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRemoved(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionRemoved( Connection connection )
-    {
-        connectionUpdated( connection );
-    }
-
-
-    /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRenamed(org.apache.directory.studio.connection.core.Connection, java.lang.String)
-     */
-    public void connectionRenamed( Connection connection, String oldName )
     {
         connectionUpdated( connection );
     }



Mime
View raw message