Skip to content
Merged
Show file tree
Hide file tree
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 @@ -694,6 +694,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
applyDebugSetting(this.clientConfig);
// Rebuild HTTP Client according to the new "debugging" value.
this.httpClient = buildHttpClient();
return this;
Expand Down Expand Up @@ -1383,8 +1384,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
* @return Client
*/
protected Client buildHttpClient() {
// recreate the client config to pickup changes
clientConfig = getDefaultClientConfig();
// Create ClientConfig if it has not been initialized yet
if (clientConfig == null) {
clientConfig = getDefaultClientConfig();
}

ClientBuilder clientBuilder = ClientBuilder.newBuilder();
clientBuilder = clientBuilder.withConfig(clientConfig);
Expand All @@ -1405,6 +1408,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
// turn off compliance validation to be able to send payloads with DELETE calls
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
applyDebugSetting(clientConfig);
return clientConfig;
}

private void applyDebugSetting(ClientConfig clientConfig) {
if (debugging) {
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
Expand All @@ -1414,8 +1422,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
// suppress warnings for payloads with DELETE calls:
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
}

return clientConfig;
}

/**
Expand Down Expand Up @@ -1507,4 +1513,4 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
applyDebugSetting(this.clientConfig);
// Rebuild HTTP Client according to the new "debugging" value.
this.httpClient = buildHttpClient();
return this;
Expand Down Expand Up @@ -1383,8 +1384,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
* @return Client
*/
protected Client buildHttpClient() {
// recreate the client config to pickup changes
// Create ClientConfig if it has not been initialized yet
if (clientConfig == null) {
clientConfig = getDefaultClientConfig();
}

ClientBuilder clientBuilder = ClientBuilder.newBuilder();
clientBuilder = clientBuilder.withConfig(clientConfig);
Expand All @@ -1405,6 +1408,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
// turn off compliance validation to be able to send payloads with DELETE calls
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
applyDebugSetting(clientConfig);
return clientConfig;
}

private void applyDebugSetting(ClientConfig clientConfig) {
if (debugging) {
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
Expand All @@ -1414,8 +1422,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
// suppress warnings for payloads with DELETE calls:
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
}

return clientConfig;
}

