Commit f64e1857 authored by Andre Freyssinet's avatar Andre Freyssinet

Allows to configure through the AgentServer configuration file (JORAM-314).

parent 510d610b
/*
* Copyright (C) 2007 - 2012 ScalAgent Distributed Technologies
* Copyright (C) 2007 - 2018 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -32,6 +32,8 @@ import java.util.Properties;
import org.objectweb.util.monolog.api.BasicLevel;
import fr.dyade.aaa.agent.AgentServer;
/**
* The MySQLDBTransaction class implements a transactionnal storage through
* a MySQL database.
......@@ -45,7 +47,7 @@ public final class MySQLDBTransaction extends DBTransaction {
protected void initDB() throws IOException {
String configFile = System.getProperty("MySQLDBTransactionConfigFile", "MySQL.properties");
String configFile = AgentServer.getProperty("MySQLDBTransactionConfigFile", "MySQL.properties");
Properties prop = new Properties();
try {
prop.load(new FileInputStream(configFile));
......
/*
* Copyright (C) 2007 - 2011 ScalAgent Distributed Technologies
* Copyright (C) 2007 - 2018 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -38,6 +38,7 @@ import org.apache.commons.dbcp.BasicDataSource;
import org.objectweb.util.monolog.api.BasicLevel;
import org.objectweb.util.monolog.api.Logger;
import fr.dyade.aaa.agent.AgentServer;
import fr.dyade.aaa.common.Debug;
/**
......@@ -94,23 +95,15 @@ import fr.dyade.aaa.common.Debug;
* @see Repository
*/
public final class MySqlDBRepository implements Repository {
/*
String driver = "org.apache.derby.jdbc.EmbeddedDriver";
String connurl = "jdbc:derby:";
// String driver = "org.hsqldb.jdbcDriver";
// String connurl = "jdbc:hsqldb:file:";
*/
String driver = System.getProperty("DBDriver", "org.gjt.mm.mysql.Driver");
String connurl = System.getProperty("ConnURL", "jdbc:mysql://localhost:3306/mysql");
String user = System.getProperty("DBUser", "root");
String pass = System.getProperty("DBPass", "");
public static Logger logger = Debug.getLogger("fr.dyade.aaa.util.MySqlDBRepository");
String driver = AgentServer.getProperty("DBDriver", "org.gjt.mm.mysql.Driver");
String connurl = AgentServer.getProperty("ConnURL", "jdbc:mysql://localhost:3306/mysql");
String user = AgentServer.getProperty("DBUser", "root");
String pass = AgentServer.getProperty("DBPass", "");
BasicDataSource ds = null;
boolean reconnectLoop = false;
public static Logger logger =
Debug.getLogger("fr.dyade.aaa.util.MySqlDBRepository");
File dir = null;
private int nbsaved = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment