@Test public void testCreateMetadata() { final List<MongoDbNode> mongoNodes = new ArrayList<>(); mongoNodes.add(new MongoDbNode(MongoRule.MONGO_HOST, MongoRule.getDataBasePort())); List<ElasticsearchNode> esNodes = new ArrayList<>(); esNodes.add(new ElasticsearchNode(ElasticsearchRule.getHost(), ElasticsearchRule.getPort())); MetaDataConfiguration config = new MetaDataConfiguration(mongoNodes, MongoRule.VITAM_DB, ElasticsearchRule.VITAM_CLUSTER, esNodes); VitamConfiguration.setTenants(tenantList); MongoDbAccessMetadataImpl mongoDbAccess = MongoDbAccessMetadataFactory.create(config); assertNotNull(mongoDbAccess); assertThat(mongoDbAccess.getMongoDatabase().getName()).isEqualTo(MongoRule.VITAM_DB); mongoDbAccess.close(); }
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()); }
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()); } }
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()); }  }
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()); }  static MongoDbAccessMetadataImpl create(MetaDataConfiguration configuration); }
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()); }  static MongoDbAccessMetadataImpl create(MetaDataConfiguration configuration);  }