Search in sources :

Example 26 with HttpHostConnectException

use of org.apache.http.conn.HttpHostConnectException in project OpenTripPlanner by opentripplanner.

the class AnalystWorker method getSomeWork.

public List<AnalystClusterRequest> getSomeWork(WorkType type) {
    // Run a POST request (long-polling for work) indicating which graph this worker prefers to work on
    String url;
    if (type == WorkType.HIGH_PRIORITY) {
        // this is a side-channel request for single point work
        url = BROKER_BASE_URL + "/single/" + graphId;
    } else {
        url = BROKER_BASE_URL + "/dequeue/" + graphId;
    }
    HttpPost httpPost = new HttpPost(url);
    httpPost.setHeader(new BasicHeader(WORKER_ID_HEADER, machineId));
    HttpResponse response = null;
    try {
        response = httpClient.execute(httpPost);
        HttpEntity entity = response.getEntity();
        if (entity == null) {
            return null;
        }
        if (response.getStatusLine().getStatusCode() != 200) {
            EntityUtils.consumeQuietly(entity);
            return null;
        }
        return objectMapper.readValue(entity.getContent(), new TypeReference<List<AnalystClusterRequest>>() {
        });
    } catch (JsonProcessingException e) {
        LOG.error("JSON processing exception while getting work", e);
    } catch (SocketTimeoutException stex) {
        LOG.error("Socket timeout while waiting to receive work.");
    } catch (HttpHostConnectException ce) {
        LOG.error("Broker refused connection. Sleeping before retry.");
        try {
            Thread.currentThread().sleep(5000);
        } catch (InterruptedException e) {
        }
    } catch (IOException e) {
        LOG.error("IO exception while getting work", e);
    }
    return null;
}
Also used : HttpPost(org.apache.http.client.methods.HttpPost) SocketTimeoutException(java.net.SocketTimeoutException) HttpEntity(org.apache.http.HttpEntity) HttpHostConnectException(org.apache.http.conn.HttpHostConnectException) HttpResponse(org.apache.http.HttpResponse) List(java.util.List) IOException(java.io.IOException) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) BasicHeader(org.apache.http.message.BasicHeader)

Example 27 with HttpHostConnectException

use of org.apache.http.conn.HttpHostConnectException in project bboss-elastic by bbossgroups.

the class ElasticSearchRestClient method execute.

