{
Connection conn;
try
{
conn = new Connection( null, getHostName(), getPort(), getEncyrptionMethod(), isAutoFetchBaseDns(),
new DN( getBaseDN() ), getCountLimit(), getTimeLimit(), getAliasesDereferencingMethod(),
getReferralsHandlingMethod(), IConnection.AUTH_ANONYMOUS, null, null );
}
catch ( NameException e )
{
conn = null;
}
return conn;
}
else if ( getAuthenticationMethod() == IConnection.AUTH_SIMPLE )
{
Connection conn;
try
{
conn = new Connection( null, getHostName(), getPort(), getEncyrptionMethod(), isAutoFetchBaseDns(),
new DN( getBaseDN() ), getCountLimit(), getTimeLimit(), getAliasesDereferencingMethod(),
getReferralsHandlingMethod(), IConnection.AUTH_SIMPLE, getSimpleAuthBindDN(),
getSimpleAuthBindPassword() );
}
catch ( NameException e )
{