aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/controller/ProbeController.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/controller/ProbeController.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/controller/ProbeController.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/ProbeController.java31
1 files changed, 5 insertions, 26 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/ProbeController.java b/vid-app-common/src/main/java/org/onap/vid/controller/ProbeController.java
index 0206af420..c181c6f30 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controller/ProbeController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/ProbeController.java
@@ -21,49 +21,28 @@
package org.onap.vid.controller;
import org.onap.portalsdk.core.controller.RestrictedBaseController;
-import org.onap.vid.aai.AaiClient;
-import org.onap.vid.aai.AaiOverTLSClientInterface;
import org.onap.vid.model.probes.ExternalComponentStatus;
-import org.onap.vid.mso.MsoBusinessLogic;
-import org.onap.vid.scheduler.SchedulerService;
-import org.onap.vid.services.VidService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import java.util.ArrayList;
import java.util.List;
+import java.util.stream.Collectors;
@RestController
@RequestMapping("probe")
public class ProbeController extends RestrictedBaseController {
- private final AaiClient aaiClient;
- private final AaiOverTLSClientInterface newAaiClient;
- private final VidService vidService;
- private final MsoBusinessLogic msoBusinessLogic;
- private final SchedulerService schedulerService;
-
+ private final List<ProbeInterface> probes;
@Autowired
- public ProbeController(AaiClient aaiClient, VidService vidService, MsoBusinessLogic msoBusinessLogic, SchedulerService schedulerService, AaiOverTLSClientInterface newAaiClient) {
- this.aaiClient = aaiClient;
- this.vidService = vidService;
- this.msoBusinessLogic = msoBusinessLogic;
- this.schedulerService = schedulerService;
- this.newAaiClient = newAaiClient;
+ public ProbeController(List<ProbeInterface> probes) {
+ this.probes = probes;
}
@GetMapping
public List<ExternalComponentStatus> getProbe() {
- List<ExternalComponentStatus> componentStatuses = new ArrayList<>();
- componentStatuses.add(aaiClient.probeAaiGetAllSubscribers());
- componentStatuses.add(newAaiClient.probeGetAllSubscribers());
- componentStatuses.add(schedulerService.probeGetSchedulerChangeManagements());
- componentStatuses.add(msoBusinessLogic.probeGetOrchestrationRequests());
- componentStatuses.add(vidService.probeSDCConnection());
- return componentStatuses;
+ return probes.stream().map(ProbeInterface::probeComponent).collect(Collectors.toList());
}
-
}