Package org.apache.http.impl.client

Examples of org.apache.http.impl.client.StandardHttpRequestRetryHandler


                             cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND));
    }

    private String waitForHttp(URI uri) {
        SystemDefaultHttpClient client = new SystemDefaultHttpClient();
        client.setHttpRequestRetryHandler(new StandardHttpRequestRetryHandler(3, false));
        HttpContext localContext = new BasicHttpContext();
        HttpUriRequest httpRequest = new HttpHead(uri);
        HttpResponse httpResponse = null;

        httpResponse = head(client, httpRequest, localContext);
View Full Code Here


    public synchronized HttpClient getHttpClient() {
      if (this.httpClient == null) {
            SystemDefaultHttpClient httpClient = new SystemDefaultHttpClient();
            // Provide custom retry handler is necessary
            httpClient.setHttpRequestRetryHandler(new StandardHttpRequestRetryHandler(3, false));
            return this.httpClient = httpClient;
      } else {
        return httpClient;
      }
    }
View Full Code Here

    builder.getRequestConfigBuilder().setSocketTimeout(timeout);

    // obey the given retries count and apply it to client.
    int retries = context.getRemoteConnectionSettings() != null ? context.getRemoteConnectionSettings()
        .getRetrievalRetryCount() : 0;
    builder.getHttpClientBuilder().setRetryHandler(new StandardHttpRequestRetryHandler(retries, false));

    applyAuthenticationConfig(builder, context.getRemoteAuthenticationSettings(), null);
    applyProxyConfig(builder, context.getRemoteProxySettings());

    // Apply optional context-specific user-agent suffix
View Full Code Here

    // obey the given retries count and apply it to client.
    int retries = 0;
    if (config.getConnectionConfig() != null && config.getConnectionConfig().getRetries() != null) {
      retries = config.getConnectionConfig().getRetries();
    }
    builder.getHttpClientBuilder().setRetryHandler(new StandardHttpRequestRetryHandler(retries, false));

    applyAuthenticationConfig(builder, config.getAuthenticationConfig(), null);
    applyProxyConfig(builder, config);

    // Apply optional context-specific user-agent suffix
View Full Code Here

TOP

Related Classes of org.apache.http.impl.client.StandardHttpRequestRetryHandler

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.