1
|
package eu.dnetlib.functionality.modular.ui;
|
2
|
|
3
|
import java.util.List;
|
4
|
|
5
|
import eu.dnetlib.enabling.common.StoppableDetails;
|
6
|
import eu.dnetlib.functionality.modular.ui.utils.ShutdownUtils;
|
7
|
import org.springframework.beans.factory.annotation.Autowired;
|
8
|
import org.springframework.stereotype.Controller;
|
9
|
import org.springframework.web.bind.annotation.RequestMapping;
|
10
|
import org.springframework.web.bind.annotation.ResponseBody;
|
11
|
|
12
|
@Controller
|
13
|
public class PrepareShutdownInternalController {
|
14
|
|
15
|
@Autowired
|
16
|
private ShutdownUtils shutdownUtils;
|
17
|
|
18
|
@RequestMapping("/ui/shutdown/listStoppableDetails.json")
|
19
|
public @ResponseBody
|
20
|
List<StoppableDetails> listStoppableDetails() {
|
21
|
return shutdownUtils.listStoppableDetails();
|
22
|
}
|
23
|
|
24
|
@RequestMapping("/ui/shutdown/stopAll.do")
|
25
|
public @ResponseBody
|
26
|
boolean stopAll() {
|
27
|
shutdownUtils.stopAll();
|
28
|
return true;
|
29
|
}
|
30
|
|
31
|
@RequestMapping("/ui/shutdown/resumeAll.do")
|
32
|
public @ResponseBody
|
33
|
boolean resumeAll() {
|
34
|
shutdownUtils.resumeAll();
|
35
|
return true;
|
36
|
}
|
37
|
|
38
|
}
|