public class MongoLoader extends Object
| Constructor and Description |
|---|
MongoLoader() |
| Modifier and Type | Method and Description |
|---|---|
static MongoConnection |
getConnection(String host,
int port,
String dbName) |
static com.mongodb.client.MongoDatabase |
getMongoDatabase()
Loads the Mongo database if it has not been loaded.
|
static com.mongodb.client.MongoDatabase |
getMongoDatabase(String database)
Loads the Mongo database if it has not been loaded.
|
static com.mongodb.client.MongoDatabase |
getMongoDatabase(String host,
int port)
Gets the Mongo Database
|
static com.mongodb.client.MongoDatabase |
getMongoDatabase(String host,
int port,
String dbName)
Gets the Mongo Database
|
static com.mongodb.client.MongoDatabase |
getMongoDatabase(String host,
int port,
String dbName,
String username,
String password)
Gets the mongo database includes the Username and Password.
|
static void |
setMongoDatabase(String host,
int port,
String dbName)
Sets the mongo database, useful when running unit tests.
|
public static void setMongoDatabase(String host, int port, String dbName)
host - Host of the database.port - Port database uses.dbName - Database namepublic static com.mongodb.client.MongoDatabase getMongoDatabase()
public static com.mongodb.client.MongoDatabase getMongoDatabase(String database)
public static com.mongodb.client.MongoDatabase getMongoDatabase(String host, int port, String dbName)
host - URL of the databaseport - port useddbName - name of the database.public static com.mongodb.client.MongoDatabase getMongoDatabase(String host, int port)
host - URL of the databaseport - port usedpublic static com.mongodb.client.MongoDatabase getMongoDatabase(String host, int port, String dbName, String username, String password)
host - URL of the database.port - Port to use.dbName - Database Nameusername - Username for the accountpassword - Password for the accountpublic static MongoConnection getConnection(String host, int port, String dbName)
Copyright © 2016. All rights reserved.