From 4751c29632d2f32abba85dd91296fb91672a2f59 Mon Sep 17 00:00:00 2001 From: Wojciech Sliwka Date: Tue, 25 Jun 2019 11:42:46 +0200 Subject: 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 --- .../org/onap/vid/controller/ProbeController.java | 31 ++++------------------ 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap/vid/controller/ProbeController.java') 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 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 probes) { + this.probes = probes; } @GetMapping public List getProbe() { - List 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()); } - } -- cgit 1.2.3-korg