1
2
3
4
5
6
7
8
9
10
11 package psiprobe.controllers.connectors;
12
13 import jakarta.servlet.http.HttpServletRequest;
14 import jakarta.servlet.http.HttpServletResponse;
15
16 import org.springframework.beans.factory.annotation.Value;
17 import org.springframework.stereotype.Controller;
18 import org.springframework.web.bind.annotation.RequestMapping;
19 import org.springframework.web.servlet.ModelAndView;
20 import org.springframework.web.servlet.mvc.ParameterizableViewController;
21
22 import psiprobe.tools.TimeExpression;
23
24
25
26
27 @Controller
28 public class ZoomChartController extends ParameterizableViewController {
29
30
31 private long collectionPeriod;
32
33
34
35
36
37
38 public long getCollectionPeriod() {
39 return collectionPeriod;
40 }
41
42
43
44
45
46
47 public void setCollectionPeriod(long collectionPeriod) {
48 this.collectionPeriod = collectionPeriod;
49 }
50
51
52
53
54
55
56 @Value("${psiprobe.beans.stats.collectors.connector.period}")
57 public void setCollectionPeriod(String collectionPeriod) {
58 this.collectionPeriod = TimeExpression.inSeconds(collectionPeriod);
59 }
60
61 @RequestMapping(path = "/zoomchart.htm")
62 @Override
63 public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
64 throws Exception {
65 return super.handleRequest(request, response);
66 }
67
68 @Override
69 protected ModelAndView handleRequestInternal(HttpServletRequest request,
70 HttpServletResponse response) throws Exception {
71 return super.handleRequestInternal(request, response).addObject("collectionPeriod",
72 getCollectionPeriod());
73 }
74
75 @Value("zoomreq")
76 @Override
77 public void setViewName(String viewName) {
78 super.setViewName(viewName);
79 }
80
81 }