public String execute(final String entity, String options) throws ElasticSearchException {
    String endpoint = BULK_ENDPOINT;
    if (options != null) {
        endpoint = new StringBuilder().append(endpoint).append("?").append(options).toString();
    }
    final ESStringResponseHandler responseHandler = new ESStringResponseHandler();
    return _executeHttp(endpoint, responseHandler, new ExecuteRequest() {

        @Override
        public Object execute(ESAddress host, String url, int triesCount) throws Exception {
            Object response = null;
            if (showTemplate) {
                if (logger.isInfoEnabled()) {
                    logger.info("ElasticSearch http request endpoint:{},retry:{},request body:\n{}", url, triesCount, entity);
                }
            }
            response = restSeachExecutor.execute(url, entity, responseHandler);
            return response;
        }
    });
/**
 *		int triesCount = 0;
 *		String response = null;
 *		Throwable e = null;
 *		ESAddress host = null;
 *		String url = null;
 *
 *		while (true) {
 *
 *			try {
 *				host = serversList.get(failAllContinue || !this.healthCheckEnabled());
 *				url = new StringBuilder().append(host.getAddress()).append( "/" ).append( endpoint).toString();
 *
 *//				response = HttpRequestUtil.sendJsonBody(httpPool,entity, url, this.headers);
 *				if(this.showTemplate ){
 *					if(logger.isInfoEnabled()) {
 *						logger.info("ElasticSearch http request endpoint:{},retry:{},request body:\n{}",url,triesCount,entity);
 *					}
 *
 *				}
 *				ESStringResponseHandler responseHandler = new ESStringResponseHandler();
 *				response = restSeachExecutor.execute(url,entity,responseHandler);
 *				e = getException(  responseHandler );
 *				break;
 *			}
 *			catch (HttpHostConnectException ex) {
 *				host.setStatus(1);
 *				e = new NoServerElasticSearchException(ex);
 *				if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *
 *            } catch (UnknownHostException ex) {
 *            	host.setStatus(1);
 *				e = new NoServerElasticSearchException(ex);
 *            	if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *
 *            }
 *			catch (NoRouteToHostException ex) {
 *				host.setStatus(1);
 *				e = new NoServerElasticSearchException(ex);
 *				if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *
 *			}
 *			catch (NoHttpResponseException ex) {
 *				host.setStatus(1);
 *				e = new NoServerElasticSearchException(ex);
 *				if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *
 *			}
 *			catch (ConnectionPoolTimeoutException ex){//连接池获取connection超时,直接抛出
 *
 *				e = handleConnectionPoolTimeOutException( ex);
 *				break;
 *			}
 *            catch (ConnectTimeoutException connectTimeoutException){
 *				host.setStatus(1);
 *				e = handleConnectionTimeOutException(connectTimeoutException);
 *				if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *			}
 *//			catch (IOException ex) {
 *//				host.setStatus(1);
 *//				if (triesCount < serversList.size()) {//失败尝试下一个地址
 *//					triesCount++;
 *//					e = ex;
 *//					continue;
 *//				} else {
 *//					e = ex;
 *//					break;
 *//				}
 *//
 *//            }
 *			catch (SocketTimeoutException ex) {
 *				e = handleSocketTimeoutException( ex);
 *				break;
 *			}
 *			catch (NoServerElasticSearchException ex){
 *				e = ex;
 *
 *				break;
 *			}
 *			catch (ClientProtocolException ex){
 *				host.setStatus(1);
 *				e = ex;
 *				if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *				//throw new ElasticSearchException(new StringBuilder().append("Request[").append(url).append("] handle failed: must use http/https protocol port such as 9200,do not use transport such as 9300.").toString(),ex);
 *			}
 *			catch (ElasticSearchException ex) {
 *				e = ex;
 *				break;
 *			}
 *			catch (Exception ex) {
 *				e = ex;
 *				break;
 *			}
 *			catch (Throwable ex) {
 *				e = ex;
 *				break;
 *			}
 *
 *		}
 *		if (e != null){
 *			if(e instanceof ElasticSearchException)
 *				throw (ElasticSearchException)e;
 *			throw new ElasticSearchException(e);
 *		}
 *		return response;
 */
}
Also used : ESStringResponseHandler(org.frameworkset.elasticsearch.handler.ESStringResponseHandler) ClientProtocolException(org.apache.http.client.ClientProtocolException) ConnectionPoolTimeoutException(org.apache.http.conn.ConnectionPoolTimeoutException) NoHttpResponseException(org.apache.http.NoHttpResponseException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) HttpHostConnectException(org.apache.http.conn.HttpHostConnectException) ConnectTimeoutException(org.apache.http.conn.ConnectTimeoutException) SocketTimeoutException(java.net.SocketTimeoutException) NoRouteToHostException(java.net.NoRouteToHostException)

Example 28 with HttpHostConnectException

use of org.apache.http.conn.HttpHostConnectException in project bboss-elastic by bbossgroups.

the class ElasticSearchRestClient method executeRequest.

