import compbio.cassandra.readers.ReaderByCounter;
/**
+ * The controller
+ *
* @author Alexander Sherstnev
* @author Natasha Sherstneva
+ * @version 1.0
*/
@Controller
public class IPDataController extends BasicController {
-
+ /**
+ * default minimal jobs to consider a user "heavy user"
+ */
+ private int minimalJobsFromIP = 5;
+
+ /**
+ * for initial page for request "heavy users"
+ *
+ */
@RequestMapping(value = "/admin/ip/counts/query", method = RequestMethod.GET)
public String initStatisticsForm(Map<String, Object> model) {
model.put("username", getPrincipalName());
- model.put("value", 5);
+ model.put("value", minimalJobsFromIP);
return "query/IPStatistics";
}
+ /**
+ * form query page for requesting a single IP
+ *
+ * @param model - MVC abstract model
+ * @return
+ */
@RequestMapping(value = "/admin/ip/query", method = RequestMethod.GET)
public String initOneIPForm(Map<String, Object> model) {
model.put("username", getPrincipalName());
return "query/IP";
}
+ /**
+ * Form output model with statistics on "heavy users"
+ * @param counter - the number of jobs for requested "heavy users"
+ * @param model - abstract MVC model
+ * @return
+ */
@RequestMapping(value = "/admin/ip/counts/results", method = RequestMethod.GET)
public String findIPwithCounter(@RequestParam("JobCounter") String counter, Map<String, Object> model) {
model.put("username", getPrincipalName());