Commit fc8f5b97 authored by Andre Freyssinet's avatar Andre Freyssinet

Adds DB Name getter to MBean.

parent 3fa1efd5
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2018 ScalAgent Distributed Technologies
* Copyright (C) 2018 - 2019 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
......@@ -50,7 +50,7 @@ public class JDBCTransaction extends DBTransaction implements JDBCTransactionMBe
public final static String JDBC_DB_PASS_PROP = JDBC_TRANSACTION_PREFIX + ".password";
public final static String JDBC_DB_NAME_PROP = JDBC_TRANSACTION_PREFIX + ".dbname";
public final static String DFLT_JDBC_DB_NAME = "JoramDB" + AgentServer.getServerId();
public final static String DFLT_JDBC_DB_PREFIX = "JoramDB";
public final static String JDBC_DB_INIT_PROP = JDBC_TRANSACTION_PREFIX + ".dbinit";
// For MySQL: "CREATE TABLE JoramDB (name VARCHAR(255), content LONGBLOB, PRIMARY KEY(name))";
......@@ -124,7 +124,7 @@ public class JDBCTransaction extends DBTransaction implements JDBCTransactionMBe
throw new IOException("Bad JDBC configuration");
}
dbname = AgentServer.getProperty(JDBC_DB_NAME_PROP, DFLT_JDBC_DB_NAME);
dbname = AgentServer.getProperty(JDBC_DB_NAME_PROP, DFLT_JDBC_DB_PREFIX + AgentServer.getServerId());
dbinit = AgentServer.getProperty(JDBC_DB_INIT_PROP);
if (dbinit == null) {
......@@ -196,6 +196,11 @@ public class JDBCTransaction extends DBTransaction implements JDBCTransactionMBe
}
}
@Override
public String getDBName() {
return dbname;
}
@Override
public String getDBInitStatement() {
return dbinit;
......
......@@ -25,6 +25,8 @@ public interface JDBCTransactionMBean {
String getDriver();
String getURL();
String getDBName();
String getDBInitStatement();
Properties getClientInfo();
......
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