2017-06-04 23:54:32 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 univento.eu - All rights reserved
|
|
|
|
* You are not allowed to use, distribute or modify this code
|
|
|
|
*/
|
|
|
|
|
2016-08-02 23:53:40 +02:00
|
|
|
package eu.univento.commons.database;
|
|
|
|
|
2017-04-07 17:10:36 +02:00
|
|
|
import eu.univento.commons.Commons;
|
|
|
|
import io.vertx.core.json.JsonObject;
|
|
|
|
import io.vertx.ext.mongo.MongoClient;
|
2017-03-24 19:10:50 +01:00
|
|
|
import lombok.Getter;
|
2016-08-02 23:53:40 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author joethei
|
2017-02-18 18:08:45 +01:00
|
|
|
* @version 1.0
|
2016-08-02 23:53:40 +02:00
|
|
|
*/
|
|
|
|
public class MongoDB {
|
|
|
|
|
2017-04-07 17:10:36 +02:00
|
|
|
@Getter private MongoClient client;
|
2016-08-02 23:53:40 +02:00
|
|
|
|
|
|
|
public MongoDB(String host, int port, String username, String password, String databaseName) {
|
2017-04-07 17:10:36 +02:00
|
|
|
client = MongoClient.createShared(Commons.getCommons().getVertx(),
|
2017-04-13 15:56:55 +02:00
|
|
|
new JsonObject().put("host", host).put("port", port).put("username", username).put("password", password).put("db_name", databaseName));
|
2016-08-02 23:53:40 +02:00
|
|
|
}
|
|
|
|
}
|