Tabnine Logo
CouldNotConnectException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
io.searchbox.client.config.exception.CouldNotConnectException
constructor

Best Java code snippets using io.searchbox.client.config.exception.CouldNotConnectException.<init> (Showing top 5 results out of 315)

origin: searchbox-io/Jest

@Override
public void failed(final Exception ex) {
  log.error("Exception occurred during async execution.", ex);
  if (ex instanceof HttpHostConnectException) {
    String host = ((HttpHostConnectException) ex).getHost().toURI();
    resultHandler.failed(new CouldNotConnectException(host, ex));
    return;
  }
  resultHandler.failed(ex);
}
origin: searchbox-io/Jest

public <T extends JestResult> T execute(Action<T> clientRequest, RequestConfig requestConfig) throws IOException {
  HttpUriRequest request = prepareRequest(clientRequest, requestConfig);
  CloseableHttpResponse response = null;
  try {
    response = executeRequest(request);
    return deserializeResponse(response, request, clientRequest);
  } catch (HttpHostConnectException ex) {
    throw new CouldNotConnectException(ex.getHost().toURI(), ex);
  } finally {
    if (response != null) {
      try {
        response.close();
      } catch (IOException ex) {
        log.error("Exception occurred while closing response stream.", ex);
      }
    }
  }
}
origin: searchbox-io/Jest

public <T extends JestResult> T execute(Action<T> clientRequest, RequestConfig requestConfig) throws IOException {
  String elasticSearchRestUrl = getRequestURL(getNextServer(), clientRequest.getURI(ElasticsearchVersion.UNKNOWN));
  HttpUriRequest request = constructHttpMethod(clientRequest.getRestMethodName(), elasticSearchRestUrl, clientRequest.getData(gson), requestConfig);
  // add headers added to action
  if (!clientRequest.getHeaders().isEmpty()) {
    for (Map.Entry<String, Object> header : clientRequest.getHeaders().entrySet()) {
      request.addHeader(header.getKey(), header.getValue().toString());
    }
  }
  try {
    HttpResponse response = httpClient.execute(request);
    return deserializeResponse(response, clientRequest);
  } catch (HttpHostConnectException ex) {
    throw new CouldNotConnectException(ex.getHost().toURI(), ex);
  }
}
origin: io.searchbox/jest

@Override
public void failed(final Exception ex) {
  log.error("Exception occurred during async execution.", ex);
  if (ex instanceof HttpHostConnectException) {
    String host = ((HttpHostConnectException) ex).getHost().toURI();
    resultHandler.failed(new CouldNotConnectException(host, ex));
    return;
  }
  resultHandler.failed(ex);
}
origin: io.searchbox/jest

public <T extends JestResult> T execute(Action<T> clientRequest, RequestConfig requestConfig) throws IOException {
  HttpUriRequest request = prepareRequest(clientRequest, requestConfig);
  CloseableHttpResponse response = null;
  try {
    response = executeRequest(request);
    return deserializeResponse(response, request, clientRequest);
  } catch (HttpHostConnectException ex) {
    throw new CouldNotConnectException(ex.getHost().toURI(), ex);
  } finally {
    if (response != null) {
      try {
        response.close();
      } catch (IOException ex) {
        log.error("Exception occurred while closing response stream.", ex);
      }
    }
  }
}
io.searchbox.client.config.exceptionCouldNotConnectException<init>

Popular methods of CouldNotConnectException

  • getHost

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • getContentResolver (Context)
  • getExternalFilesDir (Context)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Permission (java.security)
    Legacy security code; do not use.
  • Collectors (java.util.stream)
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JButton (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now