From 195a4993601a572df71b7905b6720eeda1a6ec28 Mon Sep 17 00:00:00 2001 From: "Sonsino, Ofir (os0695)" Date: Tue, 5 Jun 2018 19:29:39 +0300 Subject: VoLTE support Change-Id: I506a30d012003d8f6efb7c894435c28f1e421ac4 Issue-ID: VID-189 Signed-off-by: Sonsino, Ofir (os0695) --- .../org/onap/vid/controllers/MsoController.java | 26 +++++++++++++++++++++- .../java/org/onap/vid/mso/MsoBusinessLogic.java | 2 ++ .../org/onap/vid/mso/MsoBusinessLogicImpl.java | 17 ++++++++++++++ .../main/java/org/onap/vid/mso/MsoInterface.java | 1 + .../org/onap/vid/mso/RestMsoImplementation.java | 2 +- .../org/onap/vid/mso/rest/MsoRestClientNew.java | 10 ++++++++- .../java/org/onap/vid/mso/rest/RestInterface.java | 2 +- .../controller/deleteResumeDialogController.js | 10 ++++++--- .../vid/scripts/services/deleteResumeService.js | 21 ++++++++++++++--- .../vid/scripts/view-models/deleteResumeDialog.htm | 8 ++++++- 10 files changed, 88 insertions(+), 11 deletions(-) diff --git a/vid-app-common/src/main/java/org/onap/vid/controllers/MsoController.java b/vid-app-common/src/main/java/org/onap/vid/controllers/MsoController.java index bbca06e9b..deebb2b70 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controllers/MsoController.java +++ b/vid-app-common/src/main/java/org/onap/vid/controllers/MsoController.java @@ -235,7 +235,31 @@ public class MsoController extends RestrictedBaseController { return (new ResponseEntity<>(w.getResponse(), HttpStatus.OK)); } - /** + /** + * 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_e2e_svc_instance/{serviceInstanceId}", method = RequestMethod.POST) + public ResponseEntity deleteE2eSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, + HttpServletRequest request, @RequestBody LinkedHashMap mso_request) throws Exception { + + String methodName = "deleteE2eSvcInstance"; + LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start"); + + MsoResponseWrapper w = msoBusinessLogic.deleteE2eSvcInstance(mso_request.get("requestDetails"), serviceInstanceId); + + LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse()); + // always return OK, the MSO status code is embedded in the body + + return (new ResponseEntity(w.getResponse(), HttpStatus.OK)); + + } + + /** * Delete svc instance. * * @param serviceInstanceId the service instance id diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java index f38a7fc6d..80d60d9ca 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java @@ -18,6 +18,8 @@ public interface MsoBusinessLogic { MsoResponseWrapper createE2eSvcInstance(Object msoRequest) throws Exception; + MsoResponseWrapper deleteE2eSvcInstance(Object requestDetails, String serviceInstanceId) throws Exception; + MsoResponseWrapper createVnf(RequestDetails requestDetails, String serviceInstanceId) throws Exception; MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception; diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java index 10ac231bf..7cea0301b 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java @@ -196,6 +196,23 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { return msoClientInterface.createConfigurationInstance(requestDetails, endpoint); } + @Override + public MsoResponseWrapper deleteE2eSvcInstance(Object requestDetails, String serviceInstanceId) throws Exception { + String methodName = "deleteE2eSvcInstance"; + logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start"); + + String endpoint; + try { + endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_E2E_SVC_INSTANCE); + } catch (Exception exception) { + throw exception; + } + + String svc_endpoint = endpoint + "/" + serviceInstanceId; + + return msoClientInterface.deleteE2eSvcInstance(requestDetails, svc_endpoint); + } + @Override public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception { String methodName = "deleteSvcInstance"; diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java index a84775638..350be4415 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java @@ -20,6 +20,7 @@ public interface MsoInterface { //For VoLTE E2E services MsoResponseWrapper createE2eSvcInstance(Object requestDetails, String endpoint) throws Exception; + MsoResponseWrapper deleteE2eSvcInstance(Object requestDetails, String endpoint) throws Exception; /** * will create a virtual network function using MSO service. diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java b/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java index 1b4c52733..7924a7d7d 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java @@ -170,7 +170,7 @@ public class RestMsoImplementation implements RestInterface { } @Override - public void Delete(T t, RequestDetails r, String sourceID, String path, RestObject restObject) { + public void Delete(T t, Object r, String sourceID, String path, RestObject restObject) { String methodName = "Delete"; String url=""; diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java index c3deec325..14761cad3 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java @@ -84,6 +84,14 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf return createInstance(requestDetails, endpoint); } + @Override + public MsoResponseWrapper deleteE2eSvcInstance(Object requestDetails, String endpoint) throws Exception { + String methodName = "deleteE2eSvcInstance"; + logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start"); + + return deleteInstance(requestDetails, endpoint); + } + @Override public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception { String methodName = "deleteSvcInstance"; @@ -165,7 +173,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf * @return the mso response wrapper * @throws Exception the exception */ - public MsoResponseWrapper deleteInstance(RequestDetails request, String path) throws Exception { + public MsoResponseWrapper deleteInstance(Object request, String path) throws Exception { String methodName = "deleteInstance"; logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start"); diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java index 9fc95fcec..38cd51517 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java @@ -37,7 +37,7 @@ public interface RestInterface { * @param restObject the rest object * @throws Exception the exception */ - void Delete(T t, RequestDetails r, String sourceID, String path, RestObject restObject) throws Exception; + void Delete(T t, Object r, String sourceID, String path, RestObject restObject) throws Exception; /** * Post. diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js index 9715484d4..cdda3a143 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js @@ -21,7 +21,7 @@ "use strict"; var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log, - DeleteResumeService, CreationService, UtilityService) { + DeleteResumeService, CreationService, DataService, UtilityService) { $scope.isDialogVisible = false; $scope.summaryControl = {}; @@ -32,6 +32,7 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t $scope.$on(COMPONENT.DELETE_RESUME_COMPONENT, function(event, request) { + $scope.isE2EService = false; $scope.isDataVisible = false; $scope.isSpinnerVisible = false; $scope.isErrorVisible = false; @@ -41,6 +42,7 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t $scope.dialogMethod = request.dialogMethod; callbackFunction = request.callbackFunction; componentId = request.componentId; + $scope.isServiceInstance = componentId === "service"; DeleteResumeService.initializeComponent(request.componentId); @@ -69,6 +71,8 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t } $scope.confirm = function() { + DataService.setE2EService($scope.isE2EService); //VoLTE support + var requiredFields = $scope.userProvidedControl.getRequiredFields(); if (requiredFields === "") { $scope.isErrorVisible = false; @@ -96,7 +100,7 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t var requestDetails = DeleteResumeService.getMsoRequestDetails($scope.userProvidedControl.getList()); - if(DeleteResumeService.isMacro === true){ + if(!DataService.getE2EService() && DeleteResumeService.isMacro === true){ requestDetails.requestParameters.aLaCarte = false; } @@ -144,5 +148,5 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t } appDS2.controller("deleteResumeDialogController", [ "COMPONENT", "FIELD", "$scope", "$http", - "$timeout", "$log", "DeleteResumeService","CreationService", "UtilityService", + "$timeout", "$log", "DeleteResumeService","CreationService", "DataService", "UtilityService", deleteResumeDialogController]); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js index 90daf3550..3255bc9a3 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js @@ -266,8 +266,10 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService, + DataService.getServiceInstanceId() + "/networks/" + DataService.getNetworkInstanceId(); case COMPONENT.SERVICE: - return "mso_delete_svc_instance/" - + DataService.getServiceInstanceId(); + if(DataService.getE2EService() === true) + return "mso_delete_e2e_svc_instance/"+ DataService.getServiceInstanceId(); + else + return "mso_delete_svc_instance/"+ DataService.getServiceInstanceId(); case COMPONENT.VNF: return "mso_delete_vnf_instance/" + DataService.getServiceInstanceId() + "/vnfs/" @@ -291,9 +293,22 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService, value : value }); }; - + + var getMsoE2ERequest = function(parameterList) { + return { + "globalSubscriberId": DataService.getSubscriberName(), + "serviceType": DataService.getServiceType() + }; + }; + var getMsoRequestDetails = function(parameterList) { console.log("getMsoRequestDetails invoked"); + + //VoLTE logic goes here + if(DataService.getE2EService() === true) { + return getMsoE2ERequest(parameterList); + } + var inventoryInfo = ComponentService.getInventoryInfo( _this.componentId, DataService.getInventoryItem()); var modelInfo = DataService.getModelInfo(_this.componentId); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm index ccd54a612..efaca5bd3 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm @@ -32,7 +32,13 @@ - + + +
+ + This is an E2E (VoLTE) service instance +
+

-- cgit 1.2.3-korg