com.amazonaws.services.kendra.model.ConnectionConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-kendra Show documentation
/*
* Copyright 2015-2020 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 com.amazonaws.services.kendra.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Provides the information necessary to connect to a database.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ConnectionConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the host for the database. Can be either a string (host.subdomain.domain.tld) or an IPv4 or IPv6
* address.
*
*/
private String databaseHost;
/**
*
* The port that the database uses for connections.
*
*/
private Integer databasePort;
/**
*
* The name of the database containing the document data.
*
*/
private String databaseName;
/**
*
* The name of the table that contains the document data.
*
*/
private String tableName;
/**
*
* The Amazon Resource Name (ARN) of credentials stored in AWS Secrets Manager. The credentials should be a
* user/password pair. For more information, see Using a Database Data Source.
* For more information about AWS Secrets Manager, see What Is AWS Secrets Manager
* in the AWS Secrets Manager user guide.
*
*/
private String secretArn;
/**
*
* The name of the host for the database. Can be either a string (host.subdomain.domain.tld) or an IPv4 or IPv6
* address.
*
*
* @param databaseHost
* The name of the host for the database. Can be either a string (host.subdomain.domain.tld) or an IPv4 or
* IPv6 address.
*/
public void setDatabaseHost(String databaseHost) {
this.databaseHost = databaseHost;
}
/**
*
* The name of the host for the database. Can be either a string (host.subdomain.domain.tld) or an IPv4 or IPv6
* address.
*
*
* @return The name of the host for the database. Can be either a string (host.subdomain.domain.tld) or an IPv4 or
* IPv6 address.
*/
public String getDatabaseHost() {
return this.databaseHost;
}
/**
*
* The name of the host for the database. Can be either a string (host.subdomain.domain.tld) or an IPv4 or IPv6
* address.
*
*
* @param databaseHost
* The name of the host for the database. Can be either a string (host.subdomain.domain.tld) or an IPv4 or
* IPv6 address.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectionConfiguration withDatabaseHost(String databaseHost) {
setDatabaseHost(databaseHost);
return this;
}
/**
*
* The port that the database uses for connections.
*
*
* @param databasePort
* The port that the database uses for connections.
*/
public void setDatabasePort(Integer databasePort) {
this.databasePort = databasePort;
}
/**
*
* The port that the database uses for connections.
*
*
* @return The port that the database uses for connections.
*/
public Integer getDatabasePort() {
return this.databasePort;
}
/**
*
* The port that the database uses for connections.
*
*
* @param databasePort
* The port that the database uses for connections.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectionConfiguration withDatabasePort(Integer databasePort) {
setDatabasePort(databasePort);
return this;
}
/**
*
* The name of the database containing the document data.
*
*
* @param databaseName
* The name of the database containing the document data.
*/
public void setDatabaseName(String databaseName) {
this.databaseName = databaseName;
}
/**
*
* The name of the database containing the document data.
*
*
* @return The name of the database containing the document data.
*/
public String getDatabaseName() {
return this.databaseName;
}
/**
*
* The name of the database containing the document data.
*
*
* @param databaseName
* The name of the database containing the document data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectionConfiguration withDatabaseName(String databaseName) {
setDatabaseName(databaseName);
return this;
}
/**
*
* The name of the table that contains the document data.
*
*
* @param tableName
* The name of the table that contains the document data.
*/
public void setTableName(String tableName) {
this.tableName = tableName;
}
/**
*
* The name of the table that contains the document data.
*
*
* @return The name of the table that contains the document data.
*/
public String getTableName() {
return this.tableName;
}
/**
*
* The name of the table that contains the document data.
*
*
* @param tableName
* The name of the table that contains the document data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectionConfiguration withTableName(String tableName) {
setTableName(tableName);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of credentials stored in AWS Secrets Manager. The credentials should be a
* user/password pair. For more information, see Using a Database Data Source.
* For more information about AWS Secrets Manager, see What Is AWS Secrets Manager
* in the AWS Secrets Manager user guide.
*
*
* @param secretArn
* The Amazon Resource Name (ARN) of credentials stored in AWS Secrets Manager. The credentials should be a
* user/password pair. For more information, see Using a Database Data
* Source. For more information about AWS Secrets Manager, see What Is AWS Secrets Manager
* in the AWS Secrets Manager user guide.
*/
public void setSecretArn(String secretArn) {
this.secretArn = secretArn;
}
/**
*
* The Amazon Resource Name (ARN) of credentials stored in AWS Secrets Manager. The credentials should be a
* user/password pair. For more information, see Using a Database Data Source.
* For more information about AWS Secrets Manager, see What Is AWS Secrets Manager
* in the AWS Secrets Manager user guide.
*
*
* @return The Amazon Resource Name (ARN) of credentials stored in AWS Secrets Manager. The credentials should be a
* user/password pair. For more information, see Using a Database Data
* Source. For more information about AWS Secrets Manager, see What Is AWS Secrets
* Manager in the AWS Secrets Manager user guide.
*/
public String getSecretArn() {
return this.secretArn;
}
/**
*
* The Amazon Resource Name (ARN) of credentials stored in AWS Secrets Manager. The credentials should be a
* user/password pair. For more information, see Using a Database Data Source.
* For more information about AWS Secrets Manager, see What Is AWS Secrets Manager
* in the AWS Secrets Manager user guide.
*
*
* @param secretArn
* The Amazon Resource Name (ARN) of credentials stored in AWS Secrets Manager. The credentials should be a
* user/password pair. For more information, see Using a Database Data
* Source. For more information about AWS Secrets Manager, see What Is AWS Secrets Manager
* in the AWS Secrets Manager user guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectionConfiguration withSecretArn(String secretArn) {
setSecretArn(secretArn);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getDatabaseHost() != null)
sb.append("DatabaseHost: ").append(getDatabaseHost()).append(",");
if (getDatabasePort() != null)
sb.append("DatabasePort: ").append(getDatabasePort()).append(",");
if (getDatabaseName() != null)
sb.append("DatabaseName: ").append(getDatabaseName()).append(",");
if (getTableName() != null)
sb.append("TableName: ").append(getTableName()).append(",");
if (getSecretArn() != null)
sb.append("SecretArn: ").append(getSecretArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ConnectionConfiguration == false)
return false;
ConnectionConfiguration other = (ConnectionConfiguration) obj;
if (other.getDatabaseHost() == null ^ this.getDatabaseHost() == null)
return false;
if (other.getDatabaseHost() != null && other.getDatabaseHost().equals(this.getDatabaseHost()) == false)
return false;
if (other.getDatabasePort() == null ^ this.getDatabasePort() == null)
return false;
if (other.getDatabasePort() != null && other.getDatabasePort().equals(this.getDatabasePort()) == false)
return false;
if (other.getDatabaseName() == null ^ this.getDatabaseName() == null)
return false;
if (other.getDatabaseName() != null && other.getDatabaseName().equals(this.getDatabaseName()) == false)
return false;
if (other.getTableName() == null ^ this.getTableName() == null)
return false;
if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == false)
return false;
if (other.getSecretArn() == null ^ this.getSecretArn() == null)
return false;
if (other.getSecretArn() != null && other.getSecretArn().equals(this.getSecretArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDatabaseHost() == null) ? 0 : getDatabaseHost().hashCode());
hashCode = prime * hashCode + ((getDatabasePort() == null) ? 0 : getDatabasePort().hashCode());
hashCode = prime * hashCode + ((getDatabaseName() == null) ? 0 : getDatabaseName().hashCode());
hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode());
hashCode = prime * hashCode + ((getSecretArn() == null) ? 0 : getSecretArn().hashCode());
return hashCode;
}
@Override
public ConnectionConfiguration clone() {
try {
return (ConnectionConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.kendra.model.transform.ConnectionConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}