public String executeRequest(String path, final String entity) throws ElasticSearchException {
    final ESStringResponseHandler responseHandler = new ESStringResponseHandler();
    return _executeHttp(path, responseHandler, new ExecuteRequest() {

        @Override
        public Object execute(ESAddress host, String url, int triesCount) throws Exception {
            Object response = null;
            if (showTemplate) {
                if (logger.isInfoEnabled()) {
                    if (entity != null)
                        logger.info("ElasticSearch http request endpoint:{},retry:{},request body:\n{}", url, triesCount, entity);
                    else
                        logger.info("ElasticSearch http request endpoint:{},retry:{}", url, triesCount);
                }
            }
            response = restSeachExecutor.executeSimpleRequest(url, entity, responseHandler);
            return response;
        }
    });
/**
 *		int triesCount = 0;
 *		String response = null;
 *		Throwable e = null;
 *
 *		ESAddress host = null;
 *		String url = null;
 *		while (true) {
 *
 *			try {
 *				host = serversList.get(!healthCheckEnabled());
 *				url =  getPath(host.getAddress(),path);
 *//				if (entity == null)
 *//					response = HttpRequestUtil.httpPostforString(url, null, this.headers);
 *//				else
 *//					response = HttpRequestUtil.sendJsonBody(entity, url, this.headers);
 *				if(this.showTemplate ){
 *					if(logger.isInfoEnabled()) {
 *						if(entity != null)
 *							logger.info("ElasticSearch http request endpoint:{},retry:{},request body:\n{}",url,triesCount,entity);
 *						else
 *							logger.info("ElasticSearch http request endpoint:{},retry:{}",url,triesCount);
 *					}
 *				}
 *				ESStringResponseHandler responseHandler = new ESStringResponseHandler();
 *				response = this.restSeachExecutor.executeSimpleRequest(url,entity,responseHandler);
 *				e = getException(  responseHandler );
 *				break;
 *			}
 *
 *			catch (HttpHostConnectException ex) {
 *				host.setStatus(1);
 *				e = new NoServerElasticSearchException(ex);
 *				if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *
 *            } catch (UnknownHostException ex) {
 *            	host.setStatus(1);
 *				e = new NoServerElasticSearchException(ex);
 *            	if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *
 *            }
 *			catch (NoRouteToHostException ex) {
 *				host.setStatus(1);
 *				e = new NoServerElasticSearchException(ex);
 *				if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *
 *			}
 *
 *			catch (NoHttpResponseException ex) {
 *				host.setStatus(1);
 *				e = new NoServerElasticSearchException(ex);
 *				if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *
 *			}
 *			catch (ConnectionPoolTimeoutException ex){//连接池获取connection超时,直接抛出
 *
 *				e = handleConnectionPoolTimeOutException( ex);
 *				break;
 *			}
 *			catch (ConnectTimeoutException connectTimeoutException){
 *				host.setStatus(1);
 *				e = handleConnectionTimeOutException(connectTimeoutException);
 *				if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *			}
 *//			catch (IOException ex) {
 *//				host.setStatus(1);
 *//				if (triesCount < serversList.size()) {//失败尝试下一个地址
 *//					triesCount++;
 *//					e = ex;
 *//					continue;
 *//				} else {
 *//					e = ex;
 *//					break;
 *//				}
 *//
 *//            }
 *			catch (SocketTimeoutException ex) {
 *				e = handleSocketTimeoutException( ex);
 *				break;
 *			}
 *			catch (NoServerElasticSearchException ex){
 *					e = ex;
 *				break;
 *			}
 *			catch (ClientProtocolException ex){
 *				host.setStatus(1);
 *				e = ex;
 *				if (triesCount < serversList.size() - 1) {//失败尝试下一个地址
 *					triesCount++;
 *					continue;
 *				} else {
 *					break;
 *				}
 *//				throw new ElasticSearchException(new StringBuilder().append("Request[").append(url).append("] handle failed: must use http/https protocol port such as 9200,do not use transport such as 9300.").toString(),ex);
 *			}
 *			catch (ElasticSearchException ex) {
 *				throw ex;
 *			}
 *
 *			catch (Exception ex) {
 *				e = ex;
 *				break;
 *			}
 *			catch (Throwable ex) {
 *				e = ex;
 *				break;
 *			}
 *		}
 *		if (e != null){
 *			throw new ElasticSearchException(e);
 *		}
 *		return response;
 */
}
Also used : ESStringResponseHandler(org.frameworkset.elasticsearch.handler.ESStringResponseHandler) ClientProtocolException(org.apache.http.client.ClientProtocolException) ConnectionPoolTimeoutException(org.apache.http.conn.ConnectionPoolTimeoutException) NoHttpResponseException(org.apache.http.NoHttpResponseException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) HttpHostConnectException(org.apache.http.conn.HttpHostConnectException) ConnectTimeoutException(org.apache.http.conn.ConnectTimeoutException) SocketTimeoutException(java.net.SocketTimeoutException) NoRouteToHostException(java.net.NoRouteToHostException)

