aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java
diff options
context:
space:
mode:
authorWojciech Sliwka <wojciech.sliwka@nokia.com>2019-06-25 11:42:46 +0200
committerWojciech Sliwka <wojciech.sliwka@nokia.com>2019-07-01 09:24:34 +0200
commit4751c29632d2f32abba85dd91296fb91672a2f59 (patch)
tree970fcde9591168089bda86ee2a5453c5eb693f03 /vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java
parent72b3fb69e548cf665204ec025d2778dcf3ce0216 (diff)
Extend probe mechanism
Fixes from latest review. Introduce probe interface. ResponseWithRequestInfo is not used - it belongs to aai package and requires javax.ws.rs.core.Response. Fallback in aai client will be removed as soon as sdc provides https support (hopefully in El Alto). Change-Id: I4527d447a273328d38ff2ef7f9d2a93453cec9f2 Issue-ID: VID-490 Signed-off-by: Wojciech Sliwka <wojciech.sliwka@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java18
1 files changed, 3 insertions, 15 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 c2ac51a40..dbeaa90cb 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
@@ -28,7 +28,6 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.joshworks.restclient.http.HttpResponse;
import org.apache.commons.collections4.ListUtils;
-import org.jetbrains.annotations.NotNull;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.util.SystemProperties;
import org.onap.vid.changeManagement.ChangeManagementRequest;
@@ -866,17 +865,15 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic {
@Override
- public ExternalComponentStatus probeGetOrchestrationRequests() {
+ public ExternalComponentStatus probeComponent() {
String url = SystemProperties.getProperty(
MsoProperties.MSO_SERVER_URL) + "/" + SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS);
long startTime = System.currentTimeMillis();
ExternalComponentStatus externalComponentStatus;
try {
- RestObject<List<Request>> restObject = createRequestsList(getOrchestrationRequestsForDashboard());
-
- StatusMetadata statusMetadata = new HttpRequestMetadata(new RestObjectWithRequestInfo(HttpMethod.GET, url, restObject),
- "VID-SO communication works", System.currentTimeMillis() - startTime);
+ String rawBody = objectMapper.writeValueAsString(getOrchestrationRequestsForDashboard());
+ StatusMetadata statusMetadata=new HttpRequestMetadata(HttpMethod.GET,200,url,rawBody,"VID-SO",System.currentTimeMillis() - startTime);
externalComponentStatus = new ExternalComponentStatus(ExternalComponentStatus.Component.MSO, true, statusMetadata);
} catch (Exception e) {
@@ -887,15 +884,6 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic {
return externalComponentStatus;
}
- @NotNull
- private RestObject<List<Request>> createRequestsList(List<Request> orchestrationRequestsForDashboard) {
- RestObject<List<Request>> restObject = new RestObject<>();
- restObject.set(orchestrationRequestsForDashboard);
- restObject.setStatusCode(200);
- return restObject;
- }
-
-
private void validateUpdateVnfConfig(RequestDetails requestDetails) {
final String noValidPayloadMsg = "No valid payload in " + ChangeManagementRequest.CONFIG_UPDATE + " request";