Package org.geoserver.ows.util

Examples of org.geoserver.ows.util.CaseInsensitiveMap


        Map result = new HashMap();
        for (Iterator it = input.keySet().iterator(); it.hasNext();) {
            String key = (String) it.next();
            result.put(key.toUpperCase(), input.get(key));
        }
        return new CaseInsensitiveMap(result);
    }
View Full Code Here


    }

    @SuppressWarnings("unchecked")
    public void putHttpRequestHeader(String headerName, String value) {
        if (httpRequestHeaders == null) {
            httpRequestHeaders = new CaseInsensitiveMap(new HashMap<String, String>());
        }
        httpRequestHeaders.put(headerName, value);
    }
View Full Code Here

        Map result = new HashMap();
        for (Iterator it = input.keySet().iterator(); it.hasNext();) {
            String key = (String) it.next();
            result.put(key.toUpperCase(), input.get(key));
        }
        return new CaseInsensitiveMap(result);
    }
View Full Code Here

            request.setLayer(layer.getFeatureSource().getSchema());
            request.setTransparent(true);
            request.setScale(scaleDenominator);
            request.setStyle(layer.getStyle());

            Map legendOptions = new CaseInsensitiveMap(options);
            legendOptions.putAll(mapContext.getRequest().getFormatOptions());
            request.setLegendOptions(legendOptions);

            LayerLegend legend = new LayerLegend();
            legend.request = request;
View Full Code Here

        GetMapKvpRequestReader kvpRequestReader = (GetMapKvpRequestReader) Dispatcher.findKvpRequestReader(GetMapRequest.class);
        // clone the original request object using the reflection
        GetMapRequest request = (GetMapRequest) BeanUtils.cloneBean(theRequest);

        // looking for composite parameters like env:color or viewparams:param ...
        Map<String, String> rawKvp = new CaseInsensitiveMap(new HashMap<String, String>(theRequest.getRawKvp()));
        if (param.contains(":")) {
            // going to replace composite param values for each frame in the KVP map
            String compositeParamKey = param.split(":")[0].toUpperCase();
            String simpleParamKey = param.split(":")[1].toUpperCase();
            List<String> kvps = null;
            if (rawKvp.get(compositeParamKey) != null) {
                kvps = KvpUtils.escapedTokens(rawKvp.get(compositeParamKey), ';');
                // purge old value
                Iterator<String> it = kvps.iterator();
                while (it.hasNext()) {
                    String k = it.next().toUpperCase();
                    if (k.toUpperCase().startsWith(simpleParamKey)) {
                        it.remove();
                    }
                }
            } else {
                kvps = new ArrayList<String>();
            }
            // insert the right one
            kvps.add(simpleParamKey + ":" + value);
            // merge back to the composite value
            rawKvp.remove(compositeParamKey);
            rawKvp.put(compositeParamKey, mergeParams(kvps));
        } else {
            // just a simple plain request parameter... replacing it on the KVP map
            // purge old value
            if (rawKvp.containsKey(param)) {
                rawKvp.remove(param);
            }
            // insert the frame one
            rawKvp.put(param, value);
        }
       
        // setting up the right RAW-KVP map for the single frame request
        request.setRawKvp(rawKvp);
       
View Full Code Here

        Map result = new HashMap();
        for (Iterator it = input.keySet().iterator(); it.hasNext();) {
            String key = (String) it.next();
            result.put(key.toUpperCase(), input.get(key));
        }
        return new CaseInsensitiveMap(result);
    }
View Full Code Here

    @Test
    public void testDispatchGetMapDoesntMatchTileCache() throws Exception {
        GetMapRequest request = new GetMapRequest();

        @SuppressWarnings("unchecked")
        Map<String, String> rawKvp = new CaseInsensitiveMap(new HashMap<String, String>());
        request.setRawKvp(rawKvp);

        rawKvp.put("layers", "more,than,one,layer");
        assertDispatchMismatch(request, "more than one layer requested");

        rawKvp.put("layers", "SomeNonCachedLayer");
        when(tld.getTileLayer(eq("SomeNonCachedLayer"))).thenThrow(
                new GeoWebCacheException("layer not found"));
        assertDispatchMismatch(request, "not a tile layer");

        rawKvp.put("layers", tileLayer.getName());

        request.setFormat("badFormat");
        assertDispatchMismatch(request, "not a GWC supported format");

        request.setFormat("image/gif");
View Full Code Here

    @Test
    public void testDispatchGetMapNonMatchingParameterFilter() throws Exception {
        GetMapRequest request = new GetMapRequest();

        @SuppressWarnings("unchecked")
        Map<String, String> rawKvp = new CaseInsensitiveMap(new HashMap<String, String>());
        request.setRawKvp(rawKvp);

        rawKvp.put("layers", tileLayer.getName());
        tileLayer.setEnabled(false);
        assertDispatchMismatch(request, "tile layer disabled");

        tileLayer.setEnabled(true);
        assertTrue(layer.enabled());

        request.setRemoteOwsURL(new URL("http://example.com"));
        assertDispatchMismatch(request, "remote OWS");
        request.setRemoteOwsURL(null);

        request.setRemoteOwsType("WFS");
        assertDispatchMismatch(request, "remote OWS");
        request.setRemoteOwsType(null);

        request.setEnv(ImmutableMap.of("envVar", "envValue"));
        assertDispatchMismatch(request, "no parameter filter exists for ENV");
        request.setEnv(null);

        request.setFormatOptions(ImmutableMap.of("optKey", "optVal"));
        assertDispatchMismatch(request, "no parameter filter exists for FORMAT_OPTIONS");
        request.setFormatOptions(null);

        request.setAngle(45);
        assertDispatchMismatch(request, "no parameter filter exists for ANGLE");
        request.setAngle(0);

        rawKvp.put("BGCOLOR", "0xAA0000");
        assertDispatchMismatch(request, "no parameter filter exists for BGCOLOR");
        rawKvp.remove("BGCOLOR");

        request.setBuffer(10);
        assertDispatchMismatch(request, "no parameter filter exists for BUFFER");
        request.setBuffer(0);
View Full Code Here

        TileLayerInfoUtil.updateAcceptAllRegExParameterFilter(tileLayerInfo, "TIME", true);
        tileLayer = new GeoServerTileLayer(layer, gridSetBroker, tileLayerInfo);

        GetMapRequest request = new GetMapRequest();
        @SuppressWarnings("unchecked")
        Map<String, String> rawKvp = new CaseInsensitiveMap(new HashMap<String, String>());
        request.setRawKvp(rawKvp);

        StringBuilder target = new StringBuilder();

        boolean cachingPossible;
View Full Code Here

    private void testMultipleCrsMatchingGridSubsets(final String srs, final String expectedGridset,
            long[] tileIndex) throws Exception {
        GetMapRequest request = new GetMapRequest();

        @SuppressWarnings("unchecked")
        Map<String, String> rawKvp = new CaseInsensitiveMap(new HashMap<String, String>());
        request.setRawKvp(rawKvp);
        request.setFormat("image/png");

        request.setSRS(srs);

        request.setWidth(256);
        request.setHeight(256);
        rawKvp.put("layers", "mockLayer");
        List<String> gridSetNames = Arrays.asList("GlobalCRS84Pixel", "GlobalCRS84Scale",
                "EPSG:4326");
        tileLayer = mockTileLayer("mockLayer", gridSetNames);

        // make the request match a tile in the expected gridset
View Full Code Here

TOP

Related Classes of org.geoserver.ows.util.CaseInsensitiveMap

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.