From 79a0dd38e0d1150e734d04e5ab999764a655af34 Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Thu, 17 May 2018 08:52:36 +0000 Subject: Fix resource population to DB Fix resource population to DB. Change-Id: Iae25ce2f15fa121a45a55559458fcbbd217f2c7d Issue-ID: SO-624 Signed-off-by: subhash kumar singh --- .../installer/heat/ToscaResourceInstaller.java | 43 ++++++++++++++-------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'asdc-controller/src/main/java/org') diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java index fc4e522877..a8c67fd96e 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java @@ -596,23 +596,34 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller { List allottedResourceList = toscaResourceStruct.getSdcCsarHelper().getAllottedResources(); - if(allottedResourceList != null){ - - for(NodeTemplate allottedNode : allottedResourceList){ - - createAllottedResource(allottedNode, toscaResourceStruct); - - catalogDB.saveAllottedResource(toscaResourceStruct.getAllottedResource()); - - catalogDB.saveAllottedResourceCustomization(toscaResourceStruct.getCatalogAllottedResourceCustomization()); - - catalogDB.saveServiceToResourceCustomization(toscaResourceStruct.getCatalogAllottedServiceToResourceCustomization()); - - } - } - + if(allottedResourceList != null){ + + for(NodeTemplate allottedNode : allottedResourceList){ + + createAllottedResource(allottedNode, toscaResourceStruct); + + catalogDB.saveAllottedResource(toscaResourceStruct.getAllottedResource()); + + catalogDB.saveAllottedResourceCustomization(toscaResourceStruct.getCatalogAllottedResourceCustomization()); + + catalogDB.saveServiceToResourceCustomization(toscaResourceStruct.getCatalogAllottedServiceToResourceCustomization()); + + } + } + + // handle VF resource + List serviceVfList = toscaResourceStruct.getSdcCsarHelper().getServiceVfList(); + if (serviceVfList != null) { + for (NodeTemplate vfNode : serviceVfList) { + createVnfResource(vfNode, toscaResourceStruct); + catalogDB.saveVnfResource(toscaResourceStruct.getCatalogVnfResource()); + catalogDB.saveVnfResourceCustomization(toscaResourceStruct.getCatalogVnfResourceCustomization()); + catalogDB.saveServiceToResourceCustomization(toscaResourceStruct.getCatalogVfServiceToResourceCustomization()); + } + } + - List nodeTemplatesVLList = toscaResourceStruct.getSdcCsarHelper().getServiceVlList(); + List nodeTemplatesVLList = toscaResourceStruct.getSdcCsarHelper().getServiceVlList(); if(nodeTemplatesVLList != null){ -- cgit 1.2.3-korg