diff options
author | Sonsino, Ofir (os0695) <os0695@intl.att.com> | 2018-06-05 19:29:39 +0300 |
---|---|---|
committer | Sonsino, Ofir (os0695) <os0695@intl.att.com> | 2018-06-05 19:29:39 +0300 |
commit | 195a4993601a572df71b7905b6720eeda1a6ec28 (patch) | |
tree | 4f9acdbe63e1f25f848ee09621e96f3c168da21b /vid-app-common/src/main/java/org/onap | |
parent | bef8d8ad7597f3fec56d49152d15a3bc072feb37 (diff) |
VoLTE supportv2.0.02.0.0-ONAP2.0.0-ONAP
Change-Id: I506a30d012003d8f6efb7c894435c28f1e421ac4
Issue-ID: VID-189
Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap')
7 files changed, 56 insertions, 4 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 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<String> deleteE2eSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, + HttpServletRequest request, @RequestBody LinkedHashMap<String, Object> 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<String>(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 @@ -197,6 +197,23 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { } @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"; logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start"); 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 <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) { + public <T> void Delete(T t, Object r, String sourceID, String path, RestObject<T> 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 @@ -85,6 +85,14 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf } @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"; logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start"); @@ -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 */ - <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception; + <T> void Delete(T t, Object r, String sourceID, String path, RestObject<T> restObject) throws Exception; /** * Post. |