10Duke Scale SDK for Java
|
Abstract class representing a REST API client.
Protected Member Functions | |
AbstractRestApiClient (final AuthorizationProvider authzBearerProvider, final TendukeScaleConfig config) | |
Initializes a new instance of this class with a null tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider and a new OkHttpClient with internal default configuration options (15 sec. | |
AbstractRestApiClient (final AuthorizationProvider authzBearerProvider, final TendukeScaleConfig config, final OkHttpClient okHttpClient) | |
Initializes a new instance of this class. | |
void | logErrorResponse (final Response response, final String entityType, final String action, final Logger logger) throws IOException |
Logs an error response. | |
void | logErrorResponse (final ApiException apiException, final String entityType, final String action, final Logger logger) |
Logs an error response. | |
String | extractBaseUrl () |
Validates and extracts the 10Duke Scale base URL from previously provided TendukeScaleConfig . | |
|
protected |
Initializes a new instance of this class with a null tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider
and a new OkHttpClient with internal default configuration options (15 sec.
timeout for connect, call, read and write).
authzBearerProvider | AuthorizationProvider is called when a new value for HTTP Authorization header is needed. |
config | The configuration to use for the 10Duke Scale base URL and settings for HTTP client. |
|
protected |
Initializes a new instance of this class.
authzBearerProvider | AuthorizationProvider is called when a new value for HTTP Authorization header is needed. |
config | The configuration to use for the 10Duke Scale base URL and settings for HTTP client. |
okHttpClient | An instance of OkHttpClient to use for making HTTP requests. If a null value is provided then a new OkHttpClient with internal default configuration options (15 sec. timeout for connect, call, read and write). |
|
protected |
Validates and extracts the 10Duke Scale base URL from previously provided TendukeScaleConfig
.
Asserts that the configuration and the URL are not null and that the URL is not blank.
|
protected |
Logs an error response.
apiException | received exception to log. |
entityType | type of the entity that the action was towards. |
action | attempted action. |
logger | to log the error. |
|
protected |
Logs an error response.
response | error response to log. |
entityType | type of the entity that the action was towards. |
action | attempted action. |
logger | to log the error. |
IOException | if an IOException occurs while converting error body to string. |