Allow configurable database name 51/74451/2
authorTschaen, Brendan <ctschaen@att.com>
Mon, 10 Dec 2018 15:24:27 +0000 (10:24 -0500)
committerTschaen, Brendan <ctschaen@att.com>
Thu, 13 Dec 2018 20:14:26 +0000 (15:14 -0500)
Change-Id: I967df28f2f5281e7eee6a03087a279cbbe9f6e3e
Issue-ID: MUSIC-258
Signed-off-by: Tschaen, Brendan <ctschaen@att.com>
mdbc-server/src/main/java/org/onap/music/mdbc/MdbcServerLogic.java
mdbc-server/src/main/java/org/onap/music/mdbc/configurations/NodeConfiguration.java

index d00ca35..e35c214 100755 (executable)
@@ -57,7 +57,7 @@ public class MdbcServerLogic extends JdbcMeta{
 
        public MdbcServerLogic(String Url, Properties info, NodeConfiguration config) throws SQLException, MDBCServiceException {
                super(Url,info);
-               this.manager = new StateManager(Url,info,config.nodeName, "test"); //FIXME: db name should not be passed in ahead of time
+               this.manager = new StateManager(Url,info,config.nodeName, config.sqlDatabaseName); //FIXME: db name should not be passed in ahead of time
                this.info = info;
         int concurrencyLevel = Integer.parseInt(
                 info.getProperty(ConnectionCacheSettings.CONCURRENCY_LEVEL.key(),
index ad86ada..7a6aad7 100755 (executable)
@@ -38,11 +38,13 @@ public class NodeConfiguration {
 
     public DatabasePartition partition;
     public String nodeName;
+    public String sqlDatabaseName;
 
-    public NodeConfiguration(String tables, UUID mriIndex, String mriTableName, String node){
+    public NodeConfiguration(String tables, UUID mriIndex, String sqlDatabaseName, String node){
         //     public DatabasePartition(List<Range> knownRanges, UUID mriIndex, String mriTable, String lockId, String musicTxDigestTable) {
         partition = new DatabasePartition(toRanges(tables), mriIndex, null) ;
         this.nodeName = node;
+        this.sqlDatabaseName = sqlDatabaseName;
     }
 
     protected List<Range> toRanges(String tables){