RED-8702: Explore document databases to store entityLog
- refactoring
This commit is contained in:
parent
2c064f22a2
commit
fc17fca498
@ -1 +1 @@
|
||||
version = 0.2-SNAPSHOT
|
||||
version = 0.3-SNAPSHOT
|
||||
@ -26,7 +26,20 @@ public class MultiTenantMongoDBFactory extends SimpleMongoClientDatabaseFactory
|
||||
|
||||
public MultiTenantMongoDBFactory(MongoDataSources mongoDataSources) {
|
||||
|
||||
super(new MongoClient() {
|
||||
super(getBootstrapMongoClient(), "BOOTSTRAP");
|
||||
this.mongoDataSources = mongoDataSources;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected @NotNull MongoDatabase doGetMongoDatabase(@NotNull String dbName) {
|
||||
|
||||
return mongoDataSources.mongoDatabaseCurrentTenantResolver();
|
||||
}
|
||||
|
||||
|
||||
private static MongoClient getBootstrapMongoClient() {
|
||||
return new MongoClient() {
|
||||
@Override
|
||||
public MongoDatabase getDatabase(String s) {
|
||||
|
||||
@ -157,15 +170,7 @@ public class MultiTenantMongoDBFactory extends SimpleMongoClientDatabaseFactory
|
||||
|
||||
return null;
|
||||
}
|
||||
}, "BOOTSTRAP");
|
||||
this.mongoDataSources = mongoDataSources;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected @NotNull MongoDatabase doGetMongoDatabase(@NotNull String dbName) {
|
||||
|
||||
return mongoDataSources.mongoDatabaseCurrentTenantResolver();
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user