25 lines
742 B
Java
25 lines
742 B
Java
/*
|
|
* Copyright (c) 2017 univento.eu - All rights reserved
|
|
* You are not allowed to use, distribute or modify this code
|
|
*/
|
|
|
|
package eu.univento.commons.database;
|
|
|
|
import eu.univento.commons.Commons;
|
|
import io.vertx.core.json.JsonObject;
|
|
import io.vertx.ext.mongo.MongoClient;
|
|
import lombok.Getter;
|
|
|
|
/**
|
|
* @author joethei
|
|
* @version 1.0
|
|
*/
|
|
public class MongoDB {
|
|
|
|
@Getter private MongoClient client;
|
|
|
|
public MongoDB(String host, int port, String username, String password, String databaseName) {
|
|
client = MongoClient.createShared(Commons.getCommons().getVertx(),
|
|
new JsonObject().put("host", host).put("port", port).put("username", username).put("password", password).put("db_name", databaseName));
|
|
}
|
|
} |