com.google.cloud.dlp.v2.spring.DlpServiceSpringAutoConfiguration Maven / Gradle / Ivy
Show all versions of google-cloud-dlp-spring-starter Show documentation
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.dlp.v2.spring;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.CredentialsProvider;
import com.google.api.gax.core.ExecutorProvider;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.rpc.HeaderProvider;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.cloud.dlp.v2.DlpServiceClient;
import com.google.cloud.dlp.v2.DlpServiceSettings;
import com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration;
import com.google.cloud.spring.core.DefaultCredentialsProvider;
import com.google.cloud.spring.core.Retry;
import com.google.cloud.spring.core.util.RetryUtil;
import java.io.IOException;
import java.util.Collections;
import javax.annotation.Generated;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Auto-configuration for {@link DlpServiceClient}.
*
* Provides auto-configuration for Spring Boot
*
*
The default instance has everything set to sensible defaults:
*
*
* - The default transport provider is used.
*
- Credentials are acquired automatically through Application Default Credentials.
*
- Retries are configured for idempotent methods but not for non-idempotent methods.
*
*/
@Generated("by google-cloud-spring-generator")
@BetaApi("Autogenerated Spring autoconfiguration is not yet stable")
@AutoConfiguration
@AutoConfigureAfter(GcpContextAutoConfiguration.class)
@ConditionalOnClass(DlpServiceClient.class)
@ConditionalOnProperty(value = "com.google.cloud.dlp.v2.dlp-service.enabled", matchIfMissing = true)
@EnableConfigurationProperties(DlpServiceSpringProperties.class)
public class DlpServiceSpringAutoConfiguration {
private final DlpServiceSpringProperties clientProperties;
private final CredentialsProvider credentialsProvider;
private static final Log LOGGER = LogFactory.getLog(DlpServiceSpringAutoConfiguration.class);
protected DlpServiceSpringAutoConfiguration(
DlpServiceSpringProperties clientProperties, CredentialsProvider credentialsProvider)
throws IOException {
this.clientProperties = clientProperties;
if (this.clientProperties.getCredentials().hasKey()) {
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Using credentials from DlpService-specific configuration");
}
this.credentialsProvider =
((CredentialsProvider) new DefaultCredentialsProvider(this.clientProperties));
} else {
this.credentialsProvider = credentialsProvider;
}
}
/**
* Provides a default transport channel provider bean, corresponding to the client library's
* default transport channel provider. If the library supports both GRPC and REST transport, and
* the useRest property is configured, the HTTP/JSON transport provider will be used instead of
* GRPC.
*
* @return a default transport channel provider.
*/
@Bean
@ConditionalOnMissingBean(name = "defaultDlpServiceTransportChannelProvider")
public TransportChannelProvider defaultDlpServiceTransportChannelProvider() {
if (this.clientProperties.getUseRest()) {
return DlpServiceSettings.defaultHttpJsonTransportProviderBuilder().build();
}
return DlpServiceSettings.defaultTransportChannelProvider();
}
/**
* Provides a DlpServiceSettings bean configured to use a DefaultCredentialsProvider and the
* client library's default transport channel provider
* (defaultDlpServiceTransportChannelProvider()). It also configures the quota project ID and
* executor thread count, if provided through properties.
*
* Retry settings are also configured from service-level and method-level properties specified
* in DlpServiceSpringProperties. Method-level properties will take precedence over service-level
* properties if available, and client library defaults will be used if neither are specified.
*
* @param defaultTransportChannelProvider TransportChannelProvider to use in the settings.
* @return a {@link DlpServiceSettings} bean configured with {@link TransportChannelProvider}
* bean.
*/
@Bean
@ConditionalOnMissingBean
public DlpServiceSettings dlpServiceSettings(
@Qualifier("defaultDlpServiceTransportChannelProvider")
TransportChannelProvider defaultTransportChannelProvider)
throws IOException {
DlpServiceSettings.Builder clientSettingsBuilder;
if (this.clientProperties.getUseRest()) {
clientSettingsBuilder = DlpServiceSettings.newHttpJsonBuilder();
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Using REST (HTTP/JSON) transport.");
}
} else {
clientSettingsBuilder = DlpServiceSettings.newBuilder();
}
clientSettingsBuilder
.setCredentialsProvider(this.credentialsProvider)
.setTransportChannelProvider(defaultTransportChannelProvider)
.setEndpoint(DlpServiceSettings.getDefaultEndpoint())
.setHeaderProvider(this.userAgentHeaderProvider());
if (this.clientProperties.getQuotaProjectId() != null) {
clientSettingsBuilder.setQuotaProjectId(this.clientProperties.getQuotaProjectId());
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Quota project id set to "
+ this.clientProperties.getQuotaProjectId()
+ ", this overrides project id from credentials.");
}
}
if (this.clientProperties.getExecutorThreadCount() != null) {
ExecutorProvider executorProvider =
DlpServiceSettings.defaultExecutorProviderBuilder()
.setExecutorThreadCount(this.clientProperties.getExecutorThreadCount())
.build();
clientSettingsBuilder.setBackgroundExecutorProvider(executorProvider);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Background executor thread count is "
+ this.clientProperties.getExecutorThreadCount());
}
}
Retry serviceRetry = clientProperties.getRetry();
if (serviceRetry != null) {
RetrySettings inspectContentRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.inspectContentSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.inspectContentSettings().setRetrySettings(inspectContentRetrySettings);
RetrySettings redactImageRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.redactImageSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.redactImageSettings().setRetrySettings(redactImageRetrySettings);
RetrySettings deidentifyContentRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deidentifyContentSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.deidentifyContentSettings()
.setRetrySettings(deidentifyContentRetrySettings);
RetrySettings reidentifyContentRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.reidentifyContentSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.reidentifyContentSettings()
.setRetrySettings(reidentifyContentRetrySettings);
RetrySettings listInfoTypesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listInfoTypesSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.listInfoTypesSettings().setRetrySettings(listInfoTypesRetrySettings);
RetrySettings createInspectTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createInspectTemplateSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.createInspectTemplateSettings()
.setRetrySettings(createInspectTemplateRetrySettings);
RetrySettings updateInspectTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateInspectTemplateSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.updateInspectTemplateSettings()
.setRetrySettings(updateInspectTemplateRetrySettings);
RetrySettings getInspectTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getInspectTemplateSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.getInspectTemplateSettings()
.setRetrySettings(getInspectTemplateRetrySettings);
RetrySettings listInspectTemplatesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listInspectTemplatesSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.listInspectTemplatesSettings()
.setRetrySettings(listInspectTemplatesRetrySettings);
RetrySettings deleteInspectTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteInspectTemplateSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.deleteInspectTemplateSettings()
.setRetrySettings(deleteInspectTemplateRetrySettings);
RetrySettings createDeidentifyTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createDeidentifyTemplateSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.createDeidentifyTemplateSettings()
.setRetrySettings(createDeidentifyTemplateRetrySettings);
RetrySettings updateDeidentifyTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateDeidentifyTemplateSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.updateDeidentifyTemplateSettings()
.setRetrySettings(updateDeidentifyTemplateRetrySettings);
RetrySettings getDeidentifyTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getDeidentifyTemplateSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.getDeidentifyTemplateSettings()
.setRetrySettings(getDeidentifyTemplateRetrySettings);
RetrySettings listDeidentifyTemplatesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listDeidentifyTemplatesSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.listDeidentifyTemplatesSettings()
.setRetrySettings(listDeidentifyTemplatesRetrySettings);
RetrySettings deleteDeidentifyTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteDeidentifyTemplateSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.deleteDeidentifyTemplateSettings()
.setRetrySettings(deleteDeidentifyTemplateRetrySettings);
RetrySettings createJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createJobTriggerSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.createJobTriggerSettings()
.setRetrySettings(createJobTriggerRetrySettings);
RetrySettings updateJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateJobTriggerSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.updateJobTriggerSettings()
.setRetrySettings(updateJobTriggerRetrySettings);
RetrySettings hybridInspectJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.hybridInspectJobTriggerSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.hybridInspectJobTriggerSettings()
.setRetrySettings(hybridInspectJobTriggerRetrySettings);
RetrySettings getJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getJobTriggerSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.getJobTriggerSettings().setRetrySettings(getJobTriggerRetrySettings);
RetrySettings listJobTriggersRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listJobTriggersSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.listJobTriggersSettings()
.setRetrySettings(listJobTriggersRetrySettings);
RetrySettings deleteJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteJobTriggerSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.deleteJobTriggerSettings()
.setRetrySettings(deleteJobTriggerRetrySettings);
RetrySettings activateJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.activateJobTriggerSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.activateJobTriggerSettings()
.setRetrySettings(activateJobTriggerRetrySettings);
RetrySettings createDiscoveryConfigRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createDiscoveryConfigSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.createDiscoveryConfigSettings()
.setRetrySettings(createDiscoveryConfigRetrySettings);
RetrySettings updateDiscoveryConfigRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateDiscoveryConfigSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.updateDiscoveryConfigSettings()
.setRetrySettings(updateDiscoveryConfigRetrySettings);
RetrySettings getDiscoveryConfigRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getDiscoveryConfigSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.getDiscoveryConfigSettings()
.setRetrySettings(getDiscoveryConfigRetrySettings);
RetrySettings listDiscoveryConfigsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listDiscoveryConfigsSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.listDiscoveryConfigsSettings()
.setRetrySettings(listDiscoveryConfigsRetrySettings);
RetrySettings deleteDiscoveryConfigRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteDiscoveryConfigSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.deleteDiscoveryConfigSettings()
.setRetrySettings(deleteDiscoveryConfigRetrySettings);
RetrySettings createDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createDlpJobSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.createDlpJobSettings().setRetrySettings(createDlpJobRetrySettings);
RetrySettings listDlpJobsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listDlpJobsSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.listDlpJobsSettings().setRetrySettings(listDlpJobsRetrySettings);
RetrySettings getDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getDlpJobSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.getDlpJobSettings().setRetrySettings(getDlpJobRetrySettings);
RetrySettings deleteDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteDlpJobSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.deleteDlpJobSettings().setRetrySettings(deleteDlpJobRetrySettings);
RetrySettings cancelDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.cancelDlpJobSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.cancelDlpJobSettings().setRetrySettings(cancelDlpJobRetrySettings);
RetrySettings createStoredInfoTypeRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createStoredInfoTypeSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.createStoredInfoTypeSettings()
.setRetrySettings(createStoredInfoTypeRetrySettings);
RetrySettings updateStoredInfoTypeRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateStoredInfoTypeSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.updateStoredInfoTypeSettings()
.setRetrySettings(updateStoredInfoTypeRetrySettings);
RetrySettings getStoredInfoTypeRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getStoredInfoTypeSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.getStoredInfoTypeSettings()
.setRetrySettings(getStoredInfoTypeRetrySettings);
RetrySettings listStoredInfoTypesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listStoredInfoTypesSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.listStoredInfoTypesSettings()
.setRetrySettings(listStoredInfoTypesRetrySettings);
RetrySettings deleteStoredInfoTypeRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteStoredInfoTypeSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.deleteStoredInfoTypeSettings()
.setRetrySettings(deleteStoredInfoTypeRetrySettings);
RetrySettings listProjectDataProfilesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listProjectDataProfilesSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.listProjectDataProfilesSettings()
.setRetrySettings(listProjectDataProfilesRetrySettings);
RetrySettings listTableDataProfilesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listTableDataProfilesSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.listTableDataProfilesSettings()
.setRetrySettings(listTableDataProfilesRetrySettings);
RetrySettings listColumnDataProfilesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listColumnDataProfilesSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.listColumnDataProfilesSettings()
.setRetrySettings(listColumnDataProfilesRetrySettings);
RetrySettings getProjectDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getProjectDataProfileSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.getProjectDataProfileSettings()
.setRetrySettings(getProjectDataProfileRetrySettings);
RetrySettings listFileStoreDataProfilesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listFileStoreDataProfilesSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.listFileStoreDataProfilesSettings()
.setRetrySettings(listFileStoreDataProfilesRetrySettings);
RetrySettings getFileStoreDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getFileStoreDataProfileSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.getFileStoreDataProfileSettings()
.setRetrySettings(getFileStoreDataProfileRetrySettings);
RetrySettings deleteFileStoreDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteFileStoreDataProfileSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.deleteFileStoreDataProfileSettings()
.setRetrySettings(deleteFileStoreDataProfileRetrySettings);
RetrySettings getTableDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getTableDataProfileSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.getTableDataProfileSettings()
.setRetrySettings(getTableDataProfileRetrySettings);
RetrySettings getColumnDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getColumnDataProfileSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.getColumnDataProfileSettings()
.setRetrySettings(getColumnDataProfileRetrySettings);
RetrySettings deleteTableDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteTableDataProfileSettings().getRetrySettings(),
serviceRetry);
clientSettingsBuilder
.deleteTableDataProfileSettings()
.setRetrySettings(deleteTableDataProfileRetrySettings);
RetrySettings hybridInspectDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.hybridInspectDlpJobSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.hybridInspectDlpJobSettings()
.setRetrySettings(hybridInspectDlpJobRetrySettings);
RetrySettings finishDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.finishDlpJobSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.finishDlpJobSettings().setRetrySettings(finishDlpJobRetrySettings);
RetrySettings createConnectionRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createConnectionSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.createConnectionSettings()
.setRetrySettings(createConnectionRetrySettings);
RetrySettings getConnectionRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getConnectionSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder.getConnectionSettings().setRetrySettings(getConnectionRetrySettings);
RetrySettings listConnectionsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listConnectionsSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.listConnectionsSettings()
.setRetrySettings(listConnectionsRetrySettings);
RetrySettings searchConnectionsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.searchConnectionsSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.searchConnectionsSettings()
.setRetrySettings(searchConnectionsRetrySettings);
RetrySettings deleteConnectionRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteConnectionSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.deleteConnectionSettings()
.setRetrySettings(deleteConnectionRetrySettings);
RetrySettings updateConnectionRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateConnectionSettings().getRetrySettings(), serviceRetry);
clientSettingsBuilder
.updateConnectionSettings()
.setRetrySettings(updateConnectionRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured service-level retry settings from properties.");
}
}
Retry inspectContentRetry = clientProperties.getInspectContentRetry();
if (inspectContentRetry != null) {
RetrySettings inspectContentRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.inspectContentSettings().getRetrySettings(),
inspectContentRetry);
clientSettingsBuilder.inspectContentSettings().setRetrySettings(inspectContentRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for inspectContent from properties.");
}
}
Retry redactImageRetry = clientProperties.getRedactImageRetry();
if (redactImageRetry != null) {
RetrySettings redactImageRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.redactImageSettings().getRetrySettings(), redactImageRetry);
clientSettingsBuilder.redactImageSettings().setRetrySettings(redactImageRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for redactImage from properties.");
}
}
Retry deidentifyContentRetry = clientProperties.getDeidentifyContentRetry();
if (deidentifyContentRetry != null) {
RetrySettings deidentifyContentRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deidentifyContentSettings().getRetrySettings(),
deidentifyContentRetry);
clientSettingsBuilder
.deidentifyContentSettings()
.setRetrySettings(deidentifyContentRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for deidentifyContent from properties.");
}
}
Retry reidentifyContentRetry = clientProperties.getReidentifyContentRetry();
if (reidentifyContentRetry != null) {
RetrySettings reidentifyContentRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.reidentifyContentSettings().getRetrySettings(),
reidentifyContentRetry);
clientSettingsBuilder
.reidentifyContentSettings()
.setRetrySettings(reidentifyContentRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for reidentifyContent from properties.");
}
}
Retry listInfoTypesRetry = clientProperties.getListInfoTypesRetry();
if (listInfoTypesRetry != null) {
RetrySettings listInfoTypesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listInfoTypesSettings().getRetrySettings(), listInfoTypesRetry);
clientSettingsBuilder.listInfoTypesSettings().setRetrySettings(listInfoTypesRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for listInfoTypes from properties.");
}
}
Retry createInspectTemplateRetry = clientProperties.getCreateInspectTemplateRetry();
if (createInspectTemplateRetry != null) {
RetrySettings createInspectTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createInspectTemplateSettings().getRetrySettings(),
createInspectTemplateRetry);
clientSettingsBuilder
.createInspectTemplateSettings()
.setRetrySettings(createInspectTemplateRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for createInspectTemplate from properties.");
}
}
Retry updateInspectTemplateRetry = clientProperties.getUpdateInspectTemplateRetry();
if (updateInspectTemplateRetry != null) {
RetrySettings updateInspectTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateInspectTemplateSettings().getRetrySettings(),
updateInspectTemplateRetry);
clientSettingsBuilder
.updateInspectTemplateSettings()
.setRetrySettings(updateInspectTemplateRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for updateInspectTemplate from properties.");
}
}
Retry getInspectTemplateRetry = clientProperties.getGetInspectTemplateRetry();
if (getInspectTemplateRetry != null) {
RetrySettings getInspectTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getInspectTemplateSettings().getRetrySettings(),
getInspectTemplateRetry);
clientSettingsBuilder
.getInspectTemplateSettings()
.setRetrySettings(getInspectTemplateRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for getInspectTemplate from properties.");
}
}
Retry listInspectTemplatesRetry = clientProperties.getListInspectTemplatesRetry();
if (listInspectTemplatesRetry != null) {
RetrySettings listInspectTemplatesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listInspectTemplatesSettings().getRetrySettings(),
listInspectTemplatesRetry);
clientSettingsBuilder
.listInspectTemplatesSettings()
.setRetrySettings(listInspectTemplatesRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for listInspectTemplates from properties.");
}
}
Retry deleteInspectTemplateRetry = clientProperties.getDeleteInspectTemplateRetry();
if (deleteInspectTemplateRetry != null) {
RetrySettings deleteInspectTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteInspectTemplateSettings().getRetrySettings(),
deleteInspectTemplateRetry);
clientSettingsBuilder
.deleteInspectTemplateSettings()
.setRetrySettings(deleteInspectTemplateRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for deleteInspectTemplate from properties.");
}
}
Retry createDeidentifyTemplateRetry = clientProperties.getCreateDeidentifyTemplateRetry();
if (createDeidentifyTemplateRetry != null) {
RetrySettings createDeidentifyTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createDeidentifyTemplateSettings().getRetrySettings(),
createDeidentifyTemplateRetry);
clientSettingsBuilder
.createDeidentifyTemplateSettings()
.setRetrySettings(createDeidentifyTemplateRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for createDeidentifyTemplate from properties.");
}
}
Retry updateDeidentifyTemplateRetry = clientProperties.getUpdateDeidentifyTemplateRetry();
if (updateDeidentifyTemplateRetry != null) {
RetrySettings updateDeidentifyTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateDeidentifyTemplateSettings().getRetrySettings(),
updateDeidentifyTemplateRetry);
clientSettingsBuilder
.updateDeidentifyTemplateSettings()
.setRetrySettings(updateDeidentifyTemplateRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for updateDeidentifyTemplate from properties.");
}
}
Retry getDeidentifyTemplateRetry = clientProperties.getGetDeidentifyTemplateRetry();
if (getDeidentifyTemplateRetry != null) {
RetrySettings getDeidentifyTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getDeidentifyTemplateSettings().getRetrySettings(),
getDeidentifyTemplateRetry);
clientSettingsBuilder
.getDeidentifyTemplateSettings()
.setRetrySettings(getDeidentifyTemplateRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for getDeidentifyTemplate from properties.");
}
}
Retry listDeidentifyTemplatesRetry = clientProperties.getListDeidentifyTemplatesRetry();
if (listDeidentifyTemplatesRetry != null) {
RetrySettings listDeidentifyTemplatesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listDeidentifyTemplatesSettings().getRetrySettings(),
listDeidentifyTemplatesRetry);
clientSettingsBuilder
.listDeidentifyTemplatesSettings()
.setRetrySettings(listDeidentifyTemplatesRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for listDeidentifyTemplates from properties.");
}
}
Retry deleteDeidentifyTemplateRetry = clientProperties.getDeleteDeidentifyTemplateRetry();
if (deleteDeidentifyTemplateRetry != null) {
RetrySettings deleteDeidentifyTemplateRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteDeidentifyTemplateSettings().getRetrySettings(),
deleteDeidentifyTemplateRetry);
clientSettingsBuilder
.deleteDeidentifyTemplateSettings()
.setRetrySettings(deleteDeidentifyTemplateRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for deleteDeidentifyTemplate from properties.");
}
}
Retry createJobTriggerRetry = clientProperties.getCreateJobTriggerRetry();
if (createJobTriggerRetry != null) {
RetrySettings createJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createJobTriggerSettings().getRetrySettings(),
createJobTriggerRetry);
clientSettingsBuilder
.createJobTriggerSettings()
.setRetrySettings(createJobTriggerRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for createJobTrigger from properties.");
}
}
Retry updateJobTriggerRetry = clientProperties.getUpdateJobTriggerRetry();
if (updateJobTriggerRetry != null) {
RetrySettings updateJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateJobTriggerSettings().getRetrySettings(),
updateJobTriggerRetry);
clientSettingsBuilder
.updateJobTriggerSettings()
.setRetrySettings(updateJobTriggerRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for updateJobTrigger from properties.");
}
}
Retry hybridInspectJobTriggerRetry = clientProperties.getHybridInspectJobTriggerRetry();
if (hybridInspectJobTriggerRetry != null) {
RetrySettings hybridInspectJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.hybridInspectJobTriggerSettings().getRetrySettings(),
hybridInspectJobTriggerRetry);
clientSettingsBuilder
.hybridInspectJobTriggerSettings()
.setRetrySettings(hybridInspectJobTriggerRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for hybridInspectJobTrigger from properties.");
}
}
Retry getJobTriggerRetry = clientProperties.getGetJobTriggerRetry();
if (getJobTriggerRetry != null) {
RetrySettings getJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getJobTriggerSettings().getRetrySettings(), getJobTriggerRetry);
clientSettingsBuilder.getJobTriggerSettings().setRetrySettings(getJobTriggerRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for getJobTrigger from properties.");
}
}
Retry listJobTriggersRetry = clientProperties.getListJobTriggersRetry();
if (listJobTriggersRetry != null) {
RetrySettings listJobTriggersRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listJobTriggersSettings().getRetrySettings(),
listJobTriggersRetry);
clientSettingsBuilder
.listJobTriggersSettings()
.setRetrySettings(listJobTriggersRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for listJobTriggers from properties.");
}
}
Retry deleteJobTriggerRetry = clientProperties.getDeleteJobTriggerRetry();
if (deleteJobTriggerRetry != null) {
RetrySettings deleteJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteJobTriggerSettings().getRetrySettings(),
deleteJobTriggerRetry);
clientSettingsBuilder
.deleteJobTriggerSettings()
.setRetrySettings(deleteJobTriggerRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for deleteJobTrigger from properties.");
}
}
Retry activateJobTriggerRetry = clientProperties.getActivateJobTriggerRetry();
if (activateJobTriggerRetry != null) {
RetrySettings activateJobTriggerRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.activateJobTriggerSettings().getRetrySettings(),
activateJobTriggerRetry);
clientSettingsBuilder
.activateJobTriggerSettings()
.setRetrySettings(activateJobTriggerRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for activateJobTrigger from properties.");
}
}
Retry createDiscoveryConfigRetry = clientProperties.getCreateDiscoveryConfigRetry();
if (createDiscoveryConfigRetry != null) {
RetrySettings createDiscoveryConfigRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createDiscoveryConfigSettings().getRetrySettings(),
createDiscoveryConfigRetry);
clientSettingsBuilder
.createDiscoveryConfigSettings()
.setRetrySettings(createDiscoveryConfigRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for createDiscoveryConfig from properties.");
}
}
Retry updateDiscoveryConfigRetry = clientProperties.getUpdateDiscoveryConfigRetry();
if (updateDiscoveryConfigRetry != null) {
RetrySettings updateDiscoveryConfigRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateDiscoveryConfigSettings().getRetrySettings(),
updateDiscoveryConfigRetry);
clientSettingsBuilder
.updateDiscoveryConfigSettings()
.setRetrySettings(updateDiscoveryConfigRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for updateDiscoveryConfig from properties.");
}
}
Retry getDiscoveryConfigRetry = clientProperties.getGetDiscoveryConfigRetry();
if (getDiscoveryConfigRetry != null) {
RetrySettings getDiscoveryConfigRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getDiscoveryConfigSettings().getRetrySettings(),
getDiscoveryConfigRetry);
clientSettingsBuilder
.getDiscoveryConfigSettings()
.setRetrySettings(getDiscoveryConfigRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for getDiscoveryConfig from properties.");
}
}
Retry listDiscoveryConfigsRetry = clientProperties.getListDiscoveryConfigsRetry();
if (listDiscoveryConfigsRetry != null) {
RetrySettings listDiscoveryConfigsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listDiscoveryConfigsSettings().getRetrySettings(),
listDiscoveryConfigsRetry);
clientSettingsBuilder
.listDiscoveryConfigsSettings()
.setRetrySettings(listDiscoveryConfigsRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for listDiscoveryConfigs from properties.");
}
}
Retry deleteDiscoveryConfigRetry = clientProperties.getDeleteDiscoveryConfigRetry();
if (deleteDiscoveryConfigRetry != null) {
RetrySettings deleteDiscoveryConfigRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteDiscoveryConfigSettings().getRetrySettings(),
deleteDiscoveryConfigRetry);
clientSettingsBuilder
.deleteDiscoveryConfigSettings()
.setRetrySettings(deleteDiscoveryConfigRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for deleteDiscoveryConfig from properties.");
}
}
Retry createDlpJobRetry = clientProperties.getCreateDlpJobRetry();
if (createDlpJobRetry != null) {
RetrySettings createDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createDlpJobSettings().getRetrySettings(), createDlpJobRetry);
clientSettingsBuilder.createDlpJobSettings().setRetrySettings(createDlpJobRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for createDlpJob from properties.");
}
}
Retry listDlpJobsRetry = clientProperties.getListDlpJobsRetry();
if (listDlpJobsRetry != null) {
RetrySettings listDlpJobsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listDlpJobsSettings().getRetrySettings(), listDlpJobsRetry);
clientSettingsBuilder.listDlpJobsSettings().setRetrySettings(listDlpJobsRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for listDlpJobs from properties.");
}
}
Retry getDlpJobRetry = clientProperties.getGetDlpJobRetry();
if (getDlpJobRetry != null) {
RetrySettings getDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getDlpJobSettings().getRetrySettings(), getDlpJobRetry);
clientSettingsBuilder.getDlpJobSettings().setRetrySettings(getDlpJobRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for getDlpJob from properties.");
}
}
Retry deleteDlpJobRetry = clientProperties.getDeleteDlpJobRetry();
if (deleteDlpJobRetry != null) {
RetrySettings deleteDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteDlpJobSettings().getRetrySettings(), deleteDlpJobRetry);
clientSettingsBuilder.deleteDlpJobSettings().setRetrySettings(deleteDlpJobRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for deleteDlpJob from properties.");
}
}
Retry cancelDlpJobRetry = clientProperties.getCancelDlpJobRetry();
if (cancelDlpJobRetry != null) {
RetrySettings cancelDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.cancelDlpJobSettings().getRetrySettings(), cancelDlpJobRetry);
clientSettingsBuilder.cancelDlpJobSettings().setRetrySettings(cancelDlpJobRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for cancelDlpJob from properties.");
}
}
Retry createStoredInfoTypeRetry = clientProperties.getCreateStoredInfoTypeRetry();
if (createStoredInfoTypeRetry != null) {
RetrySettings createStoredInfoTypeRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createStoredInfoTypeSettings().getRetrySettings(),
createStoredInfoTypeRetry);
clientSettingsBuilder
.createStoredInfoTypeSettings()
.setRetrySettings(createStoredInfoTypeRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for createStoredInfoType from properties.");
}
}
Retry updateStoredInfoTypeRetry = clientProperties.getUpdateStoredInfoTypeRetry();
if (updateStoredInfoTypeRetry != null) {
RetrySettings updateStoredInfoTypeRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateStoredInfoTypeSettings().getRetrySettings(),
updateStoredInfoTypeRetry);
clientSettingsBuilder
.updateStoredInfoTypeSettings()
.setRetrySettings(updateStoredInfoTypeRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for updateStoredInfoType from properties.");
}
}
Retry getStoredInfoTypeRetry = clientProperties.getGetStoredInfoTypeRetry();
if (getStoredInfoTypeRetry != null) {
RetrySettings getStoredInfoTypeRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getStoredInfoTypeSettings().getRetrySettings(),
getStoredInfoTypeRetry);
clientSettingsBuilder
.getStoredInfoTypeSettings()
.setRetrySettings(getStoredInfoTypeRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for getStoredInfoType from properties.");
}
}
Retry listStoredInfoTypesRetry = clientProperties.getListStoredInfoTypesRetry();
if (listStoredInfoTypesRetry != null) {
RetrySettings listStoredInfoTypesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listStoredInfoTypesSettings().getRetrySettings(),
listStoredInfoTypesRetry);
clientSettingsBuilder
.listStoredInfoTypesSettings()
.setRetrySettings(listStoredInfoTypesRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for listStoredInfoTypes from properties.");
}
}
Retry deleteStoredInfoTypeRetry = clientProperties.getDeleteStoredInfoTypeRetry();
if (deleteStoredInfoTypeRetry != null) {
RetrySettings deleteStoredInfoTypeRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteStoredInfoTypeSettings().getRetrySettings(),
deleteStoredInfoTypeRetry);
clientSettingsBuilder
.deleteStoredInfoTypeSettings()
.setRetrySettings(deleteStoredInfoTypeRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for deleteStoredInfoType from properties.");
}
}
Retry listProjectDataProfilesRetry = clientProperties.getListProjectDataProfilesRetry();
if (listProjectDataProfilesRetry != null) {
RetrySettings listProjectDataProfilesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listProjectDataProfilesSettings().getRetrySettings(),
listProjectDataProfilesRetry);
clientSettingsBuilder
.listProjectDataProfilesSettings()
.setRetrySettings(listProjectDataProfilesRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for listProjectDataProfiles from properties.");
}
}
Retry listTableDataProfilesRetry = clientProperties.getListTableDataProfilesRetry();
if (listTableDataProfilesRetry != null) {
RetrySettings listTableDataProfilesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listTableDataProfilesSettings().getRetrySettings(),
listTableDataProfilesRetry);
clientSettingsBuilder
.listTableDataProfilesSettings()
.setRetrySettings(listTableDataProfilesRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for listTableDataProfiles from properties.");
}
}
Retry listColumnDataProfilesRetry = clientProperties.getListColumnDataProfilesRetry();
if (listColumnDataProfilesRetry != null) {
RetrySettings listColumnDataProfilesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listColumnDataProfilesSettings().getRetrySettings(),
listColumnDataProfilesRetry);
clientSettingsBuilder
.listColumnDataProfilesSettings()
.setRetrySettings(listColumnDataProfilesRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for listColumnDataProfiles from properties.");
}
}
Retry getProjectDataProfileRetry = clientProperties.getGetProjectDataProfileRetry();
if (getProjectDataProfileRetry != null) {
RetrySettings getProjectDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getProjectDataProfileSettings().getRetrySettings(),
getProjectDataProfileRetry);
clientSettingsBuilder
.getProjectDataProfileSettings()
.setRetrySettings(getProjectDataProfileRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for getProjectDataProfile from properties.");
}
}
Retry listFileStoreDataProfilesRetry = clientProperties.getListFileStoreDataProfilesRetry();
if (listFileStoreDataProfilesRetry != null) {
RetrySettings listFileStoreDataProfilesRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listFileStoreDataProfilesSettings().getRetrySettings(),
listFileStoreDataProfilesRetry);
clientSettingsBuilder
.listFileStoreDataProfilesSettings()
.setRetrySettings(listFileStoreDataProfilesRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for listFileStoreDataProfiles from properties.");
}
}
Retry getFileStoreDataProfileRetry = clientProperties.getGetFileStoreDataProfileRetry();
if (getFileStoreDataProfileRetry != null) {
RetrySettings getFileStoreDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getFileStoreDataProfileSettings().getRetrySettings(),
getFileStoreDataProfileRetry);
clientSettingsBuilder
.getFileStoreDataProfileSettings()
.setRetrySettings(getFileStoreDataProfileRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for getFileStoreDataProfile from properties.");
}
}
Retry deleteFileStoreDataProfileRetry = clientProperties.getDeleteFileStoreDataProfileRetry();
if (deleteFileStoreDataProfileRetry != null) {
RetrySettings deleteFileStoreDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteFileStoreDataProfileSettings().getRetrySettings(),
deleteFileStoreDataProfileRetry);
clientSettingsBuilder
.deleteFileStoreDataProfileSettings()
.setRetrySettings(deleteFileStoreDataProfileRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for deleteFileStoreDataProfile from properties.");
}
}
Retry getTableDataProfileRetry = clientProperties.getGetTableDataProfileRetry();
if (getTableDataProfileRetry != null) {
RetrySettings getTableDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getTableDataProfileSettings().getRetrySettings(),
getTableDataProfileRetry);
clientSettingsBuilder
.getTableDataProfileSettings()
.setRetrySettings(getTableDataProfileRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for getTableDataProfile from properties.");
}
}
Retry getColumnDataProfileRetry = clientProperties.getGetColumnDataProfileRetry();
if (getColumnDataProfileRetry != null) {
RetrySettings getColumnDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getColumnDataProfileSettings().getRetrySettings(),
getColumnDataProfileRetry);
clientSettingsBuilder
.getColumnDataProfileSettings()
.setRetrySettings(getColumnDataProfileRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for getColumnDataProfile from properties.");
}
}
Retry deleteTableDataProfileRetry = clientProperties.getDeleteTableDataProfileRetry();
if (deleteTableDataProfileRetry != null) {
RetrySettings deleteTableDataProfileRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteTableDataProfileSettings().getRetrySettings(),
deleteTableDataProfileRetry);
clientSettingsBuilder
.deleteTableDataProfileSettings()
.setRetrySettings(deleteTableDataProfileRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for deleteTableDataProfile from properties.");
}
}
Retry hybridInspectDlpJobRetry = clientProperties.getHybridInspectDlpJobRetry();
if (hybridInspectDlpJobRetry != null) {
RetrySettings hybridInspectDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.hybridInspectDlpJobSettings().getRetrySettings(),
hybridInspectDlpJobRetry);
clientSettingsBuilder
.hybridInspectDlpJobSettings()
.setRetrySettings(hybridInspectDlpJobRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for hybridInspectDlpJob from properties.");
}
}
Retry finishDlpJobRetry = clientProperties.getFinishDlpJobRetry();
if (finishDlpJobRetry != null) {
RetrySettings finishDlpJobRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.finishDlpJobSettings().getRetrySettings(), finishDlpJobRetry);
clientSettingsBuilder.finishDlpJobSettings().setRetrySettings(finishDlpJobRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for finishDlpJob from properties.");
}
}
Retry createConnectionRetry = clientProperties.getCreateConnectionRetry();
if (createConnectionRetry != null) {
RetrySettings createConnectionRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.createConnectionSettings().getRetrySettings(),
createConnectionRetry);
clientSettingsBuilder
.createConnectionSettings()
.setRetrySettings(createConnectionRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for createConnection from properties.");
}
}
Retry getConnectionRetry = clientProperties.getGetConnectionRetry();
if (getConnectionRetry != null) {
RetrySettings getConnectionRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.getConnectionSettings().getRetrySettings(), getConnectionRetry);
clientSettingsBuilder.getConnectionSettings().setRetrySettings(getConnectionRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for getConnection from properties.");
}
}
Retry listConnectionsRetry = clientProperties.getListConnectionsRetry();
if (listConnectionsRetry != null) {
RetrySettings listConnectionsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.listConnectionsSettings().getRetrySettings(),
listConnectionsRetry);
clientSettingsBuilder
.listConnectionsSettings()
.setRetrySettings(listConnectionsRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Configured method-level retry settings for listConnections from properties.");
}
}
Retry searchConnectionsRetry = clientProperties.getSearchConnectionsRetry();
if (searchConnectionsRetry != null) {
RetrySettings searchConnectionsRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.searchConnectionsSettings().getRetrySettings(),
searchConnectionsRetry);
clientSettingsBuilder
.searchConnectionsSettings()
.setRetrySettings(searchConnectionsRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for searchConnections from properties.");
}
}
Retry deleteConnectionRetry = clientProperties.getDeleteConnectionRetry();
if (deleteConnectionRetry != null) {
RetrySettings deleteConnectionRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.deleteConnectionSettings().getRetrySettings(),
deleteConnectionRetry);
clientSettingsBuilder
.deleteConnectionSettings()
.setRetrySettings(deleteConnectionRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for deleteConnection from properties.");
}
}
Retry updateConnectionRetry = clientProperties.getUpdateConnectionRetry();
if (updateConnectionRetry != null) {
RetrySettings updateConnectionRetrySettings =
RetryUtil.updateRetrySettings(
clientSettingsBuilder.updateConnectionSettings().getRetrySettings(),
updateConnectionRetry);
clientSettingsBuilder
.updateConnectionSettings()
.setRetrySettings(updateConnectionRetrySettings);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(
"Configured method-level retry settings for updateConnection from properties.");
}
}
return clientSettingsBuilder.build();
}
/**
* Provides a DlpServiceClient bean configured with DlpServiceSettings.
*
* @param dlpServiceSettings settings to configure an instance of client bean.
* @return a {@link DlpServiceClient} bean configured with {@link DlpServiceSettings}
*/
@Bean
@ConditionalOnMissingBean
public DlpServiceClient dlpServiceClient(DlpServiceSettings dlpServiceSettings)
throws IOException {
return DlpServiceClient.create(dlpServiceSettings);
}
private HeaderProvider userAgentHeaderProvider() {
String springLibrary = "spring-autogen-dlp-service";
String version = this.getClass().getPackage().getImplementationVersion();
return () -> Collections.singletonMap("user-agent", springLibrary + "/" + version);
}
}