Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / controller / MsoController.java
index 1ce1d64..716267a 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,14 +22,18 @@ package org.onap.vid.controller;
 
 
 import com.fasterxml.jackson.databind.ObjectMapper;
+import org.onap.portalsdk.core.controller.RestrictedBaseController;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.vid.model.ExceptionResponse;
+import org.onap.vid.model.SoftDeleteRequest;
 import org.onap.vid.mso.MsoBusinessLogic;
 import org.onap.vid.mso.MsoResponseWrapper;
+import org.onap.vid.mso.MsoResponseWrapper2;
 import org.onap.vid.mso.rest.Request;
 import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.RequestDetailsWrapper;
 import org.onap.vid.mso.rest.Task;
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.services.CloudOwnerService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -38,16 +42,10 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.util.LinkedHashMap;
 import java.util.List;
 
-//import java.util.UUID;
-//import org.springframework.http.ResponseEntity;
-//import org.springframework.http.RequestEntity;
+import static org.onap.vid.utils.Logging.getMethodName;
 
 /**
  * The Class MsoController.
@@ -61,32 +59,30 @@ public class MsoController extends RestrictedBaseController {
      */
     private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(MsoController.class);
 
-    /**
-     * The Constant dateFormat.
-     */
-    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
     /**
      * The Constant SVC_INSTANCE_ID.
      */
-    public final static String SVC_INSTANCE_ID = "<service_instance_id>";
-    public final static String REQUEST_TYPE = "<request_type>";
+    public static final String SVC_INSTANCE_ID = "<service_instance_id>";
+    public static final String REQUEST_TYPE = "<request_type>";
 
     /**
      * The Constant CONFIGURATION_ID
      */
-    public final static String CONFIGURATION_ID = "<configuration_id>";
+    public static final String CONFIGURATION_ID = "<configuration_id>";
 
     /**
      * The Constant VNF_INSTANCE_ID.
      */
-    public final static String VNF_INSTANCE_ID = "<vnf_instance_id>";
+    public static final String VNF_INSTANCE_ID = "<vnf_instance_id>";
+    public static final String START_LOG = " start";
 
     private final MsoBusinessLogic msoBusinessLogic;
+    private final CloudOwnerService cloudOwnerService;
 
     @Autowired
