From 31abb56177f3ceab2b49f9752c658b9e8aa42d43 Mon Sep 17 00:00:00 2001 From: "Bonkur, Venkat (vb8416)" Date: Thu, 1 Aug 2019 13:11:23 -0400 Subject: Add SO Update to default the controller type query as "APPC" instead of null. 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) Change-Id: Ia76b2d06e4dacb8b7f6984edeb4d2758472192b1 --- .../org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bpmn') diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java index eddcc94e71..43790544bf 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java @@ -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; -- cgit 1.2.3-korg