1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
@Component(value="httpMB")
@Scope(value="request")
public class HttpManagedBean implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Autowired
HttpService httpService;
private PieChartModel pieModel = new PieChartModel() ;
private String host;
private Date startDate;
private Date endDate;
@PostConstruct
public void init() {
createPieModel();
}
public void createPieModel(){
pieModel = new PieChartModel();
pieModel.set("Classe de réponse 1XX", getVal1xx());
pieModel.set("Classe de réponse 2XX", getVal2xx());
pieModel.set("Classe de réponse 3XX", getVal3xx());
pieModel.set("Classe de réponse 4XX", getVal4xx());
pieModel.set("Classe de réponse 4XX", getVal5xx());
}
public PieChartModel getPieModel() {
return pieModel;
}
public void setPieModel(PieChartModel pieModel) {
this.pieModel = pieModel;
}
public String getHost() {
return host;
}
public Date getStartDate() {
return startDate;
}
public Date getEndDate() {
return endDate;
}
public Long getVal1xx(){
return httpService.sumNb1xx(host, startDate,endDate);
}
public Long getVal2xx(){
return httpService.sumNb2xx(host,startDate,endDate);
}
public Long getVal3xx(){
return httpService.sumNb3xx(host,startDate,endDate);
}
public Long getVal4xx(){
return httpService.sumNb4xx(host,startDate,endDate);
}
public Long getVal5xx(){
return httpService.sumNb5xx(host,startDate,endDate);
}
} |
Partager