You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2011/01/19 16:59:43 UTC
svn commit: r1060842 -
/directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
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 )