From: Bonkur, Venkat (vb8416) Date: Thu, 1 Aug 2019 17:11:23 +0000 (-0400) Subject: Add SO Update to default the controller type query as "APPC" instead of null. X-Git-Tag: 1.5.2~11^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F91%2F92491%2F2;p=so.git 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 --- 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;