Package com.firebolt.jdbc.client
Class FireboltClient
java.lang.Object
com.firebolt.jdbc.client.FireboltClient
- All Implemented Interfaces:
CacheListener
,EventListener
- Direct Known Subclasses:
FireboltAccountClient
,FireboltAccountRetriever
,FireboltAuthenticationClient
,StatementClientImpl
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FireboltClient
(okhttp3.OkHttpClient httpClient, FireboltConnection connection, String customDrivers, String customClients) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
protected okhttp3.Request
createPostRequest
(String uri, String label, String json, String accessToken) protected okhttp3.Request
createPostRequest
(String uri, String label, okhttp3.RequestBody body, String accessToken) protected okhttp3.Response
protected okhttp3.Response
protected <T> T
getResource
(String uri, String accessToken, Class<T> valueType) protected <T> T
getResource
(String uri, String host, String accessToken, Class<T> valueType) protected String
getResponseAsString
(okhttp3.Response response) protected boolean
isCallSuccessful
(int statusCode) protected <T> T
jsonToObject
(String json, Class<T> valueType) protected void
validateResponse
(String host, int statusCode, String errorMessageFromServer) protected void
validateResponse
(String host, okhttp3.Response response, Boolean isCompress)
-
Field Details
-
connection
-
-
Constructor Details
-
FireboltClient
protected FireboltClient(okhttp3.OkHttpClient httpClient, FireboltConnection connection, String customDrivers, String customClients)
-
-
Method Details
-
getResource
protected <T> T getResource(String uri, String accessToken, Class<T> valueType) throws IOException, SQLException - Throws:
IOException
SQLException
-
getResource
protected <T> T getResource(String uri, String host, String accessToken, Class<T> valueType) throws SQLException, IOException - Throws:
SQLException
IOException
-
jsonToObject
- Throws:
IOException
-
execute
protected okhttp3.Response execute(@NonNull @NonNull okhttp3.Request request, String host) throws IOException, SQLException - Throws:
IOException
SQLException
-
execute
protected okhttp3.Response execute(@NonNull @NonNull okhttp3.Request request, String host, boolean isCompress) throws IOException, SQLException - Throws:
IOException
SQLException
-
createPostRequest
-
createPostRequest
-
validateResponse
protected void validateResponse(String host, okhttp3.Response response, Boolean isCompress) throws SQLException - Throws:
SQLException
-
validateResponse
protected void validateResponse(String host, int statusCode, String errorMessageFromServer) throws SQLException - Throws:
SQLException
-
getResponseAsString
- Throws:
SQLException
IOException
-
isCallSuccessful
protected boolean isCallSuccessful(int statusCode) -
cleanup
public void cleanup()- Specified by:
cleanup
in interfaceCacheListener
-