-    public MsoController(MsoBusinessLogic msoBusinessLogic) {
+    public MsoController(MsoBusinessLogic msoBusinessLogic, CloudOwnerService cloudOwnerService) {
         this.msoBusinessLogic = msoBusinessLogic;
+        this.cloudOwnerService = cloudOwnerService;
     }
 
     /**
@@ -97,14 +93,37 @@ public class MsoController extends RestrictedBaseController {
      * @throws Exception the exception
      */
     @RequestMapping(value = "/mso_create_svc_instance", method = RequestMethod.POST)
-    public ResponseEntity<String> createSvcInstance(HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+    public ResponseEntity<String> createSvcInstance(HttpServletRequest request, @RequestBody RequestDetails msoRequest) {
         String methodName = "createSvcInstance";
 
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
         // always return OK, the MSO status code is embedded in the body
 
-        MsoResponseWrapper w = msoBusinessLogic.createSvcInstance(mso_request);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.createSvcInstance(msoRequest);
+
+        return (new ResponseEntity<>(w.getResponse(), HttpStatus.OK));
+
+    }
+
+    /**
+     * Creates the e2e svc instance.
+     *
+     * @param request the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_create_e2e_svc_instance", method = RequestMethod.POST)
+    public ResponseEntity<String> createE2eSvcInstance(HttpServletRequest request, @RequestBody LinkedHashMap<String, Object> msoRequest) {
+        String methodName = "createE2eSvcInstance";
+
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
+
+        // always return OK, the MSO status code is embedded in the body
+
+        //cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.createE2eSvcInstance(msoRequest.get("requestDetails"));
 
         return (new ResponseEntity<>(w.getResponse(), HttpStatus.OK));
 
@@ -119,9 +138,10 @@ public class MsoController extends RestrictedBaseController {
      * @throws Exception the exception
      */
     @RequestMapping(value = "/mso_create_vnf_instance/{serviceInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> createVnf(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+    public ResponseEntity<String> createVnf(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails msoRequest) {
 
-        MsoResponseWrapper w = msoBusinessLogic.createVnf(mso_request, serviceInstanceId);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.createVnf(msoRequest, serviceInstanceId);
 
         // always return OK, the MSO status code is embedded in the body
 
@@ -138,11 +158,12 @@ public class MsoController extends RestrictedBaseController {
      * @throws Exception the exception
      */
     @RequestMapping(value = "/mso_create_nw_instance/{serviceInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> createNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+    public ResponseEntity<String> createNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails msoRequest) {
         String methodName = "createNwInstance";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start, serviceInstanceId = " + serviceInstanceId);
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + " start, serviceInstanceId = " + serviceInstanceId);
 
-        MsoResponseWrapper w = msoBusinessLogic.createNwInstance(mso_request, serviceInstanceId);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.createNwInstance(msoRequest, serviceInstanceId);
 
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
 
@@ -159,11 +180,12 @@ public class MsoController extends RestrictedBaseController {
      */
     @RequestMapping(value = "/mso_create_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
     public ResponseEntity<String> createVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
-                                                            HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+                                                            HttpServletRequest request, @RequestBody RequestDetails msoRequest) {
         String methodName = "createVolumeGroupInstance";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
-        MsoResponseWrapper w = msoBusinessLogic.createVolumeGroupInstance(mso_request, serviceInstanceId, vnfInstanceId);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.createVolumeGroupInstance(msoRequest, serviceInstanceId, vnfInstanceId);
 
         // always return OK, the MSO status code is embedded in the body
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
@@ -180,12 +202,13 @@ public class MsoController extends RestrictedBaseController {
      */
     @RequestMapping(value = "/mso_create_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
     public ResponseEntity<String> createVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-                                                         @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+                                                         @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request, @RequestBody RequestDetails msoRequest) {
         String methodName = "createVfModuleInstance";
 
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
-        MsoResponseWrapper w = msoBusinessLogic.createVfModuleInstance(mso_request, serviceInstanceId, vnfInstanceId);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.createVfModuleInstance(msoRequest, serviceInstanceId, vnfInstanceId);
 
         // always return OK, the MSO status code is embedded in the body
 
@@ -202,41 +225,59 @@ public class MsoController extends RestrictedBaseController {
      */
     @RequestMapping(value = "/mso_create_configuration_instance/{serviceInstanceId}/configurations/", method = RequestMethod.POST)
     public ResponseEntity<String> createConfigurationInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-                                                         HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+                                                              HttpServletRequest request, @RequestBody RequestDetailsWrapper msoRequest) {
         String methodName = "createConfigurationInstance";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
-        MsoResponseWrapper w = msoBusinessLogic.createConfigurationInstance(mso_request, serviceInstanceId);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest.getRequestDetails());
+        MsoResponseWrapper w = msoBusinessLogic.createConfigurationInstance(msoRequest, serviceInstanceId);
 
         // always return OK, the MSO status code is embedded in the body
 
         return (new ResponseEntity<>(w.getResponse(), HttpStatus.OK));
     }
 
-       /**
-     * Delete svc instance.
+    /**
+     * Delete E2e svc instance.
      *
      * @param serviceInstanceId the service instance id
      * @param request           the request
      * @return the response entity
      * @throws Exception the exception
      */
-    @RequestMapping(value = "/mso_delete_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> deleteSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-                                                    HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-
-        String methodName = "deleteSvcInstance";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+    @RequestMapping(value = "/mso_delete_e2e_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteE2eSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+                                                       HttpServletRequest request, @RequestBody LinkedHashMap<String, Object> msoRequest) {
 
-        MsoResponseWrapper w = msoBusinessLogic.deleteSvcInstance(mso_request, serviceInstanceId);
-
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName(), msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.deleteE2eSvcInstance(msoRequest.get("requestDetails"), serviceInstanceId);
         // always return OK, the MSO status code is embedded in the body
 
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
 
     }
 
+    /**
+     * Delete svc instance.
+     *
+     * @param serviceInstanceId the service instance id
+     * @param request           the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+
+    @RequestMapping(value = "/mso_delete_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
+    public String deleteSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+                                    HttpServletRequest request, @RequestBody RequestDetails msoRequest,
+                                    @RequestParam(value = "serviceStatus") String serviceStatus) {
+
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName(), msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.deleteSvcInstance(msoRequest, serviceInstanceId, serviceStatus);
+        // always return OK, the MSO status code is embedded in the body
+
+        return w.getResponse();
+    }
+
     /**
      * Delete vnf.
      *
@@ -249,12 +290,12 @@ public class MsoController extends RestrictedBaseController {
     @RequestMapping(value = "/mso_delete_vnf_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
 
     public ResponseEntity<String> deleteVnf(@PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
-                                            HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+                                            HttpServletRequest request, @RequestBody RequestDetails msoRequest) {
         String methodName = "deleteVnf";
 
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoResponseWrapper w = msoBusinessLogic.deleteVnf(mso_request, serviceInstanceId, vnfInstanceId);
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.deleteVnf(msoRequest, serviceInstanceId, vnfInstanceId);
 
         // always return OK, the MSO status code is embedded in the body
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
@@ -265,7 +306,7 @@ public class MsoController extends RestrictedBaseController {
      * Delete configuration instance
      * @param serviceInstanceId the service instance id
      * @param configurationId the configuration id
-     * @param mso_request the request
+     * @param msoRequest the request
      * @return the response entity
      * @throws Exception the exception
      */
@@ -274,13 +315,14 @@ public class MsoController extends RestrictedBaseController {
     public ResponseEntity<String> deleteConfiguration(
             @PathVariable("serviceInstanceId") String serviceInstanceId,
             @PathVariable ("configurationId") String configurationId,
-            @RequestBody RequestDetails mso_request) throws Exception {
+            @RequestBody RequestDetailsWrapper msoRequest) {
 
         String methodName = "deleteConfiguration";
         LOGGER.debug(EELFLoggerDelegate.debugLogger,
-                dateFormat.format(new Date()) + "<== " + methodName + " start");
+                "<== " + methodName + START_LOG);
 
-        MsoResponseWrapper w = msoBusinessLogic.deleteConfiguration(mso_request, serviceInstanceId, configurationId);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest.getRequestDetails());
+        MsoResponseWrapper w = msoBusinessLogic.deleteConfiguration(msoRequest, serviceInstanceId, configurationId);
 
         // always return OK, the MSO status code is embedded in the body
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
@@ -290,7 +332,7 @@ public class MsoController extends RestrictedBaseController {
      * Activate configuration instance
      * @param serviceInstanceId the service instace id
      * @param configurationId the configuration id
-     * @param mso_request the request
+     * @param msoRequest the request
      * @return the response entity
      * @throws Exception the exception
      */
@@ -299,9 +341,10 @@ public class MsoController extends RestrictedBaseController {
     public ResponseEntity<String> activateConfiguration(
             @PathVariable("serviceInstanceId") String serviceInstanceId,
             @PathVariable("configurationId") String configurationId,
-            @RequestBody RequestDetails mso_request) throws Exception {
+            @RequestBody RequestDetails msoRequest) {
 
-        MsoResponseWrapper w = msoBusinessLogic.setConfigurationActiveStatus(mso_request, serviceInstanceId, configurationId, true);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.setConfigurationActiveStatus(msoRequest, serviceInstanceId, configurationId, true);
 
         // always return OK, the MSO status code is embedded in the body
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
@@ -311,7 +354,7 @@ public class MsoController extends RestrictedBaseController {
      * Deactivate configuration instance
      * @param serviceInstanceId the service instace id
      * @param configurationId the configuration id
-     * @param mso_request the request
+     * @param msoRequest the request
      * @return the response entity
      * @throws Exception the exception
      */
@@ -320,9 +363,10 @@ public class MsoController extends RestrictedBaseController {
     public ResponseEntity<String> deactivateConfiguration(
             @PathVariable("serviceInstanceId") String serviceInstanceId,
             @PathVariable("configurationId") String configurationId,
-            @RequestBody RequestDetails mso_request) throws Exception {
+            @RequestBody RequestDetails msoRequest) {
 
-        MsoResponseWrapper w = msoBusinessLogic.setConfigurationActiveStatus(mso_request, serviceInstanceId, configurationId, false);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.setConfigurationActiveStatus(msoRequest, serviceInstanceId, configurationId, false);
 
         // always return OK, the MSO status code is embedded in the body
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
@@ -332,7 +376,7 @@ public class MsoController extends RestrictedBaseController {
      * Disable port on configuration instance
      * @param serviceInstanceId the service instance id
      * @param configurationId the configuration instance id
-     * @param mso_request the request
+     * @param msoRequest the request
      * @return the response entity
      * @throws Exception the exception
      */
@@ -341,9 +385,10 @@ public class MsoController extends RestrictedBaseController {
     public ResponseEntity<String> disablePortOnConfiguration(
             @PathVariable("serviceInstanceId") String serviceInstanceId,
             @PathVariable("configurationId") String configurationId,
-            @RequestBody RequestDetails mso_request) throws Exception {
+            @RequestBody RequestDetails msoRequest) {
 
-        MsoResponseWrapper w = msoBusinessLogic.setPortOnConfigurationStatus(mso_request, serviceInstanceId, configurationId, false);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.setPortOnConfigurationStatus(msoRequest, serviceInstanceId, configurationId, false);
 
         // always return OK, the MSO status code is embedded in the body
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
@@ -353,7 +398,7 @@ public class MsoController extends RestrictedBaseController {
      * Enable port on configuration instance
      * @param serviceInstanceId the service instance id
      * @param configurationId the configuration instance id
-     * @param mso_request the request
+     * @param msoRequest the request
      * @return the response entity
      * @throws Exception the exception
      */
@@ -362,9 +407,10 @@ public class MsoController extends RestrictedBaseController {
     public ResponseEntity<String> enablePortOnConfiguration(
             @PathVariable("serviceInstanceId") String serviceInstanceId,
             @PathVariable("configurationId") String configurationId,
-            @RequestBody RequestDetails mso_request) throws Exception {
+            @RequestBody RequestDetails msoRequest) {
 
-        MsoResponseWrapper w = msoBusinessLogic.setPortOnConfigurationStatus(mso_request, serviceInstanceId, configurationId, true);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.setPortOnConfigurationStatus(msoRequest, serviceInstanceId, configurationId, true);
 
         // always return OK, the MSO status code is embedded in the body
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
@@ -384,16 +430,16 @@ public class MsoController extends RestrictedBaseController {
     @RequestMapping(value = "/mso_delete_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfModuleId}", method = RequestMethod.POST)
     public ResponseEntity<String> deleteVfModule(
             @PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
-            @PathVariable("vfModuleId") String vfModuleId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+            @PathVariable("vfModuleId") String vfModuleId, HttpServletRequest request, @RequestBody RequestDetails msoRequest) {
 
         String methodName = "deleteVfModule";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
-        MsoResponseWrapper w = msoBusinessLogic.deleteVfModule(mso_request, serviceInstanceId, vnfInstanceId, vfModuleId);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.deleteVfModule(msoRequest, serviceInstanceId, vnfInstanceId, vfModuleId);
 
         // always return OK, the MSO status code is embedded in the body
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
     }
 
     /**
@@ -409,11 +455,12 @@ public class MsoController extends RestrictedBaseController {
     @RequestMapping(value = "/mso_delete_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupId}", method = RequestMethod.POST)
     public ResponseEntity<String> deleteVolumeGroupInstance(
             @PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId, @PathVariable("volumeGroupId") String volumeGroupId,
-            HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+            HttpServletRequest request, @RequestBody RequestDetails msoRequest) {
         String methodName = "deleteVolumeGroupInstance";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
-        MsoResponseWrapper w = msoBusinessLogic.deleteVolumeGroupInstance(mso_request, serviceInstanceId, vnfInstanceId, volumeGroupId);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.deleteVolumeGroupInstance(msoRequest, serviceInstanceId, vnfInstanceId, volumeGroupId);
 
         // always return OK, the MSO status code is embedded in the body
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
@@ -430,15 +477,15 @@ public class MsoController extends RestrictedBaseController {
      */
     @RequestMapping(value = "/mso_delete_nw_instance/{serviceInstanceId}/networks/{networkInstanceId}", method = RequestMethod.POST)
     public ResponseEntity<String> deleteNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-                                                   @PathVariable("networkInstanceId") String networkInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+                                                   @PathVariable("networkInstanceId") String networkInstanceId, HttpServletRequest request, @RequestBody RequestDetails msoRequest) {
         String methodName = "deleteNwInstance";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
-        MsoResponseWrapper w = msoBusinessLogic.deleteNwInstance(mso_request, serviceInstanceId, networkInstanceId);
+        cloudOwnerService.enrichRequestWithCloudOwner(msoRequest);
+        MsoResponseWrapper w = msoBusinessLogic.deleteNwInstance(msoRequest, serviceInstanceId, networkInstanceId);
 
         // always return OK, the MSO status code is embedded in the body
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
     }
 
     /**
@@ -451,10 +498,10 @@ public class MsoController extends RestrictedBaseController {
      */
     @RequestMapping(value = "/mso_get_orch_req/{requestId}", method = RequestMethod.GET)
     public ResponseEntity<String> getOrchestrationRequest(@PathVariable("requestId") String requestId,
-                                                          HttpServletRequest request) throws Exception {
+                                                          HttpServletRequest request) {
 
         String methodName = "getOrchestrationRequest";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
 
         MsoResponseWrapper w = msoBusinessLogic.getOrchestrationRequest(requestId);
@@ -463,7 +510,6 @@ public class MsoController extends RestrictedBaseController {
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
     }
 
-
     /**
      * Gets the orchestration requests.
      *
@@ -474,10 +520,10 @@ public class MsoController extends RestrictedBaseController {
      */
     @RequestMapping(value = "/mso_get_orch_reqs/{filterString}", method = RequestMethod.GET)
     public ResponseEntity<String> getOrchestrationRequests(@PathVariable("filterString") String filterString,
-                                                           HttpServletRequest request) throws Exception {
+                                                           HttpServletRequest request) {
 
         String methodName = "getOrchestrationRequests";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
 
         MsoResponseWrapper w = msoBusinessLogic.getOrchestrationRequests(filterString);
@@ -486,7 +532,6 @@ public class MsoController extends RestrictedBaseController {
         return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
     }
 
-
     /**
      * activate to a pnf instance.
      *
@@ -496,9 +541,9 @@ public class MsoController extends RestrictedBaseController {
      * @throws Exception the exception
      */
     @RequestMapping(value = "/mso_activate_service_instance/{serviceInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> activateServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @RequestBody RequestDetails requestDetails) throws Exception {
+    public ResponseEntity<String> activateServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @RequestBody RequestDetails requestDetails) {
         String methodName = "activateServiceInstance";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
         MsoResponseWrapper w = msoBusinessLogic.setServiceInstanceStatus(requestDetails, serviceInstanceId, true);
         return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
@@ -513,15 +558,14 @@ public class MsoController extends RestrictedBaseController {
      * @throws Exception the exception
      */
     @RequestMapping(value = "/mso_deactivate_service_instance/{serviceInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> deactivateServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @RequestBody RequestDetails requestDetails) throws Exception {
+    public ResponseEntity<String> deactivateServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @RequestBody RequestDetails requestDetails) {
         String methodName = "deactivateServiceInstance";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
         MsoResponseWrapper w = msoBusinessLogic.setServiceInstanceStatus(requestDetails, serviceInstanceId, false);
         return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
     }
 
-
     /**
      * Gets the orchestration requests for the dashboard.
      *  currently its all the orchestration requests with RequestType updateInstance or replaceInstance.
@@ -529,10 +573,10 @@ public class MsoController extends RestrictedBaseController {
      * @throws Exception the exception
      */
     @RequestMapping(value = "/mso_get_orch_reqs/dashboard", method = RequestMethod.GET)
-    public List<Request> getOrchestrationRequestsForDashboard() throws Exception {
+    public List<Request> getOrchestrationRequestsForDashboard() {
 
         String methodName = "getOrchestrationRequestsForDashboard";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
 
         return msoBusinessLogic.getOrchestrationRequestsForDashboard();
@@ -546,16 +590,14 @@ public class MsoController extends RestrictedBaseController {
      * @throws Exception the exception
      */
     @RequestMapping(value = "/mso_get_man_task/{originalRequestId}", method = RequestMethod.GET)
-    public List<Task> getManualTasksByRequestId(@PathVariable("originalRequestId") String originalRequestId) throws Exception {
+    public List<Task> getManualTasksByRequestId(@PathVariable("originalRequestId") String originalRequestId) {
 
         String methodName = "getManualTasksByRequestId";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
         return  msoBusinessLogic.getManualTasksByRequestId(originalRequestId);
     }
 
-
-
     /**
      * Complete the manual task.
      *
@@ -565,21 +607,21 @@ public class MsoController extends RestrictedBaseController {
      * @throws Exception the exception
      */
     @RequestMapping(value = "/mso_post_man_task/{taskId}", method = RequestMethod.POST)
-    public ResponseEntity<String> manualTaskComplete(@PathVariable("taskId") String taskId , @RequestBody RequestDetails requestDetails) throws Exception {
+    public ResponseEntity<String> manualTaskComplete(@PathVariable("taskId") String taskId , @RequestBody RequestDetails requestDetails) {
 
         String methodName = "manualTaskComplete";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
         MsoResponseWrapper w = msoBusinessLogic.completeManualTask(requestDetails, taskId);
-        return new ResponseEntity<String>(w.getResponse(), HttpStatus.OK);
+        return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
     }
 
     @RequestMapping(value = "/mso_remove_relationship/{serviceInstanceId}", method = RequestMethod.POST)
     public ResponseEntity<String> removeRelationshipFromServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId ,
-                                                                        @RequestBody RequestDetails requestDetails) throws Exception {
+                                                                        @RequestBody RequestDetails requestDetails) {
 
         String methodName = "removeRelationshipFromServiceInstance";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
         MsoResponseWrapper w;
         try {
@@ -593,10 +635,10 @@ public class MsoController extends RestrictedBaseController {
 
     @RequestMapping(value = "/mso_add_relationship/{serviceInstanceId}", method = RequestMethod.POST)
     public ResponseEntity<String> addRelationshipToServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId ,
-                                                                        @RequestBody RequestDetails requestDetails) throws Exception {
+                                                                   @RequestBody RequestDetails requestDetails) {
 
         String methodName = "addRelationshipToServiceInstance";
-        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
 
         MsoResponseWrapper w;
         try {
@@ -608,6 +650,33 @@ public class MsoController extends RestrictedBaseController {
         return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
     }
 
+    @RequestMapping(value = "/mso_activate_fabric_configuration/{serviceInstanceId}", method = RequestMethod.POST)
+    public MsoResponseWrapper2 activateFabricConfiguration(
+            @PathVariable("serviceInstanceId") String serviceInstanceId ,
+            @RequestBody RequestDetails requestDetails) {
+
+        String methodName = "activateFabricConfiguration";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
+
+        return msoBusinessLogic.activateFabricConfiguration(serviceInstanceId, requestDetails);
+    }
+
+    @RequestMapping(value = "/mso_vfmodule_soft_delete/{serviceInstanceId}/{vnfInstanceId}/{vfModuleInstanceId}", method = RequestMethod.POST)
+    public MsoResponseWrapper2 deactivateAndCloudDelete(
+            @PathVariable("serviceInstanceId") String serviceInstanceId,
+            @PathVariable("vnfInstanceId") String vnfInstanceId,
+            @PathVariable("vfModuleInstanceId") String vfModuleInstanceId,
+            @RequestBody SoftDeleteRequest softDeleteRequest) {
+
+        String methodName = "deactivateAndCloudDelete";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + START_LOG);
+
+        RequestDetails requestDetails = msoBusinessLogic.buildRequestDetailsForSoftDelete(softDeleteRequest);
+
+        cloudOwnerService.enrichRequestWithCloudOwner(requestDetails);
+        return msoBusinessLogic.deactivateAndCloudDelete(serviceInstanceId, vnfInstanceId, vfModuleInstanceId, requestDetails);
+    }
+
 
     /**
      * Exception handler.
@@ -619,25 +688,7 @@ public class MsoController extends RestrictedBaseController {
     @ExceptionHandler(Exception.class)
     private void exceptionHandler(Exception e, HttpServletResponse response) throws IOException {
 
-               /*
-         * The following "logger.error" lines "should" be sufficient for logging the exception.
-                * However, the console output in my Eclipse environment is NOT showing ANY of the
-                * logger statements in this class. Thus the temporary "e.printStackTrace" statement
-                * is also included.
-                */
-
-        String methodName = "exceptionHandler";
-        LOGGER.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-        StringWriter sw = new StringWriter();
-        e.printStackTrace(new PrintWriter(sw));
-        LOGGER.error(EELFLoggerDelegate.errorLogger, sw.toString());
-
-               /*
-         *  Temporary - IF the above  mentioned "logger.error" glitch is resolved ...
-                *  this statement could be removed since it would then likely result in duplicate
-                *  trace output. 
-                */
-        e.printStackTrace(System.err);
+        ControllersUtils.handleException(e, LOGGER);
 
         response.setContentType("application/json; charset=UTF-8");
         response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
@@ -651,5 +702,4 @@ public class MsoController extends RestrictedBaseController {
         response.flushBuffer();
 
     }
-
 }