create DateBean, UserBean, TotalBean
[proteocache.git] / server / compbio / controllers / DailyStatisticsController.java
index edfe876..b735107 100644 (file)
@@ -12,8 +12,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
-
 import compbio.cassandra.DataBase;
+import compbio.cassandra.DateBean;
+import compbio.cassandra.TotalJobsStatisticBean;
 import compbio.statistic.CassandraRequester;
 import compbio.statistic.StatisticsProt;
 
@@ -50,7 +51,7 @@ public class DailyStatisticsController {
                }
                model.put("date1", date1);
                model.put("date2", date2);
-               List<DataBase> res = cr.countJobs(date1, date2);
+               TotalJobsStatisticBean res = cr.countJobs(date1, date2);
                model.put("result", res);
                final long endTime = System.currentTimeMillis();
                model.put("timeExecution", (endTime - startTime));
@@ -78,9 +79,10 @@ public class DailyStatisticsController {
 
                CassandraRequester cr = new CassandraRequester();
                // IMPORTANT: input should be suppied in the format: DD/MM/YYYY
-               List<DataBase> r = cr.readJobByDay(realdate);
+               DateBean r = cr.readJobByDay(realdate);
                model.put("results", r);
-               model.put("njobs", r.size());
+               if (r != null)
+                       model.put("njobs", r.getJobidAndSeq().size());
                model.put("date", realdate);
                final long endTime = System.currentTimeMillis();
                model.put("timeExecution", (endTime - startTime));