
software.amazon.awssdk.services.databasemigration.model.OracleDataProviderSettings Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 software.amazon.awssdk.services.databasemigration.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Provides information that defines an Oracle data provider.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class OracleDataProviderSettings implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField SERVER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ServerName").getter(getter(OracleDataProviderSettings::serverName)).setter(setter(Builder::serverName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServerName").build()).build();
private static final SdkField PORT_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Port")
.getter(getter(OracleDataProviderSettings::port)).setter(setter(Builder::port))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Port").build()).build();
private static final SdkField DATABASE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DatabaseName").getter(getter(OracleDataProviderSettings::databaseName))
.setter(setter(Builder::databaseName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DatabaseName").build()).build();
private static final SdkField SSL_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SslMode").getter(getter(OracleDataProviderSettings::sslModeAsString)).setter(setter(Builder::sslMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SslMode").build()).build();
private static final SdkField CERTIFICATE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CertificateArn").getter(getter(OracleDataProviderSettings::certificateArn))
.setter(setter(Builder::certificateArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CertificateArn").build()).build();
private static final SdkField ASM_SERVER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AsmServer").getter(getter(OracleDataProviderSettings::asmServer)).setter(setter(Builder::asmServer))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AsmServer").build()).build();
private static final SdkField SECRETS_MANAGER_ORACLE_ASM_SECRET_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("SecretsManagerOracleAsmSecretId")
.getter(getter(OracleDataProviderSettings::secretsManagerOracleAsmSecretId))
.setter(setter(Builder::secretsManagerOracleAsmSecretId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecretsManagerOracleAsmSecretId")
.build()).build();
private static final SdkField SECRETS_MANAGER_ORACLE_ASM_ACCESS_ROLE_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("SecretsManagerOracleAsmAccessRoleArn")
.getter(getter(OracleDataProviderSettings::secretsManagerOracleAsmAccessRoleArn))
.setter(setter(Builder::secretsManagerOracleAsmAccessRoleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("SecretsManagerOracleAsmAccessRoleArn").build()).build();
private static final SdkField SECRETS_MANAGER_SECURITY_DB_ENCRYPTION_SECRET_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("SecretsManagerSecurityDbEncryptionSecretId")
.getter(getter(OracleDataProviderSettings::secretsManagerSecurityDbEncryptionSecretId))
.setter(setter(Builder::secretsManagerSecurityDbEncryptionSecretId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("SecretsManagerSecurityDbEncryptionSecretId").build()).build();
private static final SdkField SECRETS_MANAGER_SECURITY_DB_ENCRYPTION_ACCESS_ROLE_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("SecretsManagerSecurityDbEncryptionAccessRoleArn")
.getter(getter(OracleDataProviderSettings::secretsManagerSecurityDbEncryptionAccessRoleArn))
.setter(setter(Builder::secretsManagerSecurityDbEncryptionAccessRoleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("SecretsManagerSecurityDbEncryptionAccessRoleArn").build()).build();
private static final List> SDK_FIELDS = Collections
.unmodifiableList(Arrays.asList(SERVER_NAME_FIELD, PORT_FIELD, DATABASE_NAME_FIELD, SSL_MODE_FIELD,
CERTIFICATE_ARN_FIELD, ASM_SERVER_FIELD, SECRETS_MANAGER_ORACLE_ASM_SECRET_ID_FIELD,
SECRETS_MANAGER_ORACLE_ASM_ACCESS_ROLE_ARN_FIELD, SECRETS_MANAGER_SECURITY_DB_ENCRYPTION_SECRET_ID_FIELD,
SECRETS_MANAGER_SECURITY_DB_ENCRYPTION_ACCESS_ROLE_ARN_FIELD));
private static final long serialVersionUID = 1L;
private final String serverName;
private final Integer port;
private final String databaseName;
private final String sslMode;
private final String certificateArn;
private final String asmServer;
private final String secretsManagerOracleAsmSecretId;
private final String secretsManagerOracleAsmAccessRoleArn;
private final String secretsManagerSecurityDbEncryptionSecretId;
private final String secretsManagerSecurityDbEncryptionAccessRoleArn;
private OracleDataProviderSettings(BuilderImpl builder) {
this.serverName = builder.serverName;
this.port = builder.port;
this.databaseName = builder.databaseName;
this.sslMode = builder.sslMode;
this.certificateArn = builder.certificateArn;
this.asmServer = builder.asmServer;
this.secretsManagerOracleAsmSecretId = builder.secretsManagerOracleAsmSecretId;
this.secretsManagerOracleAsmAccessRoleArn = builder.secretsManagerOracleAsmAccessRoleArn;
this.secretsManagerSecurityDbEncryptionSecretId = builder.secretsManagerSecurityDbEncryptionSecretId;
this.secretsManagerSecurityDbEncryptionAccessRoleArn = builder.secretsManagerSecurityDbEncryptionAccessRoleArn;
}
/**
*
* The name of the Oracle server.
*
*
* @return The name of the Oracle server.
*/
public final String serverName() {
return serverName;
}
/**
*
* The port value for the Oracle data provider.
*
*
* @return The port value for the Oracle data provider.
*/
public final Integer port() {
return port;
}
/**
*
* The database name on the Oracle data provider.
*
*
* @return The database name on the Oracle data provider.
*/
public final String databaseName() {
return databaseName;
}
/**
*
* The SSL mode used to connect to the Oracle data provider. The default value is none
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sslMode} will
* return {@link DmsSslModeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sslModeAsString}.
*
*
* @return The SSL mode used to connect to the Oracle data provider. The default value is none
.
* @see DmsSslModeValue
*/
public final DmsSslModeValue sslMode() {
return DmsSslModeValue.fromValue(sslMode);
}
/**
*
* The SSL mode used to connect to the Oracle data provider. The default value is none
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sslMode} will
* return {@link DmsSslModeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sslModeAsString}.
*
*
* @return The SSL mode used to connect to the Oracle data provider. The default value is none
.
* @see DmsSslModeValue
*/
public final String sslModeAsString() {
return sslMode;
}
/**
*
* The Amazon Resource Name (ARN) of the certificate used for SSL connection.
*
*
* @return The Amazon Resource Name (ARN) of the certificate used for SSL connection.
*/
public final String certificateArn() {
return certificateArn;
}
/**
*
* The address of your Oracle Automatic Storage Management (ASM) server. You can set this value from the
* asm_server
value. You set asm_server
as part of the extra connection attribute string
* to access an Oracle server with Binary Reader that uses ASM. For more information, see Configuration for change data capture (CDC) on an Oracle source database.
*
*
* @return The address of your Oracle Automatic Storage Management (ASM) server. You can set this value from the
* asm_server
value. You set asm_server
as part of the extra connection attribute
* string to access an Oracle server with Binary Reader that uses ASM. For more information, see Configuration for change data capture (CDC) on an Oracle source database.
*/
public final String asmServer() {
return asmServer;
}
/**
*
* The identifier of the secret in Secrets Manager that contains the Oracle ASM connection details.
*
*
* Required only if your data provider uses the Oracle ASM server.
*
*
* @return The identifier of the secret in Secrets Manager that contains the Oracle ASM connection details.
*
* Required only if your data provider uses the Oracle ASM server.
*/
public final String secretsManagerOracleAsmSecretId() {
return secretsManagerOracleAsmSecretId;
}
/**
*
* The ARN of the IAM role that provides access to the secret in Secrets Manager that contains the Oracle ASM
* connection details.
*
*
* @return The ARN of the IAM role that provides access to the secret in Secrets Manager that contains the Oracle
* ASM connection details.
*/
public final String secretsManagerOracleAsmAccessRoleArn() {
return secretsManagerOracleAsmAccessRoleArn;
}
/**
*
* The identifier of the secret in Secrets Manager that contains the transparent data encryption (TDE) password. DMS
* requires this password to access Oracle redo logs encrypted by TDE using Binary Reader.
*
*
* @return The identifier of the secret in Secrets Manager that contains the transparent data encryption (TDE)
* password. DMS requires this password to access Oracle redo logs encrypted by TDE using Binary Reader.
*/
public final String secretsManagerSecurityDbEncryptionSecretId() {
return secretsManagerSecurityDbEncryptionSecretId;
}
/**
*
* The ARN of the IAM role that provides access to the secret in Secrets Manager that contains the TDE password.
*
*
* @return The ARN of the IAM role that provides access to the secret in Secrets Manager that contains the TDE
* password.
*/
public final String secretsManagerSecurityDbEncryptionAccessRoleArn() {
return secretsManagerSecurityDbEncryptionAccessRoleArn;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(serverName());
hashCode = 31 * hashCode + Objects.hashCode(port());
hashCode = 31 * hashCode + Objects.hashCode(databaseName());
hashCode = 31 * hashCode + Objects.hashCode(sslModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(certificateArn());
hashCode = 31 * hashCode + Objects.hashCode(asmServer());
hashCode = 31 * hashCode + Objects.hashCode(secretsManagerOracleAsmSecretId());
hashCode = 31 * hashCode + Objects.hashCode(secretsManagerOracleAsmAccessRoleArn());
hashCode = 31 * hashCode + Objects.hashCode(secretsManagerSecurityDbEncryptionSecretId());
hashCode = 31 * hashCode + Objects.hashCode(secretsManagerSecurityDbEncryptionAccessRoleArn());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OracleDataProviderSettings)) {
return false;
}
OracleDataProviderSettings other = (OracleDataProviderSettings) obj;
return Objects.equals(serverName(), other.serverName())
&& Objects.equals(port(), other.port())
&& Objects.equals(databaseName(), other.databaseName())
&& Objects.equals(sslModeAsString(), other.sslModeAsString())
&& Objects.equals(certificateArn(), other.certificateArn())
&& Objects.equals(asmServer(), other.asmServer())
&& Objects.equals(secretsManagerOracleAsmSecretId(), other.secretsManagerOracleAsmSecretId())
&& Objects.equals(secretsManagerOracleAsmAccessRoleArn(), other.secretsManagerOracleAsmAccessRoleArn())
&& Objects.equals(secretsManagerSecurityDbEncryptionSecretId(),
other.secretsManagerSecurityDbEncryptionSecretId())
&& Objects.equals(secretsManagerSecurityDbEncryptionAccessRoleArn(),
other.secretsManagerSecurityDbEncryptionAccessRoleArn());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("OracleDataProviderSettings").add("ServerName", serverName()).add("Port", port())
.add("DatabaseName", databaseName()).add("SslMode", sslModeAsString()).add("CertificateArn", certificateArn())
.add("AsmServer", asmServer()).add("SecretsManagerOracleAsmSecretId", secretsManagerOracleAsmSecretId())
.add("SecretsManagerOracleAsmAccessRoleArn", secretsManagerOracleAsmAccessRoleArn())
.add("SecretsManagerSecurityDbEncryptionSecretId", secretsManagerSecurityDbEncryptionSecretId())
.add("SecretsManagerSecurityDbEncryptionAccessRoleArn", secretsManagerSecurityDbEncryptionAccessRoleArn())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ServerName":
return Optional.ofNullable(clazz.cast(serverName()));
case "Port":
return Optional.ofNullable(clazz.cast(port()));
case "DatabaseName":
return Optional.ofNullable(clazz.cast(databaseName()));
case "SslMode":
return Optional.ofNullable(clazz.cast(sslModeAsString()));
case "CertificateArn":
return Optional.ofNullable(clazz.cast(certificateArn()));
case "AsmServer":
return Optional.ofNullable(clazz.cast(asmServer()));
case "SecretsManagerOracleAsmSecretId":
return Optional.ofNullable(clazz.cast(secretsManagerOracleAsmSecretId()));
case "SecretsManagerOracleAsmAccessRoleArn":
return Optional.ofNullable(clazz.cast(secretsManagerOracleAsmAccessRoleArn()));
case "SecretsManagerSecurityDbEncryptionSecretId":
return Optional.ofNullable(clazz.cast(secretsManagerSecurityDbEncryptionSecretId()));
case "SecretsManagerSecurityDbEncryptionAccessRoleArn":
return Optional.ofNullable(clazz.cast(secretsManagerSecurityDbEncryptionAccessRoleArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function