/** This is an automatically generated code sample.
To make this code sample work in your Oracle Cloud tenancy,
please replace the values for any parameters whose current values do not fit
your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
boolean, number, and enum parameters with values not fitting your use case).
*/
import com.oracle.bmc.ConfigFileReader;
import com.oracle.bmc.auth.AuthenticationDetailsProvider;
import com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider;
import com.oracle.bmc.dataintegration.DataIntegrationClient;
import com.oracle.bmc.dataintegration.model.*;
import com.oracle.bmc.dataintegration.requests.*;
import com.oracle.bmc.dataintegration.responses.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Date;
import java.util.UUID;
import java.util.Arrays;
public class CreateConnectionValidationExample {
public static void main(String[] args) throws Exception {
/**
* Create a default authentication provider that uses the DEFAULT
* profile in the configuration file.
* Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
*/
final ConfigFileReader.ConfigFile configFile = ConfigFileReader.parseDefault();
final AuthenticationDetailsProvider provider = new ConfigFileAuthenticationDetailsProvider(configFile);
/* Create a service client */
DataIntegrationClient client = DataIntegrationClient.builder().build(provider);
/* Create a request and dependent object(s). */
CreateConnectionValidationDetails createConnectionValidationDetails = CreateConnectionValidationDetails.builder()
.dataAsset(CreateDataAssetFromAdwc.builder()
.serviceName("EXAMPLE-serviceName-Value")
.driverClass("EXAMPLE-driverClass-Value")
.credentialFileContent("EXAMPLE-credentialFileContent-Value")
.walletSecret(SensitiveAttribute.builder()
.secretConfig(OciVaultSecretConfig.builder()
.secretId("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value").build())
.value("EXAMPLE-value-Value").build())
.walletPasswordSecret(SensitiveAttribute.builder()
.secretConfig(OciVaultSecretConfig.builder()
.secretId("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value").build())
.value("EXAMPLE-value-Value").build())
.regionId("ocid1.test.oc1..<unique_ID>EXAMPLE-regionId-Value")
.tenancyId("ocid1.test.oc1..<unique_ID>EXAMPLE-tenancyId-Value")
.compartmentId("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value")
.autonomousDbId("ocid1.test.oc1..<unique_ID>EXAMPLE-autonomousDbId-Value")
.defaultConnection(CreateConnectionFromAdwc.builder()
.tnsAlias("EXAMPLE-tnsAlias-Value")
.tnsNames(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.username("EXAMPLE-username-Value")
.password("EXAMPLE-password-Value")
.passwordSecret(SensitiveAttribute.builder()
.secretConfig(OciVaultSecretConfig.builder()
.secretId("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value").build())
.value("EXAMPLE-value-Value").build())
.key("EXAMPLE-key-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value")
.objectStatus(93)
.identifier("EXAMPLE-identifier-Value")
.connectionProperties(new ArrayList<>(Arrays.asList(ConnectionProperty.builder()
.name("EXAMPLE-name-Value")
.value("EXAMPLE-value-Value").build())))
.registryMetadata(RegistryMetadata.builder()
.aggregatorKey("EXAMPLE-aggregatorKey-Value")
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.registryVersion(544)
.key("EXAMPLE-key-Value")
.isFavorite(false).build()).build())
.stagingDataAsset(DataAssetFromFusionApp.builder()
.serviceUrl("EXAMPLE-serviceUrl-Value")
.defaultConnection(ConnectionFromMySQLDetails.builder()
.username("EXAMPLE-username-Value")
.key("EXAMPLE-key-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value")
.objectVersion(363)
.objectStatus(487)
.identifier("EXAMPLE-identifier-Value")
.primarySchema(Schema.builder()
.key("EXAMPLE-key-Value")
.modelType("EXAMPLE-modelType-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.name("EXAMPLE-name-Value")
.resourceName("EXAMPLE-resourceName-Value")
.description("EXAMPLE-description-Value")
.objectVersion(752)
.externalKey("EXAMPLE-externalKey-Value")
.isHasContainers(false)
.defaultConnection("EXAMPLE-defaultConnection-Value")
.objectStatus(841)
.identifier("EXAMPLE-identifier-Value")
.metadata(ObjectMetadata.builder()
.createdBy("EXAMPLE-createdBy-Value")
.createdByName("EXAMPLE-createdByName-Value")
.updatedBy("EXAMPLE-updatedBy-Value")
.updatedByName("EXAMPLE-updatedByName-Value")
.timeCreated(new Date("Tue Mar 13 06:11:00 UTC 2001"))
.timeUpdated(new Date("Fri Jun 13 10:07:30 UTC 2008"))
.aggregatorKey("EXAMPLE-aggregatorKey-Value")
.aggregator(AggregatorSummary.builder()
.type("EXAMPLE-type-Value")
.key("EXAMPLE-key-Value")
.name("EXAMPLE-name-Value")
.identifier("EXAMPLE-identifier-Value")
.description("EXAMPLE-description-Value").build())
.identifierPath("EXAMPLE-identifierPath-Value")
.infoFields(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_arnHa","EXAMPLE_VALUE_Qt7QRZMK9TiWML4KTlod");
}
})
.registryVersion(621)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(true)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.Folder)
.objectCount(325L).build()))).build()).build()).build())
.connectionProperties(new ArrayList<>(Arrays.asList(ConnectionProperty.builder()
.name("EXAMPLE-name-Value")
.value("EXAMPLE-value-Value").build())))
.isDefault(true)
.metadata(ObjectMetadata.builder()
.createdBy("EXAMPLE-createdBy-Value")
.createdByName("EXAMPLE-createdByName-Value")
.updatedBy("EXAMPLE-updatedBy-Value")
.updatedByName("EXAMPLE-updatedByName-Value")
.timeCreated(new Date("Fri Dec 18 14:13:09 UTC 2009"))
.timeUpdated(new Date("Sat Nov 27 05:17:33 UTC 2038"))
.aggregatorKey("EXAMPLE-aggregatorKey-Value")
.aggregator(AggregatorSummary.builder()
.type("EXAMPLE-type-Value")
.key("EXAMPLE-key-Value")
.name("EXAMPLE-name-Value")
.identifier("EXAMPLE-identifier-Value")
.description("EXAMPLE-description-Value").build())
.identifierPath("EXAMPLE-identifierPath-Value")
.infoFields(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_uf4Vj","EXAMPLE_VALUE_gGsHSSrKMzjIfm46qAf2");
}
})
.registryVersion(485)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(true)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.UserDefinedFunction)
.objectCount(603L).build()))).build()).build()).build())
.key("EXAMPLE-key-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value")
.objectStatus(463)
.identifier("EXAMPLE-identifier-Value")
.externalKey("EXAMPLE-externalKey-Value")
.assetProperties(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_2nwHs","EXAMPLE_VALUE_piUs23xU5ntz2xbG2vSu");
}
})
.nativeTypeSystem(TypeSystem.builder()
.key("EXAMPLE-key-Value")
.modelType("EXAMPLE-modelType-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value")
.objectVersion(41)
.typeMappingTo(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_LhZHc","EXAMPLE_VALUE_DYUGdTEXYDhZMn8Y6Cqy");
}
})
.typeMappingFrom(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_jkudc","EXAMPLE_VALUE_EP2k8TwAUKQP0TvpoiXT");
}
})
.objectStatus(841)
.identifier("EXAMPLE-identifier-Value")
.types(new ArrayList<>(Arrays.asList(DataType.builder()
.dtType(DataType.DtType.Structured)
.typeSystemName("EXAMPLE-typeSystemName-Value")
.configDefinition(ConfigDefinition.builder()
.key("EXAMPLE-key-Value")
.modelType("EXAMPLE-modelType-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.name("EXAMPLE-name-Value")
.isContained(true)
.objectStatus(833)
.configParameterDefinitions(new HashMap<java.lang.String, com.oracle.bmc.dataintegration.model.ConfigParameterDefinition>() {
{
put("EXAMPLE_KEY_KcShs",ConfigParameterDefinition.builder()
.parameterType(MaterializedCompositeType.builder()
.elements(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.pathNames(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.key("EXAMPLE-key-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.name("EXAMPLE-name-Value")
.objectStatus(638)
.description("EXAMPLE-description-Value").build())
.parameterName("EXAMPLE-parameterName-Value")
.description("EXAMPLE-description-Value")
.defaultValue("EXAMPLE-defaultValue-Value")
.classFieldName("EXAMPLE-classFieldName-Value")
.isStatic(true)
.isClassFieldValue(false).build());
}
}).build())
.key("EXAMPLE-key-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.name("EXAMPLE-name-Value")
.objectStatus(298)
.description("EXAMPLE-description-Value").build()))).build())
.objectVersion(410)
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.metadata(ObjectMetadata.builder()
.createdBy("EXAMPLE-createdBy-Value")
.createdByName("EXAMPLE-createdByName-Value")
.updatedBy("EXAMPLE-updatedBy-Value")
.updatedByName("EXAMPLE-updatedByName-Value")
.timeCreated(new Date("Thu Feb 25 04:28:44 UTC 2038"))
.timeUpdated(new Date("Thu Sep 09 22:13:31 UTC 2038"))
.aggregatorKey("EXAMPLE-aggregatorKey-Value")
.aggregator(AggregatorSummary.builder()
.type("EXAMPLE-type-Value")
.key("EXAMPLE-key-Value")
.name("EXAMPLE-name-Value")
.identifier("EXAMPLE-identifier-Value")
.description("EXAMPLE-description-Value").build())
.identifierPath("EXAMPLE-identifierPath-Value")
.infoFields(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_yVicP","EXAMPLE_VALUE_VPETMCWuHJRrulO3vEGC");
}
})
.registryVersion(795)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(false)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.Application)
.objectCount(453L).build()))).build()).build())
.keyMap(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_XQfHA","EXAMPLE_VALUE_WhjkkwbLkqvDoNqVK2nZ");
}
}).build())
.stagingConnection(ConnectionFromMySQL.builder()
.username("EXAMPLE-username-Value")
.key("EXAMPLE-key-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value")
.objectVersion(748)
.objectStatus(889)
.identifier("EXAMPLE-identifier-Value")
.primarySchema(Schema.builder()
.key("EXAMPLE-key-Value")
.modelType("EXAMPLE-modelType-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.name("EXAMPLE-name-Value")
.resourceName("EXAMPLE-resourceName-Value")
.description("EXAMPLE-description-Value")
.objectVersion(981)
.externalKey("EXAMPLE-externalKey-Value")
.isHasContainers(true)
.defaultConnection("EXAMPLE-defaultConnection-Value")
.objectStatus(403)
.identifier("EXAMPLE-identifier-Value")
.metadata(ObjectMetadata.builder()
.createdBy("EXAMPLE-createdBy-Value")
.createdByName("EXAMPLE-createdByName-Value")
.updatedBy("EXAMPLE-updatedBy-Value")
.updatedByName("EXAMPLE-updatedByName-Value")
.timeCreated(new Date("Mon Jan 16 16:03:29 UTC 2040"))
.timeUpdated(new Date("Tue Feb 16 10:05:55 UTC 2021"))
.aggregatorKey("EXAMPLE-aggregatorKey-Value")
.aggregator(AggregatorSummary.builder()
.type("EXAMPLE-type-Value")
.key("EXAMPLE-key-Value")
.name("EXAMPLE-name-Value")
.identifier("EXAMPLE-identifier-Value")
.description("EXAMPLE-description-Value").build())
.identifierPath("EXAMPLE-identifierPath-Value")
.infoFields(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_TnRmy","EXAMPLE_VALUE_7JULmhKIwwfycDTsarrd");
}
})
.registryVersion(607)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(true)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.DataFlow)
.objectCount(331L).build()))).build()).build()).build())
.connectionProperties(new ArrayList<>(Arrays.asList(ConnectionProperty.builder()
.name("EXAMPLE-name-Value")
.value("EXAMPLE-value-Value").build())))
.isDefault(true)
.metadata(ObjectMetadata.builder()
.createdBy("EXAMPLE-createdBy-Value")
.createdByName("EXAMPLE-createdByName-Value")
.updatedBy("EXAMPLE-updatedBy-Value")
.updatedByName("EXAMPLE-updatedByName-Value")
.timeCreated(new Date("Sun Jan 14 06:18:40 UTC 2018"))
.timeUpdated(new Date("Wed Jan 17 14:56:43 UTC 2029"))
.aggregatorKey("EXAMPLE-aggregatorKey-Value")
.aggregator(AggregatorSummary.builder()
.type("EXAMPLE-type-Value")
.key("EXAMPLE-key-Value")
.name("EXAMPLE-name-Value")
.identifier("EXAMPLE-identifier-Value")
.description("EXAMPLE-description-Value").build())
.identifierPath("EXAMPLE-identifierPath-Value")
.infoFields(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_6TtU6","EXAMPLE_VALUE_qfcydSUfmsraQ0mc2s2Y");
}
})
.registryVersion(851)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(false)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.Application)
.objectCount(327L).build()))).build()).build())
.keyMap(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_HPV5h","EXAMPLE_VALUE_L0dNMw9YcwTj0uQBktVe");
}
}).build())
.bucketSchema(Schema.builder()
.key("EXAMPLE-key-Value")
.modelType("EXAMPLE-modelType-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.name("EXAMPLE-name-Value")
.resourceName("EXAMPLE-resourceName-Value")
.description("EXAMPLE-description-Value")
.objectVersion(402)
.externalKey("EXAMPLE-externalKey-Value")
.isHasContainers(true)
.defaultConnection("EXAMPLE-defaultConnection-Value")
.objectStatus(436)
.identifier("EXAMPLE-identifier-Value")
.metadata(ObjectMetadata.builder()
.createdBy("EXAMPLE-createdBy-Value")
.createdByName("EXAMPLE-createdByName-Value")
.updatedBy("EXAMPLE-updatedBy-Value")
.updatedByName("EXAMPLE-updatedByName-Value")
.timeCreated(new Date("Fri Nov 01 13:00:36 UTC 2013"))
.timeUpdated(new Date("Thu Apr 25 20:18:01 UTC 2047"))
.aggregatorKey("EXAMPLE-aggregatorKey-Value")
.aggregator(AggregatorSummary.builder()
.type("EXAMPLE-type-Value")
.key("EXAMPLE-key-Value")
.name("EXAMPLE-name-Value")
.identifier("EXAMPLE-identifier-Value")
.description("EXAMPLE-description-Value").build())
.identifierPath("EXAMPLE-identifierPath-Value")
.infoFields(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_64665","EXAMPLE_VALUE_YHDim3erSiuY9atrIjG0");
}
})
.registryVersion(354)
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.isFavorite(true)
.countStatistics(CountStatistic.builder()
.objectTypeCountList(new ArrayList<>(Arrays.asList(CountStatisticSummary.builder()
.objectType(CountStatisticSummary.ObjectType.Task)
.objectCount(182L).build()))).build()).build()).build())
.key("EXAMPLE-key-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value")
.objectStatus(784)
.identifier("EXAMPLE-identifier-Value")
.externalKey("EXAMPLE-externalKey-Value")
.assetProperties(new HashMap<java.lang.String, java.lang.String>() {
{
put("EXAMPLE_KEY_W402z","EXAMPLE_VALUE_ZAJgwrpEIw0h7po8AoNn");
}
})
.registryMetadata(RegistryMetadata.builder()
.aggregatorKey("EXAMPLE-aggregatorKey-Value")
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.registryVersion(898)
.key("EXAMPLE-key-Value")
.isFavorite(true).build()).build())
.connection(CreateConnectionFromObjectStorage.builder()
.credentialFileContent("EXAMPLE-credentialFileContent-Value")
.userId("ocid1.test.oc1..<unique_ID>EXAMPLE-userId-Value")
.fingerPrint("EXAMPLE-fingerPrint-Value")
.passPhrase("EXAMPLE-passPhrase-Value")
.key("EXAMPLE-key-Value")
.modelVersion("EXAMPLE-modelVersion-Value")
.parentRef(ParentReference.builder()
.parent("EXAMPLE-parent-Value")
.rootDocId("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value").build())
.name("EXAMPLE-name-Value")
.description("EXAMPLE-description-Value")
.objectStatus(218)
.identifier("EXAMPLE-identifier-Value")
.connectionProperties(new ArrayList<>(Arrays.asList(ConnectionProperty.builder()
.name("EXAMPLE-name-Value")
.value("EXAMPLE-value-Value").build())))
.registryMetadata(RegistryMetadata.builder()
.aggregatorKey("EXAMPLE-aggregatorKey-Value")
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.registryVersion(675)
.key("EXAMPLE-key-Value")
.isFavorite(true).build()).build())
.registryMetadata(RegistryMetadata.builder()
.aggregatorKey("EXAMPLE-aggregatorKey-Value")
.labels(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
.registryVersion(510)
.key("EXAMPLE-key-Value")
.isFavorite(true).build()).build();
CreateConnectionValidationRequest createConnectionValidationRequest = CreateConnectionValidationRequest.builder()
.workspaceId("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value")
.createConnectionValidationDetails(createConnectionValidationDetails)
.opcRequestId("GVEPFOHZPXPME7FULR5U<unique_ID>")
.opcRetryToken("EXAMPLE-opcRetryToken-Value").build();
/* Send request to the Client */
CreateConnectionValidationResponse response = client.createConnectionValidation(createConnectionValidationRequest);
}
}