@Test public void test1() throws ExecException { Tuple input = tupleFactory.newTuple(7); PageViewFilterFunc page = new PageViewFilterFunc(); input.set(0, "http: input.set(1, "-"); input.set(2, "useragent"); input.set(3, "200"); input.set(4, "0.0.0.0"); input.set(5, "text/html"); input.set(6, "GET"); assertTrue(page.exec(input)); }
public final Boolean exec(final Tuple input) throws ExecException { if (input == null || input.get(0) == null) { return null; } String url = (String) input.get(0); String referer = (String) input.get(1); String userAgent = (input.get(2) != null ? (String) input.get(2) : "-"); String statusCode = (input.get(3) != null ? (String) input.get(3) : "-"); String ip = (input.get(4) != null ? (String) input.get(4) : "-"); String mimeType = (input.get(5) != null ? (String) input.get(5) : "-"); String requestMethod = (input.get(6) != null ? (String) input.get(6) : "-"); Pageview pageview = new Pageview(url, referer, userAgent, statusCode, ip, mimeType, requestMethod); if (mode.equals("default")) { return pageview.isPageview(); } else if (mode.equals("webstatscollector")) { return pageview.isWebstatscollectorPageview(); } else if (mode.equals("wikistats")) { return pageview.isWikistatsMobileReportPageview(); } else { throw new RuntimeException( "Modus should be either null, default, webstatscollector or wikistats."); } }
PageViewFilterFunc extends FilterFunc { public final Boolean exec(final Tuple input) throws ExecException { if (input == null || input.get(0) == null) { return null; } String url = (String) input.get(0); String referer = (String) input.get(1); String userAgent = (input.get(2) != null ? (String) input.get(2) : "-"); String statusCode = (input.get(3) != null ? (String) input.get(3) : "-"); String ip = (input.get(4) != null ? (String) input.get(4) : "-"); String mimeType = (input.get(5) != null ? (String) input.get(5) : "-"); String requestMethod = (input.get(6) != null ? (String) input.get(6) : "-"); Pageview pageview = new Pageview(url, referer, userAgent, statusCode, ip, mimeType, requestMethod); if (mode.equals("default")) { return pageview.isPageview(); } else if (mode.equals("webstatscollector")) { return pageview.isWebstatscollectorPageview(); } else if (mode.equals("wikistats")) { return pageview.isWikistatsMobileReportPageview(); } else { throw new RuntimeException( "Modus should be either null, default, webstatscollector or wikistats."); } } }
PageViewFilterFunc extends FilterFunc { public final Boolean exec(final Tuple input) throws ExecException { if (input == null || input.get(0) == null) { return null; } String url = (String) input.get(0); String referer = (String) input.get(1); String userAgent = (input.get(2) != null ? (String) input.get(2) : "-"); String statusCode = (input.get(3) != null ? (String) input.get(3) : "-"); String ip = (input.get(4) != null ? (String) input.get(4) : "-"); String mimeType = (input.get(5) != null ? (String) input.get(5) : "-"); String requestMethod = (input.get(6) != null ? (String) input.get(6) : "-"); Pageview pageview = new Pageview(url, referer, userAgent, statusCode, ip, mimeType, requestMethod); if (mode.equals("default")) { return pageview.isPageview(); } else if (mode.equals("webstatscollector")) { return pageview.isWebstatscollectorPageview(); } else if (mode.equals("wikistats")) { return pageview.isWikistatsMobileReportPageview(); } else { throw new RuntimeException( "Modus should be either null, default, webstatscollector or wikistats."); } } PageViewFilterFunc();  PageViewFilterFunc(final String mode); }
PageViewFilterFunc extends FilterFunc { public final Boolean exec(final Tuple input) throws ExecException { if (input == null || input.get(0) == null) { return null; } String url = (String) input.get(0); String referer = (String) input.get(1); String userAgent = (input.get(2) != null ? (String) input.get(2) : "-"); String statusCode = (input.get(3) != null ? (String) input.get(3) : "-"); String ip = (input.get(4) != null ? (String) input.get(4) : "-"); String mimeType = (input.get(5) != null ? (String) input.get(5) : "-"); String requestMethod = (input.get(6) != null ? (String) input.get(6) : "-"); Pageview pageview = new Pageview(url, referer, userAgent, statusCode, ip, mimeType, requestMethod); if (mode.equals("default")) { return pageview.isPageview(); } else if (mode.equals("webstatscollector")) { return pageview.isWebstatscollectorPageview(); } else if (mode.equals("wikistats")) { return pageview.isWikistatsMobileReportPageview(); } else { throw new RuntimeException( "Modus should be either null, default, webstatscollector or wikistats."); } } PageViewFilterFunc();  PageViewFilterFunc(final String mode); final Boolean exec(final Tuple input); final Schema outputSchema(final Schema input); }
PageViewFilterFunc extends FilterFunc { public final Boolean exec(final Tuple input) throws ExecException { if (input == null || input.get(0) == null) { return null; } String url = (String) input.get(0); String referer = (String) input.get(1); String userAgent = (input.get(2) != null ? (String) input.get(2) : "-"); String statusCode = (input.get(3) != null ? (String) input.get(3) : "-"); String ip = (input.get(4) != null ? (String) input.get(4) : "-"); String mimeType = (input.get(5) != null ? (String) input.get(5) : "-"); String requestMethod = (input.get(6) != null ? (String) input.get(6) : "-"); Pageview pageview = new Pageview(url, referer, userAgent, statusCode, ip, mimeType, requestMethod); if (mode.equals("default")) { return pageview.isPageview(); } else if (mode.equals("webstatscollector")) { return pageview.isWebstatscollectorPageview(); } else if (mode.equals("wikistats")) { return pageview.isWikistatsMobileReportPageview(); } else { throw new RuntimeException( "Modus should be either null, default, webstatscollector or wikistats."); } } PageViewFilterFunc();  PageViewFilterFunc(final String mode); final Boolean exec(final Tuple input); final Schema outputSchema(final Schema input);  }