/**
Expand Down Expand Up @@ -1507,4 +1513,4 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ public boolean isDebugging() {
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
applyDebugSetting(this.clientConfig);
// Rebuild HTTP Client according to the new "debugging" value.
this.httpClient = buildHttpClient();
return this;
Expand Down Expand Up @@ -1139,8 +1140,10 @@ public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> query
* @return Client
*/
protected Client buildHttpClient() {
// recreate the client config to pickup changes
clientConfig = getDefaultClientConfig();
// Create ClientConfig if it has not been initialized yet
if (clientConfig == null) {
clientConfig = getDefaultClientConfig();
}

ClientBuilder clientBuilder = ClientBuilder.newBuilder();
clientBuilder = clientBuilder.withConfig(clientConfig);
Expand All @@ -1161,6 +1164,11 @@ public ClientConfig getDefaultClientConfig() {
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
// turn off compliance validation to be able to send payloads with DELETE calls
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
applyDebugSetting(clientConfig);
return clientConfig;
}

private void applyDebugSetting(ClientConfig clientConfig) {
if (debugging) {
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
Expand All @@ -1170,8 +1178,6 @@ public ClientConfig getDefaultClientConfig() {
// suppress warnings for payloads with DELETE calls:
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
}

return clientConfig;
}

/**
Expand Down Expand Up @@ -1263,4 +1269,4 @@ protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, M
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ public boolean isDebugging() {
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
applyDebugSetting(this.clientConfig);
// Rebuild HTTP Client according to the new "debugging" value.
this.httpClient = buildHttpClient();
return this;
Expand Down Expand Up @@ -1139,8 +1140,10 @@ public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> query
* @return Client
*/
protected Client buildHttpClient() {
// recreate the client config to pickup changes
clientConfig = getDefaultClientConfig();
// Create ClientConfig if it has not been initialized yet
if (clientConfig == null) {
clientConfig = getDefaultClientConfig();
}

ClientBuilder clientBuilder = ClientBuilder.newBuilder();
clientBuilder = clientBuilder.withConfig(clientConfig);
Expand All @@ -1161,6 +1164,11 @@ public ClientConfig getDefaultClientConfig() {
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
// turn off compliance validation to be able to send payloads with DELETE calls
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
applyDebugSetting(clientConfig);
return clientConfig;
}

private void applyDebugSetting(ClientConfig clientConfig) {
if (debugging) {
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
Expand All @@ -1170,8 +1178,6 @@ public ClientConfig getDefaultClientConfig() {
// suppress warnings for payloads with DELETE calls:
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
}

return clientConfig;
}

/**
Expand Down Expand Up @@ -1263,4 +1269,4 @@ protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, M
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ public boolean isDebugging() {
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
applyDebugSetting(this.clientConfig);
// Rebuild HTTP Client according to the new "debugging" value.
this.httpClient = buildHttpClient();
return this;
Expand Down Expand Up @@ -1296,8 +1297,10 @@ public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> query
* @return Client
*/
protected Client buildHttpClient() {
// recreate the client config to pickup changes
clientConfig = getDefaultClientConfig();
// Create ClientConfig if it has not been initialized yet
if (clientConfig == null) {
clientConfig = getDefaultClientConfig();
}

ClientBuilder clientBuilder = ClientBuilder.newBuilder();
clientBuilder = clientBuilder.withConfig(clientConfig);
Expand All @@ -1318,6 +1321,11 @@ public ClientConfig getDefaultClientConfig() {
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
// turn off compliance validation to be able to send payloads with DELETE calls
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
applyDebugSetting(clientConfig);
return clientConfig;
}

private void applyDebugSetting(ClientConfig clientConfig) {
if (debugging) {
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
Expand All @@ -1327,8 +1335,6 @@ public ClientConfig getDefaultClientConfig() {
// suppress warnings for payloads with DELETE calls:
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
}

return clientConfig;
}

/**
Expand Down Expand Up @@ -1420,4 +1426,4 @@ protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, M
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ public boolean isDebugging() {
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
applyDebugSetting(this.clientConfig);
// Rebuild HTTP Client according to the new "debugging" value.
this.httpClient = buildHttpClient();
return this;
Expand Down Expand Up @@ -1296,8 +1297,10 @@ public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> query
* @return Client
*/
protected Client buildHttpClient() {
// recreate the client config to pickup changes
clientConfig = getDefaultClientConfig();
// Create ClientConfig if it has not been initialized yet
if (clientConfig == null) {
clientConfig = getDefaultClientConfig();
}

ClientBuilder clientBuilder = ClientBuilder.newBuilder();
clientBuilder = clientBuilder.withConfig(clientConfig);
Expand All @@ -1318,6 +1321,11 @@ public ClientConfig getDefaultClientConfig() {
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
// turn off compliance validation to be able to send payloads with DELETE calls
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
applyDebugSetting(clientConfig);
return clientConfig;
}

private void applyDebugSetting(ClientConfig clientConfig) {
if (debugging) {
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
Expand All @@ -1327,8 +1335,6 @@ public ClientConfig getDefaultClientConfig() {
// suppress warnings for payloads with DELETE calls:
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
}

return clientConfig;
}

/**
Expand Down Expand Up @@ -1420,4 +1426,4 @@ protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, M
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ public boolean isDebugging() {
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
applyDebugSetting(this.clientConfig);
// Rebuild HTTP Client according to the new "debugging" value.
this.httpClient = buildHttpClient();
return this;
Expand Down Expand Up @@ -1139,8 +1140,10 @@ public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> query
* @return Client
*/
protected Client buildHttpClient() {
// recreate the client config to pickup changes
// Create ClientConfig if it has not been initialized yet
if (clientConfig == null) {
clientConfig = getDefaultClientConfig();
}

ClientBuilder clientBuilder = ClientBuilder.newBuilder();
clientBuilder = clientBuilder.withConfig(clientConfig);
Expand All @@ -1161,6 +1164,11 @@ public ClientConfig getDefaultClientConfig() {
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
// turn off compliance validation to be able to send payloads with DELETE calls
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
applyDebugSetting(clientConfig);
return clientConfig;
}

private void applyDebugSetting(ClientConfig clientConfig) {
if (debugging) {
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
Expand All @@ -1170,8 +1178,6 @@ public ClientConfig getDefaultClientConfig() {
// suppress warnings for payloads with DELETE calls:
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
}

return clientConfig;
}

/**
Expand Down Expand Up @@ -1263,4 +1269,4 @@ protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, M
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ public boolean isDebugging() {
*/
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
applyDebugSetting(this.clientConfig);
// Rebuild HTTP Client according to the new "debugging" value.
this.httpClient = buildHttpClient();
return this;
Expand Down Expand Up @@ -1378,8 +1379,10 @@ public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> query
* @return Client
*/
protected Client buildHttpClient() {
// recreate the client config to pickup changes
// Create ClientConfig if it has not been initialized yet
if (clientConfig == null) {
clientConfig = getDefaultClientConfig();
}

ClientBuilder clientBuilder = ClientBuilder.newBuilder();
clientBuilder = clientBuilder.withConfig(clientConfig);
Expand All @@ -1400,6 +1403,11 @@ public ClientConfig getDefaultClientConfig() {
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
// turn off compliance validation to be able to send payloads with DELETE calls
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
applyDebugSetting(clientConfig);
return clientConfig;
}

private void applyDebugSetting(ClientConfig clientConfig) {
if (debugging) {
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
Expand All @@ -1409,8 +1417,6 @@ public ClientConfig getDefaultClientConfig() {
// suppress warnings for payloads with DELETE calls:
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
}

return clientConfig;
}

/**
Expand Down Expand Up @@ -1502,4 +1508,4 @@ protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, M
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
}
}
Loading