28 lines
1.0 KiB
Java
28 lines
1.0 KiB
Java
package eu.univento.commons.database;
|
|
|
|
import eu.univento.commons.Commons;
|
|
import eu.univento.commons.configuration.ConfigurationHandler;
|
|
import lombok.Data;
|
|
|
|
/**
|
|
* @author joethei
|
|
* @version 1.0
|
|
*/
|
|
|
|
@Data
|
|
public class DatabaseManager {
|
|
|
|
//TODO: add board sql back, when forum is online.
|
|
|
|
private MongoDB mongoDB;
|
|
private MySQL mySQL;
|
|
private Redis redis;
|
|
|
|
public DatabaseManager(Commons commons) {
|
|
ConfigurationHandler config = commons.getConfigurationHandler();
|
|
mongoDB = new MongoDB(config.getString("MongoDB.Host"), config.getInteger("MongoDB.Port"), config.getString("MongoDB.Username"), config.getString("MongoDB.Password"), config.getString("MongoDB.Database"));
|
|
mySQL = new MySQL(config.getString("MySQL.Host"), config.getString("MySQL.Port"), config.getString("MySQL.Database"), config.getString("MySQL.Username"), config.getString("MySQL.Password"));
|
|
redis = new Redis(config.getString("Redis.Hostname"), config.getInteger("Redis.Port"), config.getString("Redis.Password"));
|
|
}
|
|
|
|
} |