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 +- 7 files changed, 56 insertions(+), 4 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap/vid') 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 bbca06e9..deebb2b7 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 f38a7fc6..80d60d9c 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 10ac231b..7cea0301 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 a8477563..350be441 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 1b4c5273..7924a7d7 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 c3deec32..14761cad 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 9fc95fce..38cd5151 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. -- cgit 1.2.3-korg