From commits-return-29695-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Wed Jan 19 16:00:09 2011 Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 86723 invoked from network); 19 Jan 2011 16:00:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Jan 2011 16:00:09 -0000 Received: (qmail 53452 invoked by uid 500); 19 Jan 2011 16:00:09 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 53394 invoked by uid 500); 19 Jan 2011 16:00:07 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 53386 invoked by uid 99); 19 Jan 2011 16:00:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jan 2011 16:00:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jan 2011 16:00:04 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 90BE42388A02; Wed, 19 Jan 2011 15:59:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: pamarcelot@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110119155943.90BE42388A02@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 )