DatabaseClass-replaced type with diamonds
[dmaap/dbcapi.git] / src / main / java / org / onap / dmaap / dbcapi / database / DatabaseClass.java
index 11b0d15..b404479 100644 (file)
@@ -3,6 +3,8 @@
  * org.onap.dmaap
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright (C) 2019 IBM.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,7 +57,7 @@ public class DatabaseClass extends BaseLoggingClass {
                        if (val == null) {
                                return(null);
                        }
-                       List<String> rv = new ArrayList<String>();
+                       List<String> rv = new ArrayList<>();
                        for (String s: val.split(",")) {
                                rv.add(new String(s));
                        }
@@ -200,22 +202,18 @@ public class DatabaseClass extends BaseLoggingClass {
                        mirrors = new HashMap<>();
                }
                dmaap.init(new Dmaap("0", "", "", "", "", "", "", ""));
-               // check for, and set up initial data, if it isn't already there
+               // force initial read from DB, if it exists
+               @SuppressWarnings("unused")
                Dmaap dmx = dmaap.get();
-               if ("0".equals(dmx.getVersion())) {
-
-                       dmx = new Dmaap("0", "", "", "", "", "", "", "");
-                       dmx.setDmaapName(p.getProperty("DmaapName"));
-                       dmx.setDrProvUrl("https://" + p.getProperty("DR.provhost", "notSet"));
-                       dmx.setTopicNsRoot(p.getProperty("topicNsRoot"));
-                       dmx.setBridgeAdminTopic("DCAE_MM_AGENT");
+               
+               // old code in this spot would read from properties file as part of init.
+               // but all those properties are now set via /dmaap API
 
-                       dmaap.update(dmx);
-               }
                } catch (Exception e) {
                        errorLogger.error("Error", e);
                        errorLogger.error(DmaapbcLogMessageEnum.DB_UPDATE_ERROR, e.getMessage());
                }
+
        }
        
        public static synchronized String getNextClientId() {