Package org.geowebcache.util

Examples of org.geowebcache.util.HttpClientBuilder


     * @throws IOException
     */
    public GetMethod executeRequest(final URL url, final Map<String, String> queryParams,
            final Integer backendTimeout) throws HttpException, IOException {

        HttpClientBuilder builder = new HttpClientBuilder(url, backendTimeout, httpUsername,
                httpPassword, proxyUrl);
        HttpClient httpClient = builder.buildClient();

        GetMethod getMethod = new GetMethod(url.toString());
        if (queryParams != null && queryParams.size() > 0) {
            NameValuePair[] params = new NameValuePair[queryParams.size()];
            int i = 0;
            for (Map.Entry<String, String> e : queryParams.entrySet()) {
                params[i] = new NameValuePair(e.getKey(), e.getValue());
                i++;
            }
            getMethod.setQueryString(params);
        }
        getMethod.setDoAuthentication(builder.isDoAuthentication());

        httpClient.executeMethod(getMethod);
        return getMethod;
    }
View Full Code Here


        if (log.isDebugEnabled()) {
            log.debug("Creating GeoRSS reader for URL " + url.toExternalForm() + " with user "
                    + username);
        }

        HttpClientBuilder builder = new HttpClientBuilder();
        builder.setHttpCredentials(username, password, url);
        builder.setBackendTimeout(120);

        HttpClient httpClient = builder.buildClient();

        GetMethod getMethod = new GetMethod(url.toString());
        if (builder.isDoAuthentication()) {
            getMethod.setDoAuthentication(true);
            httpClient.getParams().setAuthenticationPreemptive(true);
        }

        if (log.isDebugEnabled()) {
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("Creating GeoRSS reader for URL " + url.toExternalForm() + " with user "
                    + username);
        }

        HttpClientBuilder builder = new HttpClientBuilder();
        builder.setHttpCredentials(username, password, url);
        builder.setBackendTimeout(120);

        HttpClient httpClient = builder.buildClient();

        GetMethod getMethod = new GetMethod(url.toString());
        getMethod.setRequestHeader("Connection", "close");
        if (builder.isDoAuthentication()) {
            getMethod.setDoAuthentication(true);
            httpClient.getParams().setAuthenticationPreemptive(true);
        }

        if (log.isDebugEnabled()) {
View Full Code Here

            synchronized (this) {
                if(client != null) {
                    return client;
                }
               
                HttpClientBuilder builder = new HttpClientBuilder(null, getBackendTimeout(), httpUsername,
                        httpPassword, proxyUrl, getConcurrency());   
                doAuthentication = builder.isDoAuthentication();
                client = builder.buildClient();
            }
        }
       
        return client;
    }
View Full Code Here

TOP

Related Classes of org.geowebcache.util.HttpClientBuilder

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.