Package com.volantis.shared.net.http.client

Examples of com.volantis.shared.net.http.client.HttpClientFactory


    /**
     * Prepare HTTPClient for request,
     * Set headers if are pass in parameters
     */
    private HttpClient prepareHttpClient() {
        HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        HttpClientBuilder builder = factory.createClientBuilder();
        builder.setConnectionTimeout(CONNECTION_TIMEOUT);
        builder.setRoundTripTimeout(ROUNDTRIP_TIMEOUT);
        return builder.buildHttpClient();
    }
View Full Code Here


            final XMLPipelineContext xmlPipelineContext) throws HTTPException {

        final HttpState state = new HttpState();
        state.setCookiePolicy(CookiePolicy.COMPATIBILITY);

        HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        HttpClientBuilder builder = factory.createClientBuilder();
        builder.setState(state);
        builder.setConnectionTimeout(timeout);
        builder.setRoundTripTimeout(timeout);

        // create the HTTPClient instance.
View Full Code Here

    public HttpContent retrieve(final URL url, final Period timeout,
                               final HttpUrlConfiguration httpConfig)
            throws IOException {
        // Create a HTTP Client which will timeout connections and round trips
        // in the specified period.
        final HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        final HttpClientBuilder builder = factory.createClientBuilder();
        builder.setConnectionTimeout(timeout);
        builder.setRoundTripTimeout(timeout);
        final HttpClient httpClient = builder.buildHttpClient();

        final GetMethod method = new GetMethod(url.toExternalForm());
View Full Code Here

    public HttpGetMethod createGetMethod(String url) {

        GetMethod method = new GetMethod(url);
        method.setHttp11(false);

        HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        HttpClientBuilder builder = factory.createClientBuilder();
        builder.setConnectionTimeout(connectionTimeout);
        builder.setRoundTripTimeout(connectionTimeout);
        HttpClient httpClient = builder.buildHttpClient();

        URL netURL = null;
View Full Code Here

            } else {
                method.addRequestHeader("Host",
                        url.getHost() + ":" + url.getPort());
            }

            HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
            HttpClientBuilder builder = factory.createClientBuilder();
            HttpClient httpClient = builder.buildHttpClient();
            httpClient.executeMethod(method);
        }
        return method;
    }
View Full Code Here

TOP

Related Classes of com.volantis.shared.net.http.client.HttpClientFactory

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.