}
}
if ( protocol.equalsIgnoreCase( "LDAP" ) )
{
Transport ldap = new TcpTransport( address, port, nbThreads, backlog );
ldapServer.addTransports( ldap );
}
else if ( protocol.equalsIgnoreCase( "LDAPS" ) )
{
Transport ldaps = new TcpTransport( address, port, nbThreads, backlog );
ldaps.setEnableSSL( true );
ldapServer.addTransports( ldaps );
}
else
{
throw new IllegalArgumentException( I18n.err( I18n.ERR_689, protocol ) );
}
}
}
else
{
// Create default LDAP and LDAPS transports
int port = AvailablePortFinder.getNextAvailable( 1024 );
Transport ldap = new TcpTransport( port );
ldapServer.addTransports( ldap );
port = AvailablePortFinder.getNextAvailable( port );
Transport ldaps = new TcpTransport( port );
ldaps.setEnableSSL( true );
ldapServer.addTransports( ldaps );
}
}