LdapConnectionConfig cc = createConnectionConfig();
if (!config.getBindDN().isEmpty()) {
cc.setName(config.getBindDN());
cc.setCredentials(config.getBindPassword());
}
adminConnectionFactory = new PoolableLdapConnectionFactory(cc);
if (config.getAdminPoolConfig().getMaxActive() != 0) {
adminPool = new LdapConnectionPool(adminConnectionFactory);
adminPool.setTestOnBorrow(true);
adminPool.setMaxActive(config.getAdminPoolConfig().getMaxActive());