Add SO Update to default the controller type query as "APPC" instead of null. 91/92491/2
authorBonkur, Venkat (vb8416) <vb8416@att.com>
Thu, 1 Aug 2019 17:11:23 +0000 (13:11 -0400)
committerVenkat Bonkur <vb8416@att.com>
Thu, 1 Aug 2019 17:29:54 +0000 (17:29 +0000)
Make a change to treat a return of null from a controller type query as "APPC"
This can avoid the nullpointer Exception and the default is set
to APPC if the entry is missing in the controller_selection_reference table.
Issue-ID: SO-2170
Signed-off-by: Bonkur, Venkat (vb8416) <vb8416@att.com>
Change-Id: Ia76b2d06e4dacb8b7f6984edeb4d2758472192b1

bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java

index eddcc94..4379054 100644 (file)
@@ -51,6 +51,7 @@ public class AppcRunTasks {
     public static final String ROLLBACK_VNF_STOP = "rollbackVnfStop";
     public static final String ROLLBACK_VNF_LOCK = "rollbackVnfLock";
     public static final String ROLLBACK_QUIESCE_TRAFFIC = "rollbackQuiesceTraffic";
+    public static final String CONTROLLER_TYPE_DEFAULT = "APPC";
     @Autowired
     private ExceptionBuilder exceptionUtil;
     @Autowired
@@ -112,7 +113,12 @@ public class AppcRunTasks {
 
             ControllerSelectionReference controllerSelectionReference = catalogDbClient
                     .getControllerSelectionReferenceByVnfTypeAndActionCategory(vnfType, action.toString());
-            String controllerType = controllerSelectionReference.getControllerName();
+            String controllerType = null;
+            if (controllerSelectionReference != null) {
+                controllerType = controllerSelectionReference.getControllerName();
+            } else {
+                controllerType = CONTROLLER_TYPE_DEFAULT;
+            }
 
             String vfModuleId = null;
             VfModule vfModule = null;