-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separated code that depends only on the core driver
- Loading branch information
Cristian Goina
committed
Aug 7, 2024
1 parent
9028e26
commit b0bafa9
Showing
5 changed files
with
68 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...rsist/src/main/java/org/janelia/colormipsearch/dao/mongo/support/MongoClientProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.janelia.colormipsearch.dao.mongo.support; | ||
|
||
import com.mongodb.MongoClientSettings; | ||
import com.mongodb.client.MongoClient; | ||
import com.mongodb.client.MongoClients; | ||
import com.mongodb.client.MongoDatabase; | ||
|
||
public class MongoClientProvider { | ||
|
||
public static MongoClient createMongoClient( | ||
String mongoConnectionURL, | ||
String mongoServer, | ||
String mongoAuthDatabase, | ||
String mongoUsername, | ||
String mongoPassword, | ||
String mongoReplicaSet, | ||
boolean useSSL, | ||
int connectionsPerHost, | ||
int connectTimeoutInMillis, | ||
int maxConnecting, | ||
int maxWaitTimeInSecs, | ||
int maxConnectionIdleTimeInSecs, | ||
int maxConnLifeTimeInSecs) { | ||
return createMongoClient( | ||
MongoSettingsProvider.prepareMongoSettings( | ||
mongoConnectionURL, mongoServer, mongoAuthDatabase, mongoUsername, mongoPassword, mongoReplicaSet, useSSL, | ||
connectionsPerHost, connectTimeoutInMillis, maxConnecting, maxWaitTimeInSecs, maxConnectionIdleTimeInSecs, maxConnLifeTimeInSecs | ||
) | ||
); | ||
} | ||
|
||
public static MongoClient createMongoClient(MongoClientSettings clientSettings) { | ||
return MongoClients.create(clientSettings); | ||
} | ||
|
||
public static MongoDatabase createMongoDatabase(MongoClient mongoClient, String mongoDatabaseName) { | ||
return mongoClient.getDatabase(mongoDatabaseName); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
...ch-persist/src/main/java/org/janelia/colormipsearch/dao/mongo/support/RegistryHelper.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters