diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-07-21 13:56:43 +0300 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2019-07-21 16:46:53 +0300 |
commit | 2161e5d01e6ff0e1460d268371c97792331b0974 (patch) | |
tree | 057a0bc5b72c4d990aff5913b632e4605205920c /vid-app-common/src/main | |
parent | e751654a743922fc2a2d23b27553ad451dba6643 (diff) |
Return a value from MsoInterface::setServiceInstanceStatus
This resolves the case where mso_activate_service_instance API is
returning an empty object.
Issue-ID: VID-267
Change-Id: I691c7ca037c5458ce728bed10bf959e664679b6a
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/main')
3 files changed, 6 insertions, 12 deletions
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 dbeaa90cb..ae3c74d86 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 @@ -480,7 +480,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { String str = ""; restObjStr.set(str); - msoClientInterface.setServiceInstanceStatus(requestDetails, str, "", activateServicePath, restObjStr); + msoClientInterface.setServiceInstanceStatus(requestDetails, activateServicePath); return MsoUtil.wrapResponse(restObjStr); @@ -707,15 +707,7 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { String isActivateState = (isActivate ? ACTIVATE : DEACTIVATE); endpoint = endpoint + isActivateState; - - RestObject<String> restObjStr = new RestObject<>(); - String str = ""; - restObjStr.set(str); - - msoClientInterface.setServiceInstanceStatus(requestDetails, str, "", endpoint, restObjStr); - - return MsoUtil.wrapResponse(restObjStr); - + return msoClientInterface.setServiceInstanceStatus(requestDetails, endpoint); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, methodName + e.toString()); logger.debug(EELFLoggerDelegate.debugLogger, methodName + e.toString()); 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 9befc0f90..cab75bfed 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 @@ -107,7 +107,7 @@ public interface MsoInterface { MsoResponseWrapper setPortOnConfigurationStatus(RequestDetails requestDetails, String endpoint); - void setServiceInstanceStatus(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject); + MsoResponseWrapper setServiceInstanceStatus(RequestDetails requestDetails, String endpoint); MsoResponseWrapperInterface changeManagementUpdate(RequestDetailsWrapper requestDetails, String endpoint); 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 6a498fc01..c039e0078 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 @@ -397,7 +397,8 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf } - public void setServiceInstanceStatus(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) { + public MsoResponseWrapper setServiceInstanceStatus(RequestDetails requestDetails, + String endpoint) { String methodName = "activateServiceInstance"; logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start "); try { @@ -405,6 +406,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class); MsoResponseWrapper w = MsoUtil.wrapResponse(response); logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w =" + w.getResponse()); + return w; } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString()); |