aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-08-05 23:38:18 +0300
committerEylon Malin <eylon.malin@intl.att.com>2019-08-06 12:32:00 +0300
commit151d768e923994b3e81ade049d21bf65e931faac (patch)
tree797fe529428d0dc399992491acd584de58b3107d /vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java
parent84d0b4b11a1ae178a6759ce423ce2bd62315ce15 (diff)
handle errors in change management and tenant isolation
use more tolerance way for parsing responses from MSO so VID can handle error responses with html body Issue-ID: VID-378 Signed-off-by: Eylon Malin <eylon.malin@intl.att.com> Change-Id: I72741ec1bf636a1200e8ecbd684ab1f3b2ab332a Signed-off-by: Ittay Stern <ittay.stern@att.com> Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java20
1 files changed, 5 insertions, 15 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java b/vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java
index a6778ad0c..44bdc813b 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java
@@ -33,6 +33,7 @@ import org.onap.vid.model.RequestReferencesContainer;
import org.onap.vid.mso.MsoBusinessLogic;
import org.onap.vid.mso.MsoInterface;
import org.onap.vid.mso.MsoResponseWrapper2;
+import org.onap.vid.mso.MsoUtil;
import org.onap.vid.mso.model.OperationalEnvironmentActivateInfo;
import org.onap.vid.mso.model.OperationalEnvironmentDeactivateInfo;
import org.onap.vid.mso.rest.OperationalEnvironment.OperationEnvironmentRequestDetails;
@@ -80,9 +81,7 @@ public class OperationalEnvironmentController extends VidRestrictedBaseControlle
RequestDetailsWrapper<OperationEnvironmentRequestDetails> requestDetailsWrapper = msoBusinessLogic.convertParametersToRequestDetails(operationalEnvironment, userId);
String path = msoBusinessLogic.getOperationalEnvironmentCreationPath();
- HttpResponse<RequestReferencesContainer> msoResponse = restMso.post(path, requestDetailsWrapper, RequestReferencesContainer.class);
- debugEnd(msoResponse);
- return new MsoResponseWrapper2<>(msoResponse);
+ return MsoUtil.wrapResponse2(restMso.post(path, requestDetailsWrapper, String.class), RequestReferencesContainer.class);
}
@RequestMapping(value = "/activate", method = RequestMethod.POST)
@@ -105,10 +104,7 @@ public class OperationalEnvironmentController extends VidRestrictedBaseControlle
String path = msoBusinessLogic.getOperationalEnvironmentActivationPath(activateInfo);
RequestDetailsWrapper<RequestDetails> requestDetailsWrapper = msoBusinessLogic.createOperationalEnvironmentActivationRequestDetails(activateInfo);
- HttpResponse<RequestReferencesContainer> msoResponse = restMso.post(path, requestDetailsWrapper, RequestReferencesContainer.class);
-
- debugEnd(msoResponse);
- return new MsoResponseWrapper2<>(msoResponse);
+ return MsoUtil.wrapResponse2(restMso.post(path, requestDetailsWrapper, String.class), RequestReferencesContainer.class);
}
@RequestMapping(value = "/deactivate", method = RequestMethod.POST)
@@ -126,10 +122,7 @@ public class OperationalEnvironmentController extends VidRestrictedBaseControlle
String path = msoBusinessLogic.getOperationalEnvironmentDeactivationPath(deactivateInfo);
RequestDetailsWrapper<RequestDetails> requestDetailsWrapper = msoBusinessLogic.createOperationalEnvironmentDeactivationRequestDetails(deactivateInfo);
- HttpResponse<RequestReferencesContainer> msoResponse = restMso.post(path, requestDetailsWrapper, RequestReferencesContainer.class);
-
- debugEnd(msoResponse);
- return new MsoResponseWrapper2<>(msoResponse);
+ return MsoUtil.wrapResponse2(restMso.post(path, requestDetailsWrapper, String.class), RequestReferencesContainer.class);
}
@RequestMapping(value = "/requestStatus", method = RequestMethod.GET)
@@ -140,10 +133,7 @@ public class OperationalEnvironmentController extends VidRestrictedBaseControlle
verifyIsNotEmpty(requestId, "requestId");
String path = msoBusinessLogic.getCloudResourcesRequestsStatusPath(requestId);
- HttpResponse<HashMap> msoResponse = restMso.get(path, HashMap.class);
-
- LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), msoResponse);
- return new MsoResponseWrapper2<>(msoResponse);
+ return MsoUtil.wrapResponse2(restMso.get(path, String.class), HashMap.class);
}
@ExceptionHandler({