Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public ApacheCloudStackClient(String url, ApacheCloudStackUser apacheCloudStackU
public String executeRequest(ApacheCloudStackRequest request) {
boolean isSecretKeyApiKeyAuthenticationMechanism = StringUtils.isNotBlank(this.apacheCloudStackUser.getApiKey());
String urlRequest = createApacheCloudStackApiUrlRequest(request, isSecretKeyApiKeyAuthenticationMechanism);
logger.debug("Executing request[%s].", urlRequest);
logger.debug(String.format("Executing request[%s].", urlRequest));
CloseableHttpClient httpClient = createHttpClient();
HttpContext httpContext = createHttpContextWithAuthenticatedSessionUsingUserCredentialsIfNeeded(httpClient, isSecretKeyApiKeyAuthenticationMechanism);
try {
Expand Down Expand Up @@ -178,7 +178,7 @@ protected String executeRequestGetResponseAsString(String urlRequest, CloseableH
protected void executeUserLogout(CloseableHttpClient httpClient, HttpContext httpContext) {
String urlRequest = createApacheCloudStackApiUrlRequest(new ApacheCloudStackRequest("logout").addParameter("response", "json"), false);
String returnOfLogout = executeRequestGetResponseAsString(urlRequest, httpClient, httpContext);
logger.debug("Logout result[%s]", returnOfLogout);
logger.debug(String.format("Logout result[%s]", returnOfLogout));
}

/**
Expand All @@ -198,10 +198,8 @@ protected HttpContext createHttpContextWithAuthenticatedSessionUsingUserCredenti
* @return returns the created RequestConfig object
*/
protected RequestConfig createRequestConfig() {
return RequestConfig.custom()
.setConnectTimeout(connectionTimeout * (int) DateUtils.MILLIS_PER_SECOND)
.setConnectionRequestTimeout(connectionTimeout * (int) DateUtils.MILLIS_PER_SECOND)
.setSocketTimeout(connectionTimeout * (int) DateUtils.MILLIS_PER_SECOND).build();
return RequestConfig.custom().setConnectTimeout(connectionTimeout * (int)DateUtils.MILLIS_PER_SECOND)
.setConnectionRequestTimeout(connectionTimeout * (int)DateUtils.MILLIS_PER_SECOND).setSocketTimeout(connectionTimeout * (int)DateUtils.MILLIS_PER_SECOND).build();
}

/**
Expand Down Expand Up @@ -234,7 +232,7 @@ protected HttpContext createHttpContextWithAuthenticatedSessionUsingUserCredenti
if (statusCode != HttpStatus.SC_OK) {
throw new ApacheCloudStackClientRequestRuntimeException(statusCode, getResponseAsString(loginResponse), "login");
}
logger.debug("Authentication response:[%s]", getResponseAsString(loginResponse));
logger.debug(String.format("Authentication response:[%s]", getResponseAsString(loginResponse)));

return createHttpContextWithCookies(loginResponse);
} catch (IOException e) {
Expand Down