summaryrefslogtreecommitdiffstats
path: root/dcaedt_catalog/service
diff options
context:
space:
mode:
authorStone, Avi (as206k) <as206k@att.com>2018-05-24 16:12:32 +0300
committerStone, Avi (as206k) <as206k@att.com>2018-05-24 16:12:32 +0300
commit1a0189f890e4ff65ee245be9b7ef67788ac53a61 (patch)
tree15c269d48d03ef35770763169bd85f4cf31398c0 /dcaedt_catalog/service
parentcd0441658018dfbab0950f959c9b718ad9601f6d (diff)
Update code
Update to latest version after improving testing and sonar coverage Change-Id: I527f4bc38d3b4e1005d38e3a2584fa730857425d Issue-ID: SDC-1313 Signed-off-by: Stone, Avi (as206k) <as206k@att.com>
Diffstat (limited to 'dcaedt_catalog/service')
-rw-r--r--dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogController.java9
-rw-r--r--dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogError.java3
-rw-r--r--dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogRequest.java2
3 files changed, 4 insertions, 10 deletions
diff --git a/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogController.java b/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogController.java
index 90994f6..b42f8cf 100644
--- a/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogController.java
+++ b/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogController.java
@@ -21,7 +21,6 @@ package org.onap.sdc.dcae.catalog.engine;
import org.json.JSONObject;
import org.onap.sdc.common.onaplog.Enums.LogLevel;
import org.onap.sdc.common.onaplog.OnapLoggerDebug;
-import org.onap.sdc.common.onaplog.OnapLoggerError;
import org.onap.sdc.dcae.catalog.Catalog;
import org.onap.sdc.dcae.catalog.asdc.ASDCCatalog;
import org.onap.sdc.dcae.catalog.commons.Future;
@@ -93,7 +92,6 @@ import java.util.Map;
@CrossOrigin(origins="*")
public class CatalogController {
- private static OnapLoggerError errLogger = OnapLoggerError.getInstance();
private static OnapLoggerDebug debugLogger = OnapLoggerDebug.getInstance();
@@ -101,7 +99,7 @@ public class CatalogController {
private SystemProperties systemProperties;
private URI defaultCatalog;
- private static Map<URI, Catalog> catalogs = new HashMap<URI, Catalog>();
+ private static Map<URI, Catalog> catalogs = new HashMap<>();
public void setDefaultCatalog(URI theUri) {
@@ -130,8 +128,9 @@ public class CatalogController {
public Catalog getCatalog(URI theCatalogUri) {
//TODO: Thread safety! Check catalog is alive!
- if (theCatalogUri == null)
+ if (theCatalogUri == null) {
theCatalogUri = this.defaultCatalog;
+ }
Catalog cat = catalogs.get(theCatalogUri);
if (cat == null && theCatalogUri != null) {
@@ -194,7 +193,7 @@ public class CatalogController {
//a null result allows the accumulatorHandler to pass the processing onto some other async processing stage
if (response != null) {
if (!this.result.setResult(response)) {
- this.result.setErrorResult(new CatalogError(this.request, "Catalog API call succesful but late"));
+ this.result.setErrorResult(new CatalogError(this.request, "Catalog API call successful but late"));
}
}
}
diff --git a/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogError.java b/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogError.java
index 0c7c418..8518b0d 100644
--- a/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogError.java
+++ b/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogError.java
@@ -1,8 +1,5 @@
package org.onap.sdc.dcae.catalog.engine;
-import org.onap.sdc.dcae.catalog.engine.CatalogRequest;
-import org.onap.sdc.dcae.catalog.engine.CatalogResponse;
-
/**
*/
public class CatalogError extends CatalogResponse {
diff --git a/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogRequest.java b/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogRequest.java
index ad6caca..3fde208 100644
--- a/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogRequest.java
+++ b/dcaedt_catalog/service/src/main/java/org/onap/sdc/dcae/catalog/engine/CatalogRequest.java
@@ -2,8 +2,6 @@ package org.onap.sdc.dcae.catalog.engine;
import java.net.URI;
-import org.onap.sdc.dcae.catalog.engine.CatalogMessage;
-
public class CatalogRequest extends CatalogMessage {
private URI catalog;