aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-10-10 12:10:17 +0530
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-10-16 19:30:14 +0530
commit0ed42c9444c93af51f06a22ee077e38a1264551b (patch)
tree867ecbe422d5701f6bf0ecf87861bb1a9c71ab55 /adapters/mso-catalog-db-adapter
parent62363588df24c40fe40e77f52ab00c3b23e62497 (diff)
Prepare resources for service uuid req
Retrieve all the resource for queried service uuid. Change-Id: If2beaa27570821c9897387d3b7098a939d99c895 Issue-ID: SO-689 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'adapters/mso-catalog-db-adapter')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
index 5cd2559ef2..eaf3e125a1 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
@@ -340,14 +340,21 @@ public class CatalogDbAdapterRest {
uuid = modelUUID;
logger.debug ("Query serviceMacroHolder getAllResourcesByServiceModelUuid serviceModelUuid: {}" , uuid);
Service serv =serviceRepo.findOneByModelUUID(uuid);
- ret.setService(serv);
+
+ if (serv != null) {
+ ret.setNetworkResourceCustomizations(new ArrayList(serv.getNetworkCustomizations()));
+ ret.setVnfResourceCustomizations(new ArrayList(serv.getVnfCustomizations()));
+ ret.setAllottedResourceCustomizations(new ArrayList(serv.getAllottedCustomizations()));
+ }
+ ret.setService(serv);
}
else if (modelInvariantUUID != null && !"".equals(modelInvariantUUID)) {
uuid = modelInvariantUUID;
if (modelVersion != null && !"".equals(modelVersion)) {
logger.debug ("Query serviceMacroHolder getAllResourcesByServiceModelInvariantUuid serviceModelInvariantUuid: {} serviceModelVersion: {}",uuid, modelVersion);
Service serv = serviceRepo.findFirstByModelVersionAndModelInvariantUUID(modelVersion, uuid);
- ret.setService(serv);
+
+ ret.setService(serv);
}
else {
logger.debug ("Query serviceMacroHolder getAllResourcesByServiceModelInvariantUuid serviceModelUuid: {}" , uuid);