Package org.geoserver.monitor

Examples of org.geoserver.monitor.RequestDataVisitor


           
            final boolean body = fields.contains("Body");
            final boolean error = fields.contains("Error");
           
            if (object instanceof MonitorQuery) {
                monitor.query((MonitorQuery)object, new RequestDataVisitor() {
                    public void visit(RequestData data) {
                        try {
                            writeBodyAndError(data, zout, body, error, true);
                        }
                        catch (IOException e) {
View Full Code Here


                return super.toRepresentation(object);
            }
           
            //TODO: stream this!
            final List<RequestData> requests = new ArrayList();
            handleRequests(object, new RequestDataVisitor() {
                    public void visit(RequestData data, Object... aggregates) {
                        requests.add(data);
                    }
                }, monitor);
           
View Full Code Here

                sb.append(fld).append(",");
            }
            sb.setLength(sb.length()-1);
            w.write(sb.append("\n").toString());
           
            handleRequests(object, new RequestDataVisitor() {
                public void visit(RequestData data, Object... aggregates) {
                    try {
                        writeRequest(data, w);
                    }
                    catch (IOException e) {
View Full Code Here

           
            final boolean body = fields.contains("Body");
            final boolean error = fields.contains("Error");
           
            if (object instanceof Query) {
                monitor.query((Query)object, new RequestDataVisitor() {
                    public void visit(RequestData data, Object... aggregates) {
                        try {
                            writeBodyAndError(data, zout, body, error, true);
                        }
                        catch (IOException e) {
View Full Code Here

                HSSFCell cell = header.createCell(i);
                cell.setCellValue(new HSSFRichTextString(fields[i]));
            }
           
            //write out the request
            handleRequests(object, new RequestDataVisitor() {
                int i = 1;
                public void visit(RequestData data, Object... aggregates) {
                    HSSFRow row = sheet.createRow(i++);
                    for (int j = 0; j < fields.length; j++) {
                        HSSFCell cell = row.createCell(j);
View Full Code Here

    @Test
    public void testGetRequestsAggregate() throws Exception {
        final List<RequestData> datas = new ArrayList();
        final List<Object> aggs = new ArrayList();
       
        RequestDataVisitor v = new RequestDataVisitor() {
            public void visit(RequestData data, Object... aggregates) {
                datas.add(data);
                aggs.addAll(Arrays.asList(aggregates));
            }
        };
View Full Code Here

   
    @Test
    public void testGetRequestsCount() throws Exception {
        final List<Object> aggs = new ArrayList();
       
        RequestDataVisitor v = new RequestDataVisitor() {
            public void visit(RequestData data, Object... aggregates) {
                aggs.addAll(Arrays.asList(aggregates));
            }
        };
        dao.getRequests(new Query().aggregate("count()").filter("path","/foo", Comparison.EQ), v);
View Full Code Here

    @Test
    public void testGetRequestsJoinVisitor() throws Exception {
        final List<RequestData> datas = new ArrayList();
        final List<Object> aggs = new ArrayList();
       
        RequestDataVisitor v = new RequestDataVisitor() {
            public void visit(RequestData data, Object... aggregates) {
                datas.add(data);
                //aggs.addAll(Arrays.asList(aggregates));
            }
        };
View Full Code Here

    public void testGetRequestsJoin2() throws Exception {
        final List<RequestData> datas = new ArrayList();
        final List<Object> aggs = new ArrayList();
       
        dao.getRequests(new Query().properties("resource").aggregate("count()")
            .filter("resource", null, Comparison.NEQ).group("resource"), new RequestDataVisitor() {
            public void visit(RequestData data, Object... aggregates) {
                datas.add(data);
                aggs.add(aggregates[0]);
            }
        });
View Full Code Here

TOP

Related Classes of org.geoserver.monitor.RequestDataVisitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.