Merge "Logging improvements"
[vid.git] / vid-app-common / src / main / java / org / onap / vid / controller / ProbeController.java
1 package org.onap.vid.controller;
2
3 import org.onap.portalsdk.core.controller.RestrictedBaseController;
4 import org.onap.vid.aai.AaiClient;
5 import org.onap.vid.model.probes.ExternalComponentStatus;
6 import org.onap.vid.mso.MsoBusinessLogic;
7 import org.onap.vid.scheduler.SchedulerService;
8 import org.onap.vid.services.VidService;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.web.bind.annotation.RequestMapping;
11 import org.springframework.web.bind.annotation.RequestMethod;
12 import org.springframework.web.bind.annotation.RestController;
13
14 import java.util.ArrayList;
15 import java.util.List;
16
17 @RestController
18 @RequestMapping("probe")
19 public class ProbeController extends RestrictedBaseController {
20
21     private final AaiClient aaiClient;
22     private final VidService vidService;
23     private final MsoBusinessLogic msoBusinessLogic;
24     private final SchedulerService schedulerService;
25
26     @Autowired
27     public ProbeController(AaiClient aaiClient, VidService vidService, MsoBusinessLogic msoBusinessLogic, SchedulerService schedulerService) {
28         this.aaiClient = aaiClient;
29         this.vidService = vidService;
30         this.msoBusinessLogic = msoBusinessLogic;
31         this.schedulerService = schedulerService;
32     }
33
34     @RequestMapping(method= RequestMethod.GET)
35     public List<ExternalComponentStatus> getProbe() {
36         List<ExternalComponentStatus> componentStatuses = new ArrayList<>();
37         componentStatuses.add(aaiClient.probeAaiGetAllSubscribers());
38         componentStatuses.add(schedulerService.probeGetSchedulerChangeManagements());
39         return componentStatuses;
40     }
41
42 }