public function __construct(DomainConfiguration $config, EventDispatcherInterface $dispatcher = null, LdapLoggerInterface $logger = null)
{
$this->usernameFormatter = BindUserStrategy::getInstance($config);
$this->serverPool = new LdapServerPool($config);
$this->config = $config;
$this->dispatcher = $dispatcher ?: new SymfonyEventDispatcher();
$this->logger = $logger;
$this->setupOperationInvoker();
$this->serverPool->setSelectionMethod($config->getServerSelection());
if (!$config->getLazyBind()) {
$this->connect();
}
}