X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdbcapi%2Fdatabase%2FDatabaseClass.java;h=b4044793b22d5c204d48b42b8d0ca0f12e44b5de;hb=fadc30b0be7a0bd75839f1dd859eadfc1cfe24f0;hp=11b0d15aa8885506401fdcd520f069669388c89f;hpb=c9e41d4dabcfcf300bfd482d5c157dcc7213cbd4;p=dmaap%2Fdbcapi.git diff --git a/src/main/java/org/onap/dmaap/dbcapi/database/DatabaseClass.java b/src/main/java/org/onap/dmaap/dbcapi/database/DatabaseClass.java index 11b0d15..b404479 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/database/DatabaseClass.java +++ b/src/main/java/org/onap/dmaap/dbcapi/database/DatabaseClass.java @@ -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 rv = new ArrayList(); + List 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() {