@Test public void givenMongoDbAccessConstructorWhenCreateWithoutRecreateThenAddNothing() { mongoDbAccess = new MongoDbAccessMetadataImpl(mongoRule.getMongoClient(), mongoRule.getMongoDatabase().getName(), false, esClient, tenantList); assertThat(mongoDbAccess.getInfo()) .contains(DEFAULT_MONGO1) .contains(DEFAULT_MONGO2) .contains(DEFAULT_MONGO3) .contains(DEFAULT_MONGO4) .contains(DEFAULT_MONGO5) .contains(DEFAULT_MONGO6) .contains(DEFAULT_MONGO7) .contains(DEFAULT_MONGO8) ; }
@Override public String getInfo() { final StringBuilder builder = new StringBuilder(); final MongoIterable<String> collectionNames = getMongoDatabase().listCollectionNames(); for (final String s : collectionNames) { builder.append(s); builder.append('\n'); } for (final MetadataCollections coll : MetadataCollections.values()) { if (coll != null && coll.getCollection() != null) { @SuppressWarnings("unchecked") final ListIndexesIterable<Document> list = coll.getCollection().listIndexes(); for (final Document dbObject : list) { builder.append(coll.getName()).append(' ').append(dbObject).append('\n'); } } } return builder.toString(); }
MongoDbAccessMetadataImpl extends MongoDbAccess { @Override public String getInfo() { final StringBuilder builder = new StringBuilder(); final MongoIterable<String> collectionNames = getMongoDatabase().listCollectionNames(); for (final String s : collectionNames) { builder.append(s); builder.append('\n'); } for (final MetadataCollections coll : MetadataCollections.values()) { if (coll != null && coll.getCollection() != null) { @SuppressWarnings("unchecked") final ListIndexesIterable<Document> list = coll.getCollection().listIndexes(); for (final Document dbObject : list) { builder.append(coll.getName()).append(' ').append(dbObject).append('\n'); } } } return builder.toString(); } }
MongoDbAccessMetadataImpl extends MongoDbAccess { @Override public String getInfo() { final StringBuilder builder = new StringBuilder(); final MongoIterable<String> collectionNames = getMongoDatabase().listCollectionNames(); for (final String s : collectionNames) { builder.append(s); builder.append('\n'); } for (final MetadataCollections coll : MetadataCollections.values()) { if (coll != null && coll.getCollection() != null) { @SuppressWarnings("unchecked") final ListIndexesIterable<Document> list = coll.getCollection().listIndexes(); for (final Document dbObject : list) { builder.append(coll.getName()).append(' ').append(dbObject).append('\n'); } } } return builder.toString(); } MongoDbAccessMetadataImpl(MongoClient mongoClient, String dbname, boolean recreate,
        ElasticsearchAccessMetadata esClient, List<Integer> tenants); @VisibleForTesting  MongoDbAccessMetadataImpl(MongoClient mongoClient, String dbname, boolean recreate,
        ElasticsearchAccessMetadata esClient); }
MongoDbAccessMetadataImpl extends MongoDbAccess { @Override public String getInfo() { final StringBuilder builder = new StringBuilder(); final MongoIterable<String> collectionNames = getMongoDatabase().listCollectionNames(); for (final String s : collectionNames) { builder.append(s); builder.append('\n'); } for (final MetadataCollections coll : MetadataCollections.values()) { if (coll != null && coll.getCollection() != null) { @SuppressWarnings("unchecked") final ListIndexesIterable<Document> list = coll.getCollection().listIndexes(); for (final Document dbObject : list) { builder.append(coll.getName()).append(' ').append(dbObject).append('\n'); } } } return builder.toString(); } MongoDbAccessMetadataImpl(MongoClient mongoClient, String dbname, boolean recreate,
        ElasticsearchAccessMetadata esClient, List<Integer> tenants); @VisibleForTesting  MongoDbAccessMetadataImpl(MongoClient mongoClient, String dbname, boolean recreate,
        ElasticsearchAccessMetadata esClient); static MongoClientOptions getMongoClientOptions(); @Override String getInfo(); static long getUnitSize(); static long getObjectGroupSize(); ElasticsearchAccessMetadata getEsClient(); void deleteUnitByTenant(Integer... tenantIds); void deleteObjectGroupByTenant(Integer... tenantIds); }
MongoDbAccessMetadataImpl extends MongoDbAccess { @Override public String getInfo() { final StringBuilder builder = new StringBuilder(); final MongoIterable<String> collectionNames = getMongoDatabase().listCollectionNames(); for (final String s : collectionNames) { builder.append(s); builder.append('\n'); } for (final MetadataCollections coll : MetadataCollections.values()) { if (coll != null && coll.getCollection() != null) { @SuppressWarnings("unchecked") final ListIndexesIterable<Document> list = coll.getCollection().listIndexes(); for (final Document dbObject : list) { builder.append(coll.getName()).append(' ').append(dbObject).append('\n'); } } } return builder.toString(); } MongoDbAccessMetadataImpl(MongoClient mongoClient, String dbname, boolean recreate,
        ElasticsearchAccessMetadata esClient, List<Integer> tenants); @VisibleForTesting  MongoDbAccessMetadataImpl(MongoClient mongoClient, String dbname, boolean recreate,
        ElasticsearchAccessMetadata esClient); static MongoClientOptions getMongoClientOptions(); @Override String getInfo(); static long getUnitSize(); static long getObjectGroupSize(); ElasticsearchAccessMetadata getEsClient(); void deleteUnitByTenant(Integer... tenantIds); void deleteObjectGroupByTenant(Integer... tenantIds);  }