Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.DefaultHttpMethodRetryHandler


        params.setVersion(HttpVersion.HTTP_1_1);
        params.setConnectionManagerClass(SimpleHttpConnectionManager.class);
        params.setCookiePolicy(CookiePolicy.DEFAULT);
        params.setHttpElementCharset("US-ASCII");
        params.setContentCharset("ISO-8859-1");
        params.setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler());
       
        ArrayList datePatterns = new ArrayList();
        datePatterns.addAll(
            Arrays.asList(
                new String[] {
View Full Code Here


        params.setVersion(HttpVersion.HTTP_1_1);
        params.setConnectionManagerClass(SimpleHttpConnectionManager.class);
        params.setCookiePolicy(CookiePolicy.DEFAULT);
        params.setHttpElementCharset("US-ASCII");
        params.setContentCharset("ISO-8859-1");
        params.setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler());
       
        ArrayList datePatterns = new ArrayList();
        datePatterns.addAll(
            Arrays.asList(
                new String[] {
View Full Code Here

        }

        HttpClientParams clientParams = new HttpClientParams();
        clientParams.setAuthenticationPreemptive(isPreemptiveAuthentication());
        clientParams.setContentCharset(getContentCharSet());
        clientParams.setParameter(HttpClientParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(
                connectionRetryAttempts, false));

        HttpConnectionManagerParams connMgrParams = new HttpConnectionManagerParams();
        connMgrParams.setConnectionTimeout(getConnectionTimeout());
        connMgrParams.setDefaultMaxConnectionsPerHost(getMaxConnectionsPerHost());
View Full Code Here

        method.setRequestEntity(entity);
        boolean close = true;
        try {
            // Set the retry handler
            int retries = getConfiguration().isStreamingEnabled() ? 0 : getConfiguration().getRetryCount();
            method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(retries, true));
            // Set authentication
            if (endpoint.getBasicAuthentication() != null) {
                endpoint.getBasicAuthentication().applyCredentials(getClient(), exchange, nm);
            }
            // Execute the HTTP method
View Full Code Here

    private boolean isNetworkedResourceAvailable(String url) {
        HttpClient client = new HttpClient();
        GetMethod method = new GetMethod(url);
        client.getHttpConnectionManager().getParams().setConnectionTimeout(1000);
                method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
                                        new DefaultHttpMethodRetryHandler(1, false));

        try {
            int statusCode = client.executeMethod(method);
            if (statusCode != HttpStatus.SC_OK) {
                return false;
View Full Code Here

    private boolean isNetworkedResourceAvailable(String url) {
        HttpClient client = new HttpClient();
        GetMethod method = new GetMethod(url);
        client.getHttpConnectionManager().getParams().setConnectionTimeout(1000);
        method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
                                        new DefaultHttpMethodRetryHandler(1, false));

        try {
            int statusCode = client.executeMethod(method);
            if (statusCode != HttpStatus.SC_OK) {
                return false;
View Full Code Here

   
    // get content from yahoo, code from http://jakarta.apache.org/commons/httpclient/tutorial.html
    HttpClient client = new HttpClient();
    GetMethod method = new GetMethod(url);
    method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
          new DefaultHttpMethodRetryHandler(3, false));
    try {
      int statusCode = client.executeMethod(method);
      if (statusCode != HttpStatus.SC_OK) {
        System.err.println("Method failed: " + method.getStatusLine());
      }
View Full Code Here

        if ( httpClient == null )
        {
            httpClient = new HttpClient(new SimpleHttpConnectionManager());
            httpClient.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
                    new DefaultHttpMethodRetryHandler(RETRY_COUNT, false));
            if (log.isDebugEnabled()) {
                log.debug("Created new HttpClient: @"+System.identityHashCode(httpClient));
            }
            httpClient.setHostConfiguration(hc);
            map.put(hc, httpClient);
View Full Code Here

                InputStream inputStream = JXAextensionStream;
                if (HTTPConnection instanceof HttpClient) {
                    if (JXAenvUtils._debugSys) {
                        System.out.println("Connection with " + HTTPConnection.getClass().getCanonicalName() + " to " + src.toString());
                    }
                    getData.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(10, true));
                    int executeMethod;
                    try {
                        executeMethod = HTTPConnection.executeMethod(getData);
                        if (executeMethod != HttpStatus.SC_OK) {
                            JXAenvUtils._popExceptionToUser(false, Thread.currentThread(), new HttpException(JXAenvUtils.log("Error occured with HTTP GET connection to " + src, JXAenvUtils.LVL.APP_ERR)));
View Full Code Here

        }

        HttpClientParams clientParams = new HttpClientParams();
        clientParams.setAuthenticationPreemptive(isPreemptiveAuthentication());
        clientParams.setContentCharset(getContentCharSet());
        clientParams.setParameter(HttpClientParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(
                connectionRetryAttempts, false));

        HttpConnectionManagerParams connMgrParams = new HttpConnectionManagerParams();
        connMgrParams.setConnectionTimeout(getConnectionTimeout());
        connMgrParams.setDefaultMaxConnectionsPerHost(getMaxConnectionsPerHost());
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.DefaultHttpMethodRetryHandler

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.