@Test public void testDoGet() throws ServletException, IOException { doGet(Collections.<HttpParameter, String> emptyMap(), true); setProperty(Parameter.ALLOWED_ADDR_PATTERN, "256.*"); try { doGet(Collections.<HttpParameter, String> emptyMap(), false); setProperty(Parameter.ALLOWED_ADDR_PATTERN, ".*"); doGet(Collections.<HttpParameter, String> emptyMap(), false); } finally { setProperty(Parameter.ALLOWED_ADDR_PATTERN, null); } }
@Override protected void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException { final FilterContext filterContext = (FilterContext) servletConfig.getServletContext() .getAttribute(FILTER_CONTEXT_KEY); assert filterContext != null; if (!httpAuth.isAllowed(httpRequest, httpResponse)) { return; } final Collector collector = filterContext.getCollector(); final MonitoringController monitoringController = new MonitoringController(collector, null); monitoringController.doActionIfNeededAndReport(httpRequest, httpResponse, servletConfig.getServletContext()); }
ReportServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException { final FilterContext filterContext = (FilterContext) servletConfig.getServletContext() .getAttribute(FILTER_CONTEXT_KEY); assert filterContext != null; if (!httpAuth.isAllowed(httpRequest, httpResponse)) { return; } final Collector collector = filterContext.getCollector(); final MonitoringController monitoringController = new MonitoringController(collector, null); monitoringController.doActionIfNeededAndReport(httpRequest, httpResponse, servletConfig.getServletContext()); } }
ReportServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException { final FilterContext filterContext = (FilterContext) servletConfig.getServletContext() .getAttribute(FILTER_CONTEXT_KEY); assert filterContext != null; if (!httpAuth.isAllowed(httpRequest, httpResponse)) { return; } final Collector collector = filterContext.getCollector(); final MonitoringController monitoringController = new MonitoringController(collector, null); monitoringController.doActionIfNeededAndReport(httpRequest, httpResponse, servletConfig.getServletContext()); }  }
ReportServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException { final FilterContext filterContext = (FilterContext) servletConfig.getServletContext() .getAttribute(FILTER_CONTEXT_KEY); assert filterContext != null; if (!httpAuth.isAllowed(httpRequest, httpResponse)) { return; } final Collector collector = filterContext.getCollector(); final MonitoringController monitoringController = new MonitoringController(collector, null); monitoringController.doActionIfNeededAndReport(httpRequest, httpResponse, servletConfig.getServletContext()); }  @Override void init(ServletConfig config); @Override void destroy(); }
ReportServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException { final FilterContext filterContext = (FilterContext) servletConfig.getServletContext() .getAttribute(FILTER_CONTEXT_KEY); assert filterContext != null; if (!httpAuth.isAllowed(httpRequest, httpResponse)) { return; } final Collector collector = filterContext.getCollector(); final MonitoringController monitoringController = new MonitoringController(collector, null); monitoringController.doActionIfNeededAndReport(httpRequest, httpResponse, servletConfig.getServletContext()); }  @Override void init(ServletConfig config); @Override void destroy();  }