Class HttpAPIClientHelper
java.lang.Object
com.clickhouse.client.api.internal.HttpAPIClientHelper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass -
Constructor Summary
ConstructorsConstructorDescriptionHttpAPIClientHelper(Map<String, String> configuration, Object metricsRegistry, boolean initSslContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.apache.hc.client5.http.impl.classic.CloseableHttpClientcreateHttpClient(boolean initSslContext) Creates or returns default SSL context.org.apache.hc.core5.http.ClassicHttpResponseexecuteRequest(ClickHouseNode server, Map<String, Object> requestConfig, org.apache.hc.core5.io.IOCallback<OutputStream> writeCallback) static intgetHeaderInt(org.apache.hc.core5.http.Header header, int defaultValue) static StringgetHeaderVal(org.apache.hc.core5.http.Header header, String defaultValue) static <T> TgetHeaderVal(org.apache.hc.core5.http.Header header, T defaultValue, Function<String, T> converter) parseUrlParameters(URL url) Parses URL parameters.readError(org.apache.hc.core5.http.ClassicHttpResponse httpResponse) Reads status line and if error tries to parse response body to get server error message.booleanshouldRetry(Throwable ex, Map<String, Object> requestSettings) wrapException(String message, Exception cause)
-
Constructor Details
-
HttpAPIClientHelper
-
-
Method Details
-
createSSLContext
Creates or returns default SSL context.- Returns:
- SSLContext
-
createHttpClient
public org.apache.hc.client5.http.impl.classic.CloseableHttpClient createHttpClient(boolean initSslContext) -
readError
Reads status line and if error tries to parse response body to get server error message.- Parameters:
httpResponse- - HTTP response- Returns:
-
executeRequest
public org.apache.hc.core5.http.ClassicHttpResponse executeRequest(ClickHouseNode server, Map<String, Object> requestConfig, org.apache.hc.core5.io.IOCallback<OutputStream> writeCallback) throws IOException- Throws:
IOException
-
getHeaderInt
public static int getHeaderInt(org.apache.hc.core5.http.Header header, int defaultValue) -
getHeaderVal
-
getHeaderVal
-
shouldRetry
-
wrapException
-
parseUrlParameters
Parses URL parameters.- Parameters:
url-- Returns:
- Map of parameters
-
close
public void close()
-