use of jp.ossc.nimbus.service.http.httpclient.HttpClientSocketTimeoutException in project nimbus by nimbus-org.
the class HttpKeepAliveCheckerService method checkAlive.
public boolean checkAlive() throws Exception {
HttpClient client = httpClientFactory.createHttpClient();
HttpRequest request = httpClientFactory.createRequest(checkTargetRequestName);
try {
HttpResponse response = client.executeRequest(request);
if (response.getStatusCode() == 200) {
if (assertString != null) {
String responseBody = (String) response.getObject();
if (assertString.equals(responseBody)) {
return true;
}
} else {
return true;
}
}
} catch (HttpClientConnectTimeoutException e) {
} catch (HttpClientSocketTimeoutException e) {
}
return false;
}
Aggregations