Example 29 with HttpHostConnectException

use of org.apache.http.conn.HttpHostConnectException in project XPrivacy by M66B.

the class Util method bug.

public static void bug(XHook hook, Throwable ex) {
    if (ex instanceof InvocationTargetException) {
        InvocationTargetException exex = (InvocationTargetException) ex;
        if (exex.getTargetException() != null)
            ex = exex.getTargetException();
    }
    int priority;
    if (ex instanceof ActivityShare.AbortException)
        priority = Log.WARN;
    else if (ex instanceof ActivityShare.ServerException)
        priority = Log.WARN;
    else if (ex instanceof ConnectTimeoutException)
        priority = Log.WARN;
    else if (ex instanceof FileNotFoundException)
        priority = Log.WARN;
    else if (ex instanceof HttpHostConnectException)
        priority = Log.WARN;
    else if (ex instanceof NameNotFoundException)
        priority = Log.WARN;
    else if (ex instanceof NoClassDefFoundError)
        priority = Log.WARN;
    else if (ex instanceof OutOfMemoryError)
        priority = Log.WARN;
    else if (ex instanceof RuntimeException)
        priority = Log.WARN;
    else if (ex instanceof SecurityException)
        priority = Log.WARN;
    else if (ex instanceof SocketTimeoutException)
        priority = Log.WARN;
    else if (ex instanceof SSLPeerUnverifiedException)
        priority = Log.WARN;
    else if (ex instanceof StackOverflowError)
        priority = Log.WARN;
    else if (ex instanceof TransactionTooLargeException)
        priority = Log.WARN;
    else if (ex instanceof UnknownHostException)
        priority = Log.WARN;
    else if (ex instanceof UnsatisfiedLinkError)
        priority = Log.WARN;
    else
        priority = Log.ERROR;
    boolean xprivacy = false;
    for (StackTraceElement frame : ex.getStackTrace()) if (frame.getClassName() != null && frame.getClassName().startsWith("biz.bokhorst.xprivacy")) {
        xprivacy = true;
        break;
    }
    if (!xprivacy)
        priority = Log.WARN;
    log(hook, priority, ex.toString() + " uid=" + Process.myUid() + "\n" + Log.getStackTraceString(ex));
}
Also used : UnknownHostException(java.net.UnknownHostException) NameNotFoundException(android.content.pm.PackageManager.NameNotFoundException) SSLPeerUnverifiedException(javax.net.ssl.SSLPeerUnverifiedException) FileNotFoundException(java.io.FileNotFoundException) InvocationTargetException(java.lang.reflect.InvocationTargetException) SuppressLint(android.annotation.SuppressLint) RuntimeException(java.lang.RuntimeException) SocketTimeoutException(java.net.SocketTimeoutException) HttpHostConnectException(org.apache.http.conn.HttpHostConnectException) TransactionTooLargeException(android.os.TransactionTooLargeException) StackOverflowError(java.lang.StackOverflowError) ConnectTimeoutException(org.apache.http.conn.ConnectTimeoutException)

Example 30 with HttpHostConnectException

use of org.apache.http.conn.HttpHostConnectException in project Talon-for-Twitter by klinker24.

the class TweetMarkerHelper method getLastStatus.

