From 0ed42c9444c93af51f06a22ee077e38a1264551b Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Wed, 10 Oct 2018 12:10:17 +0530 Subject: 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 --- .../onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'adapters/mso-catalog-db-adapter') 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); -- cgit 1.2.3-korg