removed MongoManager
parent
8e944a55e5
commit
e5b845fdfe
|
@ -1,39 +0,0 @@
|
||||||
package net.krakatoaapi.mongo;
|
|
||||||
|
|
||||||
import com.mongodb.async.client.MongoClient;
|
|
||||||
import com.mongodb.async.client.MongoClients;
|
|
||||||
import com.mongodb.async.client.MongoDatabase;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
public class MongoManager {
|
|
||||||
|
|
||||||
private final String hostname;
|
|
||||||
private final int port;
|
|
||||||
private final String username;
|
|
||||||
private final String password;
|
|
||||||
|
|
||||||
// TODO: look - deprecated
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
private MongoDatabase mongoDatabase;
|
|
||||||
@Getter
|
|
||||||
private MongoClient mongoClient;
|
|
||||||
//@Getter
|
|
||||||
//private MongoCollection<Document> players;
|
|
||||||
|
|
||||||
public MongoManager(String hostname, int port, String username, String password) {
|
|
||||||
this.hostname = hostname;
|
|
||||||
this.port = port;
|
|
||||||
this.username = username;
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void connect(String database) {
|
|
||||||
mongoClient = MongoClients.create(
|
|
||||||
"mongodb://" + username + ":" + password + "@" + hostname + ":" + port + "/?authSource="
|
|
||||||
+ database);
|
|
||||||
|
|
||||||
mongoDatabase = mongoClient.getDatabase(database);
|
|
||||||
//players = mongoDatabase.getCollection("players");
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue