* Creates the connection
*/
private void createConnection( LdapServer server, ConfigBean configuration )
{
// Creating the connection parameter object
ConnectionParameter connectionParameter = new ConnectionParameter();
// Authentication method
connectionParameter.setAuthMethod( AuthenticationMethod.SIMPLE );
// LDAP or LDAPS?
if ( ApacheDS200LdapServerAdapter.isEnableLdap( configuration ) )
{
connectionParameter.setEncryptionMethod( EncryptionMethod.NONE );
connectionParameter.setPort( ApacheDS200LdapServerAdapter.getLdapPort( configuration ) );
}
else if ( ApacheDS200LdapServerAdapter.isEnableLdaps( configuration ) )
{
connectionParameter.setEncryptionMethod( EncryptionMethod.LDAPS );
connectionParameter.setPort( ApacheDS200LdapServerAdapter.getLdapsPort( configuration ) );
}
// Bind password
connectionParameter.setBindPassword( "secret" ); //$NON-NLS-1$
// Bind principal
connectionParameter.setBindPrincipal( "uid=admin,ou=system" ); //$NON-NLS-1$
// Host
connectionParameter.setHost( "localhost" ); //$NON-NLS-1$
// Name
connectionParameter.setName( server.getName() );
// Network Provider
connectionParameter.setNetworkProvider( ConnectionCorePlugin.getDefault().getDefaultNetworkProvider() );
// Extended Properties
connectionParameter.setExtendedProperty( DetectedConnectionProperties.CONNECTION_PARAMETER_SERVER_TYPE,
ConnectionServerType.APACHEDS.toString() );
connectionParameter.setExtendedProperty( DetectedConnectionProperties.CONNECTION_PARAMETER_VENDOR_NAME,
"Apache Software Foundation" ); //$NON-NLS-1$
connectionParameter.setExtendedProperty( DetectedConnectionProperties.CONNECTION_PARAMETER_VENDOR_VERSION,
"2.0.0" ); //$NON-NLS-1$
// Creating the connection
CreateConnectionActionHelper.createLdapBrowserConnection( server, new Connection( connectionParameter ) );
}