Improved logging,error handling-VM capabilities
[appc.git] / appc-config / appc-data-services / provider / src / main / java / org / onap / appc / data / services / node / ConfigResourceNode.java
index a9d3dbb..30fcbbd 100644 (file)
@@ -748,6 +748,12 @@ public class ConfigResourceNode implements SvcLogicJavaPlugin {
         }
 
         String vnfcFunctionCode = getVnfcFunctionCodeForVserver(ctx, vServerId);
+        if (StringUtils.isBlank(vnfcFunctionCode)) {
+            log.info("processCapabilitiesForVMLevel() :: vnfcFunctionCode is not present in context!!!");
+            ctx.setAttribute("capabilities", "Not-Supported");
+            return;
+        }
+
         if (vmCaps.toString().contains(vnfcFunctionCode))
             ctx.setAttribute("capabilities", "Supported");
         else
@@ -756,9 +762,15 @@ public class ConfigResourceNode implements SvcLogicJavaPlugin {
     }
 
     private String getVnfcFunctionCodeForVserver(SvcLogicContext ctx, String vServerId) throws Exception {
-        log.debug("getVnfcFunctionCodeForVserver()::vServerId=" + vServerId);
+        log.info("getVnfcFunctionCodeForVserver()::vServerId=" + vServerId);
+        for (Object key : ctx.getAttributeKeySet()) {
+            String parmName = (String) key;
+            String parmValue = ctx.getAttribute(parmName);
+            log.info(parmName +  "="  + parmValue);
+
+        }
         String vnfcFunctionCode = ctx.getAttribute("tmp.vnfInfo.vm.vnfc.vnfc-function-code");
-        log.debug("getVnfcFunctionCodeForVserver()::vnfcFunctionCode=" + vnfcFunctionCode);
+        log.info("getVnfcFunctionCodeForVserver()::vnfcFunctionCode=" + vnfcFunctionCode);
         return vnfcFunctionCode;
     }