public boolean getLastStatus(String collection, final Context context) {
    long currentId = sharedPrefs.getLong("current_position_" + currentAccount, 0l);
    boolean updated = false;
    try {
        long startTime = Calendar.getInstance().getTimeInMillis();
        HttpGet get = new HttpGet(postURL + "&" + collection);
        get.addHeader("X-Auth-Service-Provider", SERVICE_PROVIDER);
        get.addHeader("X-Verify-Credentials-Authorization", getAuthrityHeader(twitter));
        HttpClient client = new DefaultHttpClient();
        HttpResponse response = client.execute(get);
        Log.v("talon_tweetmarker", "getting id response code: " + response.getStatusLine().getStatusCode() + " for " + screenname);
        long endTime = Calendar.getInstance().getTimeInMillis();
        StatusLine statusLine = response.getStatusLine();
        final long responseTime = endTime - startTime;
        if (endTime - startTime > 15000 && statusLine.getStatusCode() == 200) {
            ((Activity) context).runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    try {
                        if (sharedPrefs.getBoolean("show_tweetmarker_length", true)) {
                            new AlertDialog.Builder(context).setTitle("Slow TweetMarker Fetch").setMessage("TweetMarker successfully fetched it's position, but seemed to take quite a bit of time. " + "They may be experiencing issues at the moment, you may want to try again in a little while! \n\n" + "Server Response Time: " + (responseTime / 1000) + " seconds").setPositiveButton("Turn Off TM", new DialogInterface.OnClickListener() {

                                @Override
                                public void onClick(DialogInterface dialog, int which) {
                                    sharedPrefs.edit().putString("tweetmarker_options", "0").commit();
                                    AppSettings.invalidate();
                                }
                            }).setNeutralButton(R.string.dont_show_again, new DialogInterface.OnClickListener() {

                                @Override
                                public void onClick(DialogInterface dialog, int which) {
                                    sharedPrefs.edit().putBoolean("show_tweetmarker_length", false).commit();
                                    dialog.dismiss();
                                }
                            }).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {

                                @Override
                                public void onClick(DialogInterface dialog, int which) {
                                    dialog.dismiss();
                                }
                            }).create().show();
                        }
                    } catch (Exception e) {
                    }
                }
            });
        }
        if (statusLine.getStatusCode() == 500 || statusLine.getStatusCode() == 503) {
            // common tweetmarker failure codes
            final StatusLine s = statusLine;
            ((Activity) context).runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    try {
                        new AlertDialog.Builder(context).setTitle("TweetMarker Failure").setMessage("Error: " + s.getStatusCode() + "(" + s.getReasonPhrase() + ")" + "\n\n" + "TweetMarker has been experiencing some issues on their end lately with some apps. They seem intermittent, random, and are causing incredibly slow load times." + "I have been in contact with them, but I would recommend turning off this feature until these issues are resolved.").setPositiveButton("Turn Off TM", new DialogInterface.OnClickListener() {

                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                sharedPrefs.edit().putString("tweetmarker_options", "0").commit();
                                AppSettings.invalidate();
                            }
                        }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {

                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                dialog.dismiss();
                            }
                        }).create().show();
                    } catch (Exception e) {
                    }
                }
            });
            updated = false;
        } else if (statusLine.getStatusCode() == 200) {
            // request ok
            BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
            String line;
            StringBuilder builder = new StringBuilder();
            while ((line = rd.readLine()) != null) {
                builder.append(line);
            }
            JSONObject jsonObject = new JSONObject(builder.toString());
            JSONObject timeline = jsonObject.getJSONObject(collection);
            if (timeline != null) {
                currentId = Long.parseLong(timeline.getString("id"));
                int version = Integer.parseInt(timeline.getString("version"));
                Log.v("talon_tweetmarker", "getting tweetmarker," + " version: " + version + " id: " + currentId + " screename: " + screenname);
                int lastVer = sharedPrefs.getInt("last_version_account_" + currentAccount, 0);
                if (lastVer != version) {
                    updated = true;
                }
                sharedPrefs.edit().putInt("last_version_account_" + currentAccount, version).commit();
            }
        } else {
            // wait first
            try {
                Thread.sleep(1500);
            } catch (InterruptedException e) {
            }
            response = client.execute(get);
            statusLine = response.getStatusLine();
            if (statusLine.getStatusCode() == 200) {
                // request ok
                BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
                String line;
                StringBuilder builder = new StringBuilder();
                while ((line = rd.readLine()) != null) {
                    builder.append(line);
                }
                JSONObject jsonObject = new JSONObject(builder.toString());
                JSONObject timeline = jsonObject.getJSONObject(collection);
                if (timeline != null) {
                    currentId = Long.parseLong(timeline.getString("id"));
                    int version = Integer.parseInt(timeline.getString("version"));
                    Log.v("talon_tweetmarker", "getting tweetmarker," + " version: " + version + " id: " + currentId + " screename: " + screenname);
                    int lastVer = sharedPrefs.getInt("last_version_account_" + currentAccount, 0);
                    if (lastVer != version) {
                        updated = true;
                    }
                    sharedPrefs.edit().putInt("last_version_account_" + currentAccount, version).commit();
                }
            }
        }
    } catch (HttpHostConnectException e) {
        // timeout when connecting to host.
        ((Activity) context).runOnUiThread(new Runnable() {

            @Override
            public void run() {
                try {
                    new AlertDialog.Builder(context).setTitle("TweetMarker Failure").setMessage("Timeout connecting to TweetMarker." + "\n\n" + "TweetMarker has been experiencing some issues on their end lately with some apps. They seem intermittent, random, and are causing incredibly slow load times." + "I have been in contact with them, but I would recommend turning off this feature until these issues are resolved.").setPositiveButton("Turn Off TM", new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            sharedPrefs.edit().putString("tweetmarker_options", "0").commit();
                            AppSettings.invalidate();
                        }
                    }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();
                        }
                    }).create().show();
                } catch (Exception e) {
                }
            }
        });
    } catch (Exception e) {
        e.printStackTrace();
    } catch (OutOfMemoryError e) {
    }
    Log.v("talon_launcher_stuff", "writing " + currentId + " to shared prefs");
    sharedPrefs.edit().putLong("current_position_" + currentAccount, currentId).commit();
    if (contentProvider) {
        HomeContentProvider.updateCurrent(currentAccount, context, currentId);
    } else {
        try {
            HomeDataSource.getInstance(context).markPosition(currentAccount, currentId);
        } catch (Exception e) {
        }
    }
    return updated;
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) HttpGet(org.apache.http.client.methods.HttpGet) Activity(android.app.Activity) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) HttpHostConnectException(org.apache.http.conn.HttpHostConnectException) InputStreamReader(java.io.InputStreamReader) HttpResponse(org.apache.http.HttpResponse) HttpHostConnectException(org.apache.http.conn.HttpHostConnectException) StatusLine(org.apache.http.StatusLine) JSONObject(org.json.JSONObject) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) HttpClient(org.apache.http.client.HttpClient) BufferedReader(java.io.BufferedReader)

Aggregations

HttpHostConnectException (org.apache.http.conn.HttpHostConnectException)37 ConnectTimeoutException (org.apache.http.conn.ConnectTimeoutException)11 IOException (java.io.IOException)10 ConnectException (java.net.ConnectException)10 SocketTimeoutException (java.net.SocketTimeoutException)10 Socket (java.net.Socket)7 HttpResponse (org.apache.http.HttpResponse)6 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)6 LayeredSocketFactory (org.apache.http.conn.scheme.LayeredSocketFactory)6 Scheme (org.apache.http.conn.scheme.Scheme)6 Test (org.junit.Test)5 InputStream (java.io.InputStream)4 GenericUrl (com.google.api.client.http.GenericUrl)3 InetAddress (java.net.InetAddress)3 NoRouteToHostException (java.net.NoRouteToHostException)3 SocketException (java.net.SocketException)3 UnknownHostException (java.net.UnknownHostException)3 HttpEntity (org.apache.http.HttpEntity)3 HttpHost (org.apache.http.HttpHost)3 ClientProtocolException (org.apache.http.client.ClientProtocolException)3