directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1060842 - /directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
Date Wed, 19 Jan 2011 15:59:43 GMT
Author: pamarcelot
Date: Wed Jan 19 15:59:43 2011
New Revision: 1060842

URL: http://svn.apache.org/viewvc?rev=1060842&view=rev
Log:
Cleaning.

Modified:
    directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java

Modified: directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java?rev=1060842&r1=1060841&r2=1060842&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
(original)
+++ directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
Wed Jan 19 15:59:43 2011
@@ -98,6 +98,9 @@ public class DirectoryApiConnectionWrapp
     /** The connection*/
     private Connection connection;
 
+    /** The LDAP Connection Configuration */
+    private LdapConnectionConfig ldapConnectionConfig;
+
     /** The LDAP Connection */
     private LdapNetworkConnection ldapConnection;
 
@@ -113,8 +116,6 @@ public class DirectoryApiConnectionWrapp
     /** The bind password */
     private String bindPassword;
 
-    private LdapConnectionConfig ldapConnectionConfig;
-
 
     /**
      * Creates a new instance of JNDIConnectionContext.
@@ -128,61 +129,6 @@ public class DirectoryApiConnectionWrapp
 
 
     /**
-     * Gets the associated LDAP Connection.
-     *
-     * @return
-     *      the associated LDAP Connection
-     * @throws Exception 
-     */
-    private LdapNetworkConnection getLdapConnections()
-    {
-        if ( ldapConnection != null )
-        {
-            return ldapConnection;
-        }
-
-        LdapConnectionConfig config = new LdapConnectionConfig();
-        config.setLdapHost( connection.getHost() );
-        config.setLdapPort( connection.getPort() );
-        config.setName( connection.getBindPrincipal() );
-        config.setCredentials( connection.getBindPassword() );
-        if ( ( connection.getEncryptionMethod() == EncryptionMethod.LDAPS )
-            || ( connection.getEncryptionMethod() == EncryptionMethod.START_TLS ) )
-        {
-            config.setUseSsl( true );
-
-            try
-            {
-                // get default trust managers (using JVM "cacerts" key store)
-                TrustManagerFactory factory = TrustManagerFactory.getInstance( TrustManagerFactory
-                    .getDefaultAlgorithm() );
-                factory.init( ( KeyStore ) null );
-                TrustManager[] defaultTrustManagers = factory.getTrustManagers();
-
-                // create wrappers around the trust managers
-                StudioTrustManager[] trustManagers = new StudioTrustManager[defaultTrustManagers.length];
-                for ( int i = 0; i < defaultTrustManagers.length; i++ )
-                {
-                    trustManagers[i] = new StudioTrustManager( ( X509TrustManager ) defaultTrustManagers[i]
);
-                    trustManagers[i].setHost( connection.getHost() );
-                }
-
-                config.setTrustManagers( trustManagers );
-            }
-            catch ( Exception e )
-            {
-                e.printStackTrace();
-                throw new RuntimeException( e );
-            }
-        }
-
-        ldapConnection = new LdapNetworkConnection( config );
-
-        return ldapConnection;
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     public void connect( StudioProgressMonitor monitor )



Mime
View raw message