Class ClosedConnectionHttpClient
- java.lang.Object
-
- com.databricks.jdbc.dbclient.impl.http.ClosedConnectionHttpClient
-
- All Implemented Interfaces:
IDatabricksHttpClient
public final class ClosedConnectionHttpClient extends Object implements IDatabricksHttpClient
Sentinel HTTP client returned for connections that have been closed. All operations throwDatabricksHttpExceptionwith a clear message, so callers that accidentally store and use a post-close client get an immediate, diagnosable failure instead of a silent null.Symmetric with
NoopTelemetryClientwhich serves the same role for telemetry clients.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.http.client.methods.CloseableHttpResponseexecute(org.apache.http.client.methods.HttpUriRequest request)Executes the given http request and returns the responseorg.apache.http.client.methods.CloseableHttpResponseexecute(org.apache.http.client.methods.HttpUriRequest request, boolean supportGzipEncoding)Executes the given http request and returns the response<T> Future<T>executeAsync(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.concurrent.FutureCallback<T> callback)Executes the given http request asynchronously and returns the future
-
-
-
Method Detail
-
execute
public org.apache.http.client.methods.CloseableHttpResponse execute(org.apache.http.client.methods.HttpUriRequest request) throws DatabricksHttpExceptionDescription copied from interface:IDatabricksHttpClientExecutes the given http request and returns the response- Specified by:
executein interfaceIDatabricksHttpClient- Parameters:
request- underlying http request- Returns:
- http response
- Throws:
DatabricksHttpException
-
execute
public org.apache.http.client.methods.CloseableHttpResponse execute(org.apache.http.client.methods.HttpUriRequest request, boolean supportGzipEncoding) throws DatabricksHttpExceptionDescription copied from interface:IDatabricksHttpClientExecutes the given http request and returns the response- Specified by:
executein interfaceIDatabricksHttpClient- Parameters:
request- underlying http requestsupportGzipEncoding- whether to support gzip encoding header- Returns:
- http response
- Throws:
DatabricksHttpException
-
executeAsync
public <T> Future<T> executeAsync(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.concurrent.FutureCallback<T> callback)
Description copied from interface:IDatabricksHttpClientExecutes the given http request asynchronously and returns the future- Specified by:
executeAsyncin interfaceIDatabricksHttpClient- Type Parameters:
T- type of the response- Parameters:
requestProducer- request producerresponseConsumer- response consumercallback- future callback- Returns:
- future
-
-