Package org.geoserver.flow.controller

Examples of org.geoserver.flow.controller.RateFlowController


            String service = keys.length >= 3 ? keys[2] : null;
            String request = keys.length >= 4 ? keys[3] : null;
            String format = keys.length >= 5 ? keys[4] : null;
            OWSRequestMatcher requestMatcher = new OWSRequestMatcher(service, request, format);
            KeyGenerator keyGenerator = buildKeyGenerator(keys, value);
            return new RateFlowController(requestMatcher, rate, interval, delay, keyGenerator);
        }
View Full Code Here


        assertEquals(10 * 1000, configurator.getTimeout());

        assertEquals(10, controllers.size());

        assertTrue(controllers.get(0) instanceof RateFlowController);
        RateFlowController rfc = (RateFlowController) controllers.get(0);
        assertEquals("wps.execute", rfc.getMatcher().toString());
        assertEquals(50, rfc.getMaxRequests());
        assertEquals(Intervals.d.getDuration(), rfc.getTimeInterval());
        assertEquals(60000, rfc.getDelay());

        assertTrue(controllers.get(1) instanceof RateFlowController);
        rfc = (RateFlowController) controllers.get(1);
        assertEquals("wms.getmap", rfc.getMatcher().toString());
        assertEquals(100, rfc.getMaxRequests());
        assertEquals(Intervals.m.getDuration(), rfc.getTimeInterval());
        assertEquals(3000, rfc.getDelay());

        assertTrue(controllers.get(2) instanceof RateFlowController);
        rfc = (RateFlowController) controllers.get(2);
        assertEquals("wms", rfc.getMatcher().toString());
        assertEquals(300, rfc.getMaxRequests());
        assertEquals(Intervals.m.getDuration(), rfc.getTimeInterval());
        assertEquals(3000, rfc.getDelay());

        assertTrue(controllers.get(3) instanceof RateFlowController);
        rfc = (RateFlowController) controllers.get(3);
        assertEquals("Any OGC request", rfc.getMatcher().toString());
        assertEquals(20, rfc.getMaxRequests());
        assertEquals(Intervals.s.getDuration(), rfc.getTimeInterval());
        assertEquals(0, rfc.getDelay());

        assertTrue(controllers.get(4) instanceof UserConcurrentFlowController);
        UserConcurrentFlowController uc = (UserConcurrentFlowController) controllers.get(4);
        assertEquals(6, uc.getPriority());

View Full Code Here

TOP

Related Classes of org.geoserver.flow.controller.RateFlowController

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.