All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.databasemigration.model.RedisSettings Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Database Migration Service module holds the client classes that are used for communicating with AWS Database Migration Service.

There is a newer version: 2.29.15
Show newest version
/*
 * 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 a Redis target endpoint. *

*/ @Generated("software.amazon.awssdk:codegen") public final class RedisSettings implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField SERVER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ServerName").getter(getter(RedisSettings::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(RedisSettings::port)).setter(setter(Builder::port)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Port").build()).build(); private static final SdkField SSL_SECURITY_PROTOCOL_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SslSecurityProtocol").getter(getter(RedisSettings::sslSecurityProtocolAsString)) .setter(setter(Builder::sslSecurityProtocol)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SslSecurityProtocol").build()) .build(); private static final SdkField AUTH_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AuthType").getter(getter(RedisSettings::authTypeAsString)).setter(setter(Builder::authType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuthType").build()).build(); private static final SdkField AUTH_USER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AuthUserName").getter(getter(RedisSettings::authUserName)).setter(setter(Builder::authUserName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuthUserName").build()).build(); private static final SdkField AUTH_PASSWORD_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AuthPassword").getter(getter(RedisSettings::authPassword)).setter(setter(Builder::authPassword)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuthPassword").build()).build(); private static final SdkField SSL_CA_CERTIFICATE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SslCaCertificateArn").getter(getter(RedisSettings::sslCaCertificateArn)) .setter(setter(Builder::sslCaCertificateArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SslCaCertificateArn").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays .asList(SERVER_NAME_FIELD, PORT_FIELD, SSL_SECURITY_PROTOCOL_FIELD, AUTH_TYPE_FIELD, AUTH_USER_NAME_FIELD, AUTH_PASSWORD_FIELD, SSL_CA_CERTIFICATE_ARN_FIELD)); private static final long serialVersionUID = 1L; private final String serverName; private final Integer port; private final String sslSecurityProtocol; private final String authType; private final String authUserName; private final String authPassword; private final String sslCaCertificateArn; private RedisSettings(BuilderImpl builder) { this.serverName = builder.serverName; this.port = builder.port; this.sslSecurityProtocol = builder.sslSecurityProtocol; this.authType = builder.authType; this.authUserName = builder.authUserName; this.authPassword = builder.authPassword; this.sslCaCertificateArn = builder.sslCaCertificateArn; } /** *

* Fully qualified domain name of the endpoint. *

* * @return Fully qualified domain name of the endpoint. */ public final String serverName() { return serverName; } /** *

* Transmission Control Protocol (TCP) port for the endpoint. *

* * @return Transmission Control Protocol (TCP) port for the endpoint. */ public final Integer port() { return port; } /** *

* The connection to a Redis target endpoint using Transport Layer Security (TLS). Valid values include * plaintext and ssl-encryption. The default is ssl-encryption. The * ssl-encryption option makes an encrypted connection. Optionally, you can identify an Amazon Resource * Name (ARN) for an SSL certificate authority (CA) using the SslCaCertificateArn setting. If an ARN * isn't given for a CA, DMS uses the Amazon root CA. *

*

* The plaintext option doesn't provide Transport Layer Security (TLS) encryption for traffic between * endpoint and database. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #sslSecurityProtocol} will return {@link SslSecurityProtocolValue#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #sslSecurityProtocolAsString}. *

* * @return The connection to a Redis target endpoint using Transport Layer Security (TLS). Valid values include * plaintext and ssl-encryption. The default is ssl-encryption. The * ssl-encryption option makes an encrypted connection. Optionally, you can identify an Amazon * Resource Name (ARN) for an SSL certificate authority (CA) using the SslCaCertificateArn * setting. If an ARN isn't given for a CA, DMS uses the Amazon root CA.

*

* The plaintext option doesn't provide Transport Layer Security (TLS) encryption for traffic * between endpoint and database. * @see SslSecurityProtocolValue */ public final SslSecurityProtocolValue sslSecurityProtocol() { return SslSecurityProtocolValue.fromValue(sslSecurityProtocol); } /** *

* The connection to a Redis target endpoint using Transport Layer Security (TLS). Valid values include * plaintext and ssl-encryption. The default is ssl-encryption. The * ssl-encryption option makes an encrypted connection. Optionally, you can identify an Amazon Resource * Name (ARN) for an SSL certificate authority (CA) using the SslCaCertificateArn setting. If an ARN * isn't given for a CA, DMS uses the Amazon root CA. *

*

* The plaintext option doesn't provide Transport Layer Security (TLS) encryption for traffic between * endpoint and database. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #sslSecurityProtocol} will return {@link SslSecurityProtocolValue#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #sslSecurityProtocolAsString}. *

* * @return The connection to a Redis target endpoint using Transport Layer Security (TLS). Valid values include * plaintext and ssl-encryption. The default is ssl-encryption. The * ssl-encryption option makes an encrypted connection. Optionally, you can identify an Amazon * Resource Name (ARN) for an SSL certificate authority (CA) using the SslCaCertificateArn * setting. If an ARN isn't given for a CA, DMS uses the Amazon root CA.

*

* The plaintext option doesn't provide Transport Layer Security (TLS) encryption for traffic * between endpoint and database. * @see SslSecurityProtocolValue */ public final String sslSecurityProtocolAsString() { return sslSecurityProtocol; } /** *

* The type of authentication to perform when connecting to a Redis target. Options include none, * auth-token, and auth-role. The auth-token option requires an * AuthPassword value to be provided. The auth-role option requires * AuthUserName and AuthPassword values to be provided. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #authType} will * return {@link RedisAuthTypeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #authTypeAsString}. *

* * @return The type of authentication to perform when connecting to a Redis target. Options include * none, auth-token, and auth-role. The auth-token * option requires an AuthPassword value to be provided. The auth-role option * requires AuthUserName and AuthPassword values to be provided. * @see RedisAuthTypeValue */ public final RedisAuthTypeValue authType() { return RedisAuthTypeValue.fromValue(authType); } /** *

* The type of authentication to perform when connecting to a Redis target. Options include none, * auth-token, and auth-role. The auth-token option requires an * AuthPassword value to be provided. The auth-role option requires * AuthUserName and AuthPassword values to be provided. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #authType} will * return {@link RedisAuthTypeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #authTypeAsString}. *

* * @return The type of authentication to perform when connecting to a Redis target. Options include * none, auth-token, and auth-role. The auth-token * option requires an AuthPassword value to be provided. The auth-role option * requires AuthUserName and AuthPassword values to be provided. * @see RedisAuthTypeValue */ public final String authTypeAsString() { return authType; } /** *

* The user name provided with the auth-role option of the AuthType setting for a Redis * target endpoint. *

* * @return The user name provided with the auth-role option of the AuthType setting for a * Redis target endpoint. */ public final String authUserName() { return authUserName; } /** *

* The password provided with the auth-role and auth-token options of the * AuthType setting for a Redis target endpoint. *

* * @return The password provided with the auth-role and auth-token options of the * AuthType setting for a Redis target endpoint. */ public final String authPassword() { return authPassword; } /** *

* The Amazon Resource Name (ARN) for the certificate authority (CA) that DMS uses to connect to your Redis target * endpoint. *

* * @return The Amazon Resource Name (ARN) for the certificate authority (CA) that DMS uses to connect to your Redis * target endpoint. */ public final String sslCaCertificateArn() { return sslCaCertificateArn; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class 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(sslSecurityProtocolAsString()); hashCode = 31 * hashCode + Objects.hashCode(authTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(authUserName()); hashCode = 31 * hashCode + Objects.hashCode(authPassword()); hashCode = 31 * hashCode + Objects.hashCode(sslCaCertificateArn()); 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 RedisSettings)) { return false; } RedisSettings other = (RedisSettings) obj; return Objects.equals(serverName(), other.serverName()) && Objects.equals(port(), other.port()) && Objects.equals(sslSecurityProtocolAsString(), other.sslSecurityProtocolAsString()) && Objects.equals(authTypeAsString(), other.authTypeAsString()) && Objects.equals(authUserName(), other.authUserName()) && Objects.equals(authPassword(), other.authPassword()) && Objects.equals(sslCaCertificateArn(), other.sslCaCertificateArn()); } /** * 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("RedisSettings").add("ServerName", serverName()).add("Port", port()) .add("SslSecurityProtocol", sslSecurityProtocolAsString()).add("AuthType", authTypeAsString()) .add("AuthUserName", authUserName()) .add("AuthPassword", authPassword() == null ? null : "*** Sensitive Data Redacted ***") .add("SslCaCertificateArn", sslCaCertificateArn()).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 "SslSecurityProtocol": return Optional.ofNullable(clazz.cast(sslSecurityProtocolAsString())); case "AuthType": return Optional.ofNullable(clazz.cast(authTypeAsString())); case "AuthUserName": return Optional.ofNullable(clazz.cast(authUserName())); case "AuthPassword": return Optional.ofNullable(clazz.cast(authPassword())); case "SslCaCertificateArn": return Optional.ofNullable(clazz.cast(sslCaCertificateArn())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((RedisSettings) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Fully qualified domain name of the endpoint. *

* * @param serverName * Fully qualified domain name of the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serverName(String serverName); /** *

* Transmission Control Protocol (TCP) port for the endpoint. *

* * @param port * Transmission Control Protocol (TCP) port for the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder port(Integer port); /** *

* The connection to a Redis target endpoint using Transport Layer Security (TLS). Valid values include * plaintext and ssl-encryption. The default is ssl-encryption. The * ssl-encryption option makes an encrypted connection. Optionally, you can identify an Amazon * Resource Name (ARN) for an SSL certificate authority (CA) using the SslCaCertificateArn setting. * If an ARN isn't given for a CA, DMS uses the Amazon root CA. *

*

* The plaintext option doesn't provide Transport Layer Security (TLS) encryption for traffic * between endpoint and database. *

* * @param sslSecurityProtocol * The connection to a Redis target endpoint using Transport Layer Security (TLS). Valid values include * plaintext and ssl-encryption. The default is ssl-encryption. * The ssl-encryption option makes an encrypted connection. Optionally, you can identify an * Amazon Resource Name (ARN) for an SSL certificate authority (CA) using the * SslCaCertificateArn setting. If an ARN isn't given for a CA, DMS uses the Amazon root * CA.

*

* The plaintext option doesn't provide Transport Layer Security (TLS) encryption for * traffic between endpoint and database. * @see SslSecurityProtocolValue * @return Returns a reference to this object so that method calls can be chained together. * @see SslSecurityProtocolValue */ Builder sslSecurityProtocol(String sslSecurityProtocol); /** *

* The connection to a Redis target endpoint using Transport Layer Security (TLS). Valid values include * plaintext and ssl-encryption. The default is ssl-encryption. The * ssl-encryption option makes an encrypted connection. Optionally, you can identify an Amazon * Resource Name (ARN) for an SSL certificate authority (CA) using the SslCaCertificateArn setting. * If an ARN isn't given for a CA, DMS uses the Amazon root CA. *

*

* The plaintext option doesn't provide Transport Layer Security (TLS) encryption for traffic * between endpoint and database. *

* * @param sslSecurityProtocol * The connection to a Redis target endpoint using Transport Layer Security (TLS). Valid values include * plaintext and ssl-encryption. The default is ssl-encryption. * The ssl-encryption option makes an encrypted connection. Optionally, you can identify an * Amazon Resource Name (ARN) for an SSL certificate authority (CA) using the * SslCaCertificateArn setting. If an ARN isn't given for a CA, DMS uses the Amazon root * CA.

*

* The plaintext option doesn't provide Transport Layer Security (TLS) encryption for * traffic between endpoint and database. * @see SslSecurityProtocolValue * @return Returns a reference to this object so that method calls can be chained together. * @see SslSecurityProtocolValue */ Builder sslSecurityProtocol(SslSecurityProtocolValue sslSecurityProtocol); /** *

* The type of authentication to perform when connecting to a Redis target. Options include none, * auth-token, and auth-role. The auth-token option requires an * AuthPassword value to be provided. The auth-role option requires * AuthUserName and AuthPassword values to be provided. *

* * @param authType * The type of authentication to perform when connecting to a Redis target. Options include * none, auth-token, and auth-role. The auth-token * option requires an AuthPassword value to be provided. The auth-role option * requires AuthUserName and AuthPassword values to be provided. * @see RedisAuthTypeValue * @return Returns a reference to this object so that method calls can be chained together. * @see RedisAuthTypeValue */ Builder authType(String authType); /** *

* The type of authentication to perform when connecting to a Redis target. Options include none, * auth-token, and auth-role. The auth-token option requires an * AuthPassword value to be provided. The auth-role option requires * AuthUserName and AuthPassword values to be provided. *

* * @param authType * The type of authentication to perform when connecting to a Redis target. Options include * none, auth-token, and auth-role. The auth-token * option requires an AuthPassword value to be provided. The auth-role option * requires AuthUserName and AuthPassword values to be provided. * @see RedisAuthTypeValue * @return Returns a reference to this object so that method calls can be chained together. * @see RedisAuthTypeValue */ Builder authType(RedisAuthTypeValue authType); /** *

* The user name provided with the auth-role option of the AuthType setting for a * Redis target endpoint. *

* * @param authUserName * The user name provided with the auth-role option of the AuthType setting for * a Redis target endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder authUserName(String authUserName); /** *

* The password provided with the auth-role and auth-token options of the * AuthType setting for a Redis target endpoint. *

* * @param authPassword * The password provided with the auth-role and auth-token options of the * AuthType setting for a Redis target endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder authPassword(String authPassword); /** *

* The Amazon Resource Name (ARN) for the certificate authority (CA) that DMS uses to connect to your Redis * target endpoint. *

* * @param sslCaCertificateArn * The Amazon Resource Name (ARN) for the certificate authority (CA) that DMS uses to connect to your * Redis target endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sslCaCertificateArn(String sslCaCertificateArn); } static final class BuilderImpl implements Builder { private String serverName; private Integer port; private String sslSecurityProtocol; private String authType; private String authUserName; private String authPassword; private String sslCaCertificateArn; private BuilderImpl() { } private BuilderImpl(RedisSettings model) { serverName(model.serverName); port(model.port); sslSecurityProtocol(model.sslSecurityProtocol); authType(model.authType); authUserName(model.authUserName); authPassword(model.authPassword); sslCaCertificateArn(model.sslCaCertificateArn); } public final String getServerName() { return serverName; } public final void setServerName(String serverName) { this.serverName = serverName; } @Override public final Builder serverName(String serverName) { this.serverName = serverName; return this; } public final Integer getPort() { return port; } public final void setPort(Integer port) { this.port = port; } @Override public final Builder port(Integer port) { this.port = port; return this; } public final String getSslSecurityProtocol() { return sslSecurityProtocol; } public final void setSslSecurityProtocol(String sslSecurityProtocol) { this.sslSecurityProtocol = sslSecurityProtocol; } @Override public final Builder sslSecurityProtocol(String sslSecurityProtocol) { this.sslSecurityProtocol = sslSecurityProtocol; return this; } @Override public final Builder sslSecurityProtocol(SslSecurityProtocolValue sslSecurityProtocol) { this.sslSecurityProtocol(sslSecurityProtocol == null ? null : sslSecurityProtocol.toString()); return this; } public final String getAuthType() { return authType; } public final void setAuthType(String authType) { this.authType = authType; } @Override public final Builder authType(String authType) { this.authType = authType; return this; } @Override public final Builder authType(RedisAuthTypeValue authType) { this.authType(authType == null ? null : authType.toString()); return this; } public final String getAuthUserName() { return authUserName; } public final void setAuthUserName(String authUserName) { this.authUserName = authUserName; } @Override public final Builder authUserName(String authUserName) { this.authUserName = authUserName; return this; } public final String getAuthPassword() { return authPassword; } public final void setAuthPassword(String authPassword) { this.authPassword = authPassword; } @Override public final Builder authPassword(String authPassword) { this.authPassword = authPassword; return this; } public final String getSslCaCertificateArn() { return sslCaCertificateArn; } public final void setSslCaCertificateArn(String sslCaCertificateArn) { this.sslCaCertificateArn = sslCaCertificateArn; } @Override public final Builder sslCaCertificateArn(String sslCaCertificateArn) { this.sslCaCertificateArn = sslCaCertificateArn; return this; } @Override public RedisSettings build() { return new RedisSettings(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy