log.info(fn + "download_config_dg::" + downloadConfigDg);
return downloadConfigDg;
}
+
+ public void cleanUpVnfcReferencesForVnf(SvcLogicContext context) throws SvcLogicException {
+ String key1 = "delete from " + SdcArtifactHandlerConstants.DB_VNFC_REFERENCE
+ + " where action = 'Configure' and vnf_type = $" + SdcArtifactHandlerConstants.VNF_TYPE;
+ QueryStatus status = null;
+ log.info("cleanUpVnfcReferencesForVnf()::Query:" + key1);
+ if (serviceLogic != null && context != null) {
+ status = serviceLogic.save("SQL", false, false, key1, null, null, context);
+ if (status.toString().equals("FAILURE")) {
+ log.debug("Error deleting from VNFC_REFERENCE table");
+ throw new SvcLogicException("Error While processing VNFC_REFERENCE table ");
+ }
+ }
+ }
+
+
}
if (content.has(SdcArtifactHandlerConstants.VM)
&& content.get(SdcArtifactHandlerConstants.VM) instanceof JSONArray) {
JSONArray vmList = (JSONArray) content.get(SdcArtifactHandlerConstants.VM);
+ dbservice.cleanUpVnfcReferencesForVnf(context);
for (int i = 0; i < vmList.length(); i++) {
JSONObject vmInstance = (JSONObject) vmList.get(i);
context.setAttribute(SdcArtifactHandlerConstants.VM_INSTANCE,
if (vnfcInstance.has(SdcArtifactHandlerConstants.GROUP_NOTATION_VALUE))
context.setAttribute(SdcArtifactHandlerConstants.GROUP_NOTATION_VALUE,
vnfcInstance.getString(SdcArtifactHandlerConstants.GROUP_NOTATION_VALUE));
- dbservice.processVnfcReference(context, dbservice.isArtifactUpdateRequired(context,
- SdcArtifactHandlerConstants.DB_VNFC_REFERENCE));
+ if (content.getString(SdcArtifactHandlerConstants.ACTION).equals("Configure")) {
+ dbservice.processVnfcReference(context,false);
+ }
cleanVnfcInstance(context);
}
context.setAttribute(SdcArtifactHandlerConstants.VM_INSTANCE, null);