Package org.geowebcache.layer.wms

Examples of org.geowebcache.layer.wms.WMSHttpHelper


        WMSCapabilities capabilities = wms.getCapabilities();
        if (capabilities == null) {
            throw new ConfigurationException("Unable to get capabitilies from " + wmsUrl);
        }

        WMSHttpHelper sourceHelper = new WMSHttpHelper();

        List<Layer> layerList = capabilities.getLayerList();
        Iterator<Layer> layerIter = layerList.iterator();

        while (layerIter.hasNext()) {
View Full Code Here


            } catch (MalformedURLException e) {
                log.error("could not parse proxy URL " + wl.getProxyUrl()
                        + " ! continuing WITHOUT proxy!", e);
            }

            final WMSHttpHelper sourceHelper;

            if (wl.getHttpUsername() != null) {
                sourceHelper = new WMSHttpHelper(wl.getHttpUsername(), wl.getHttpPassword(),
                        proxyUrl);
                log.debug("Using per-layer HTTP credentials for " + wl.getName() + ", "
                        + "username " + wl.getHttpUsername());
            } else if (gwcConfig.httpUsername != null) {
                sourceHelper = new WMSHttpHelper(gwcConfig.httpUsername, gwcConfig.httpPassword,
                        proxyUrl);
                log.debug("Using global HTTP credentials for " + wl.getName());
            } else {
                sourceHelper = new WMSHttpHelper(null, null, proxyUrl);
                log.debug("Not using HTTP credentials for " + wl.getName());
            }

            wl.setSourceHelper(sourceHelper);
        }
View Full Code Here

        if (!(layer.getSourceHelper() instanceof WMSHttpHelper)) {
            log.error("WMSRasterFilter can only be used with WMS layers.");
        }

        WMSHttpHelper srcHelper = (WMSHttpHelper) layer.getSourceHelper();

        GridSubset gridSet = layer.getGridSubset(gridSetId);

        int[] widthHeight = calculateWidthHeight(gridSet, z);

        String urlStr = layer.getWMSurl()[0];
        Map<String, String> requestParams = wmsParams(layer, gridSet, z, widthHeight);

        log.info("Updated WMS raster filter, zoom level " + z + " for " + getName() + " ("
                + layer.getName() + ") , " + urlStr);

        URL wmsUrl = new URL(urlStr);

        if (backendTimeout == null) {
            backendTimeout = 120;
        }

        GetMethod getMethod = null;
        BufferedImage img = null;

        try {
            getMethod = srcHelper.executeRequest(wmsUrl, requestParams, backendTimeout);

            if (getMethod.getStatusCode() != 200) {
                throw new GeoWebCacheException("Received response code "
                        + getMethod.getStatusCode() + "\n");
            }
View Full Code Here

        WMSCapabilities capabilities = wms.getCapabilities();
        if (capabilities == null) {
            throw new ConfigurationException("Unable to get capabitilies from " + wmsUrl);
        }

        WMSHttpHelper sourceHelper = new WMSHttpHelper();

        List<Layer> layerList = capabilities.getLayerList();
        Iterator<Layer> layerIter = layerList.iterator();

        while (layerIter.hasNext()) {
View Full Code Here

            } catch (MalformedURLException e) {
                log.error("could not parse proxy URL " + wl.getProxyUrl()
                        + " ! continuing WITHOUT proxy!", e);
            }

            final WMSHttpHelper sourceHelper;

            if (wl.getHttpUsername() != null) {
                sourceHelper = new WMSHttpHelper(wl.getHttpUsername(), wl.getHttpPassword(),
                        proxyUrl);
                log.debug("Using per-layer HTTP credentials for " + wl.getName() + ", "
                        + "username " + wl.getHttpUsername());
            } else if (gwcConfig.getHttpUsername() != null) {
                sourceHelper = new WMSHttpHelper(gwcConfig.getHttpUsername(),
                        gwcConfig.getHttpPassword(), proxyUrl);
                log.debug("Using global HTTP credentials for " + wl.getName());
            } else {
                sourceHelper = new WMSHttpHelper(null, null, proxyUrl);
                log.debug("Not using HTTP credentials for " + wl.getName());
            }

            wl.setSourceHelper(sourceHelper);
            wl.setLockProvider(gwcConfig.getLockProvider());
View Full Code Here

        if (!(layer.getSourceHelper() instanceof WMSHttpHelper)) {
            log.error("WMSRasterFilter can only be used with WMS layers.");
        }

        WMSHttpHelper srcHelper = (WMSHttpHelper) layer.getSourceHelper();

        GridSubset gridSet = layer.getGridSubset(gridSetId);

        int[] widthHeight = calculateWidthHeight(gridSet, z);

        String urlStr = layer.getWMSurl()[0];
        Map<String, String> requestParams = wmsParams(layer, gridSet, z, widthHeight);

        log.info("Updated WMS raster filter, zoom level " + z + " for " + getName() + " ("
                + layer.getName() + ") , " + urlStr);

        URL wmsUrl = new URL(urlStr);

        if (backendTimeout == null) {
            backendTimeout = 120;
        }

        GetMethod getMethod = null;
        BufferedImage img = null;

        try {
            getMethod = srcHelper.executeRequest(wmsUrl, requestParams, backendTimeout);

            if (getMethod.getStatusCode() != 200) {
                throw new GeoWebCacheException("Received response code "
                        + getMethod.getStatusCode() + "\n");
            }
View Full Code Here

TOP

Related Classes of org.geowebcache.layer.wms.WMSHttpHelper

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.