Package org.geoserver.ows

Examples of org.geoserver.ows.Request


       
        Envelope env = new Envelope(5988504.35, 7585113.55, 851278.90, 1950872.01);
        CoordinateReferenceSystem crs = CRS.decode("EPSG:3348", true);
        gm.setBbox(env);
        gm.setCrs(crs);
        callback.operationDispatched(new Request(), op("GetMap", "WMS", "1.1.1", gm));
       
        CoordinateReferenceSystem logCrs = CRS.decode("EPSG:4326", false);
        BoundingBox bbox = new ReferencedEnvelope(42.2802, 53.73, -95.1193, -71.295, logCrs);
       
        assertEquals("acme:foo", data.getResources().get(0));
View Full Code Here


        gfi.setXPixel(259);
        gfi.setYPixel(241);
        gfi.setVersion("1.1.1");
       
        gfi.setQueryLayers(Arrays.asList(createMapLayer("foo", "acme"), createMapLayer("bar", "acme")));
        callback.operationDispatched(new Request(), op("GetFeatureInfo", "WMS", "1.1.1", gfi));
       
        assertEquals("acme:foo", data.getResources().get(0));
        assertEquals("acme:bar", data.getResources().get(1));
        BBoxAsserts.assertEqualsBbox(new ReferencedEnvelope(48.4,48.4,-123.3,-123.3,logCrs),data.getBbox(), 0.1);
    }
View Full Code Here

        } else if(policy.getLimits() instanceof VectorAccessLimits) {
            VectorAccessLimits val = (VectorAccessLimits) policy.getLimits();
           
            // Ugly hack: during WFS transactions the reads we do are used to count the number of features
            // we are deleting/updating: use the write filter instead of the read filter
            Request request = Dispatcher.REQUEST.get();
            if(request != null && request.getService().equalsIgnoreCase("WFS") && request.getRequest().equalsIgnoreCase("Transaction")) {
                return val.getWriteQuery();
            } else {
                return val.getReadQuery();
            }
           
View Full Code Here

            return false;
        }
    }
   
    private boolean isOgcCapabilitiesRequest() {
        Request request = Dispatcher.REQUEST.get();
        return request != null && "GetCapabilities".equalsIgnoreCase(request.getRequest());
    }
View Full Code Here

     * <li>is a GetCapabilities request</li>
     * <li>is not for a layer-specific virtual service</li>
     * </ol>
     */
    boolean checkCapabilitiesRequest(ResourceInfo resource) {
        Request request = Dispatcher.REQUEST.get();
        if (request != null) {
            if ("GetCapabilities".equalsIgnoreCase(request.getRequest())) {
                String resourceContext = resource.getNamespace().getPrefix() + "/"
                        + resource.getName();
                return !resourceContext.equalsIgnoreCase(request.getContext());
            }
        }
        return false;
    }
View Full Code Here

public class PublicThreadLocalTransferTest extends AbstractThreadLocalTransferTest {

    @Test
    public void testRequest() throws InterruptedException, ExecutionException, SecurityException, NoSuchFieldException {
        // setup the state
        final Request request = new Request();
        Dispatcher.REQUEST.set(request);
        // test it's transferred properly using the base class machinery
        testThreadLocalTransfer(new ThreadLocalTransferCallable(
                new PublicThreadLocalTransfer(Dispatcher.class, "REQUEST")) {
View Full Code Here

    }
   

    @Test
    public void testThreadLocalTransfer() throws InterruptedException, ExecutionException {
        final Request request = new Request();
        Dispatcher.REQUEST.set(request);
        final LayerInfo layer = new LayerInfoImpl();
        LocalLayer.set(layer);
        final WorkspaceInfo ws = new WorkspaceInfoImpl();
        LocalWorkspace.set(ws);
View Full Code Here

        } else if(policy.getLimits() instanceof VectorAccessLimits) {
            VectorAccessLimits val = (VectorAccessLimits) policy.getLimits();
           
            // Ugly hack: during WFS transactions the reads we do are used to count the number of features
            // we are deleting/updating: use the write filter instead of the read filter
            Request request = Dispatcher.REQUEST.get();
            if(request != null && request.getService().equalsIgnoreCase("WFS") && request.getRequest().equalsIgnoreCase("Transaction")) {
                return val.getWriteQuery();
            } else {
                return val.getReadQuery();
            }
           
View Full Code Here

        if (env != null)
            kvp.put("BBOX", env);
        if (srsName != null)
            kvp.put("SRS", srsName);

        Request owsRequest = EasyMock.createMock(Request.class);
        EasyMock.expect(owsRequest.getService()).andReturn("wms").anyTimes();
        EasyMock.expect(owsRequest.getRequest()).andReturn(requestName).anyTimes();
        EasyMock.expect(owsRequest.getKvp()).andReturn(kvp).anyTimes();
        EasyMock.replay(owsRequest);
        Dispatcher.REQUEST.set(owsRequest);
    }
View Full Code Here

TOP

Related Classes of org.geoserver.ows.Request

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.