<commit_before>/*
 *  Copyright (c) 2017 <NAME> and others
 *   All rights reserved. This program and the accompanying materials
 *   are made available under the terms of the Eclipse Public License v1.0
 *   and Apache License v2.0 which accompanies this distribution.
 *   The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 *   and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
 *
 *   You may elect to redistribute this code under either of these licenses.
 *
 *   Contributors:
 *
 *   <NAME>
 */

package org.jnosql.diana.ravendb.document;

import net.ravendb.client.documents.DocumentStore;
import org.jnosql.diana.api.Settings;
import org.jnosql.diana.api.document.DocumentConfiguration;
import org.jnosql.diana.api.document.DocumentConfigurationAsync;


/**
 * The MongoDB implementation to both {@link DocumentConfiguration} and {@link DocumentConfigurationAsync}
 * that returns  {@link MongoDBDocumentCollectionManagerFactory} {@link MongoDBDocumentCollectionManagerAsyncFactory}.
 * It tries to read the diana-mongodb.properties file whose has the following properties
 * <p>mongodb-server-host-: as prefix to add host client, eg: mongodb-server-host-1=host1, mongodb-server-host-2= host2</p>
 */
public class RavenDBDocumentConfiguration implements DocumentConfiguration<MongoDBDocumentCollectionManagerFactory> {

    private static final String FILE_CONFIGURATION = "diana-ravendb.properties";

    static final int DEFAULT_PORT = 27017;


    @Override
    public MongoDBDocumentCollectionManagerFactory get() {
        DocumentStore
        return null;
    }

    @Override
    public MongoDBDocumentCollectionManagerFactory get(Settings settings) {
        return null;
    }
}<commit_msg>Improves documentation<commit_after>/*
 *  Copyright (c) 2017 <NAME> and others
 *   All rights reserved. This program and the accompanying materials
 *   are made available under the terms of the Eclipse Public License v1.0
 *   and Apache License v2.0 which accompanies this distribution.
 *   The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 *   and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
 *
 *   You may elect to redistribute this code under either of these licenses.
 *
 *   Contributors:
 *
 *   <NAME>
 */

package org.jnosql.diana.ravendb.document;

import org.jnosql.diana.api.Settings;
import org.jnosql.diana.api.document.DocumentConfiguration;
import org.jnosql.diana.driver.ConfigurationReader;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import static java.util.Objects.requireNonNull;


/**
 * The RavenDB implementation to both {@link DocumentConfiguration}
 * that returns  {@link MongoDBDocumentCollectionManagerFactory}
 * It tries to read the diana-ravendb.properties file whose has the following properties
 * <p>ravendb-server-host-: as prefix to add host client, eg: ravendb-server-host-1=host1, ravendb-server-host-2= host2</p>
 */
public class RavenDBDocumentConfiguration implements DocumentConfiguration<MongoDBDocumentCollectionManagerFactory> {

    private static final String FILE_CONFIGURATION = "diana-ravendb.properties";

    private List<String> hosts = new ArrayList<>();

    @Override
    public MongoDBDocumentCollectionManagerFactory get() {
        Map<String, String> configuration = ConfigurationReader.from(FILE_CONFIGURATION);
        return get(configuration);
    }

    @Override
    public MongoDBDocumentCollectionManagerFactory get(Settings settings) {
        return null;
    }


    private MongoDBDocumentCollectionManagerFactory get(Map<String, String> configurations) throws NullPointerException {
        requireNonNull(configurations, "configurations is required");
        List<String> servers = configurations.keySet().stream().filter(s -> s.startsWith("ravendb-server-host-"))
                .map(configurations::get).collect(Collectors.toList());
        if (servers.isEmpty()) {
            return new MongoDBDocumentCollectionManagerFactory(new MongoClient());
        }

        return new MongoDBDocumentCollectionManagerFactory(new MongoClient(servers));
    }
}
{'fraction_non_alphanumeric': 0.08797379503977538, 'fraction_numerical': 0.00959288722508189, 'mean_word_length': 4.245398773006135, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4269266', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1150, 'n_words': 326}