class MongoDbAccessMetadataFactory {

    public static MongoDbAccessMetadataImpl create(MetaDataConfiguration configuration) {
        ParametersChecker.checkParameter("configuration is a mandatory parameter", configuration);

        ElasticsearchAccessMetadata esClient;
        try {
            esClient = ElasticsearchAccessMetadataFactory.create(configuration);

        } catch (final MetaDataException | IOException e1) {
            throw new IllegalArgumentException(e1);
        }

        final List<Class<?>> classList = new ArrayList<>();
        for (final MetadataCollections e : MetadataCollections.class.getEnumConstants()) {
            classList.add(e.getClasz());
        }
        MetadataCollections.class.getEnumConstants();

        final MongoClient mongoClient =
            MongoDbAccess.createMongoClient(configuration, VitamCollection.getMongoClientOptions(classList));
        return new MongoDbAccessMetadataImpl(mongoClient, configuration.getDbName(), true, esClient, VitamConfiguration.getTenants());
    }

}