org.mongodb.awscdk.resources.mongodbatlas.StreamsConnection Maven / Gradle / Ivy
Show all versions of awscdk-resources-mongodbatlas Show documentation
package org.mongodb.awscdk.resources.mongodbatlas;
/**
* Settings that define a connection to an external data store.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.101.0 (build b95fe5d)", date = "2024-07-30T09:54:29.063Z")
@software.amazon.jsii.Jsii(module = org.mongodb.awscdk.resources.mongodbatlas.$Module.class, fqn = "awscdk-resources-mongodbatlas.StreamsConnection")
@software.amazon.jsii.Jsii.Proxy(StreamsConnection.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface StreamsConnection extends software.amazon.jsii.JsiiSerializable {
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaAuthentication getAuthentication() {
return null;
}
/**
* Comma separated list of server addresses.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getBootstrapServers() {
return null;
}
/**
* Name of the cluster configured for this connection.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getClusterName() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.mongodb.awscdk.resources.mongodbatlas.DbRoleToExecute getDbRoleToExecute() {
return null;
}
/**
* Human-readable label that identifies the stream connection.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getName() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaSecurity getSecurity() {
return null;
}
/**
* Type of the connection.
*
* Can be either Cluster or Kafka.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.mongodb.awscdk.resources.mongodbatlas.StreamsConnectionType getType() {
return null;
}
/**
* @return a {@link Builder} of {@link StreamsConnection}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link StreamsConnection}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaAuthentication authentication;
java.lang.String bootstrapServers;
java.lang.String clusterName;
org.mongodb.awscdk.resources.mongodbatlas.DbRoleToExecute dbRoleToExecute;
java.lang.String name;
org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaSecurity security;
org.mongodb.awscdk.resources.mongodbatlas.StreamsConnectionType type;
/**
* Sets the value of {@link StreamsConnection#getAuthentication}
* @param authentication the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder authentication(org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaAuthentication authentication) {
this.authentication = authentication;
return this;
}
/**
* Sets the value of {@link StreamsConnection#getBootstrapServers}
* @param bootstrapServers Comma separated list of server addresses.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder bootstrapServers(java.lang.String bootstrapServers) {
this.bootstrapServers = bootstrapServers;
return this;
}
/**
* Sets the value of {@link StreamsConnection#getClusterName}
* @param clusterName Name of the cluster configured for this connection.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder clusterName(java.lang.String clusterName) {
this.clusterName = clusterName;
return this;
}
/**
* Sets the value of {@link StreamsConnection#getDbRoleToExecute}
* @param dbRoleToExecute the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder dbRoleToExecute(org.mongodb.awscdk.resources.mongodbatlas.DbRoleToExecute dbRoleToExecute) {
this.dbRoleToExecute = dbRoleToExecute;
return this;
}
/**
* Sets the value of {@link StreamsConnection#getName}
* @param name Human-readable label that identifies the stream connection.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder name(java.lang.String name) {
this.name = name;
return this;
}
/**
* Sets the value of {@link StreamsConnection#getSecurity}
* @param security the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder security(org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaSecurity security) {
this.security = security;
return this;
}
/**
* Sets the value of {@link StreamsConnection#getType}
* @param type Type of the connection.
* Can be either Cluster or Kafka.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder type(org.mongodb.awscdk.resources.mongodbatlas.StreamsConnectionType type) {
this.type = type;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link StreamsConnection}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public StreamsConnection build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link StreamsConnection}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements StreamsConnection {
private final org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaAuthentication authentication;
private final java.lang.String bootstrapServers;
private final java.lang.String clusterName;
private final org.mongodb.awscdk.resources.mongodbatlas.DbRoleToExecute dbRoleToExecute;
private final java.lang.String name;
private final org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaSecurity security;
private final org.mongodb.awscdk.resources.mongodbatlas.StreamsConnectionType type;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.authentication = software.amazon.jsii.Kernel.get(this, "authentication", software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaAuthentication.class));
this.bootstrapServers = software.amazon.jsii.Kernel.get(this, "bootstrapServers", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.clusterName = software.amazon.jsii.Kernel.get(this, "clusterName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.dbRoleToExecute = software.amazon.jsii.Kernel.get(this, "dbRoleToExecute", software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.DbRoleToExecute.class));
this.name = software.amazon.jsii.Kernel.get(this, "name", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.security = software.amazon.jsii.Kernel.get(this, "security", software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaSecurity.class));
this.type = software.amazon.jsii.Kernel.get(this, "type", software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.StreamsConnectionType.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.authentication = builder.authentication;
this.bootstrapServers = builder.bootstrapServers;
this.clusterName = builder.clusterName;
this.dbRoleToExecute = builder.dbRoleToExecute;
this.name = builder.name;
this.security = builder.security;
this.type = builder.type;
}
@Override
public final org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaAuthentication getAuthentication() {
return this.authentication;
}
@Override
public final java.lang.String getBootstrapServers() {
return this.bootstrapServers;
}
@Override
public final java.lang.String getClusterName() {
return this.clusterName;
}
@Override
public final org.mongodb.awscdk.resources.mongodbatlas.DbRoleToExecute getDbRoleToExecute() {
return this.dbRoleToExecute;
}
@Override
public final java.lang.String getName() {
return this.name;
}
@Override
public final org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaSecurity getSecurity() {
return this.security;
}
@Override
public final org.mongodb.awscdk.resources.mongodbatlas.StreamsConnectionType getType() {
return this.type;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
if (this.getAuthentication() != null) {
data.set("authentication", om.valueToTree(this.getAuthentication()));
}
if (this.getBootstrapServers() != null) {
data.set("bootstrapServers", om.valueToTree(this.getBootstrapServers()));
}
if (this.getClusterName() != null) {
data.set("clusterName", om.valueToTree(this.getClusterName()));
}
if (this.getDbRoleToExecute() != null) {
data.set("dbRoleToExecute", om.valueToTree(this.getDbRoleToExecute()));
}
if (this.getName() != null) {
data.set("name", om.valueToTree(this.getName()));
}
if (this.getSecurity() != null) {
data.set("security", om.valueToTree(this.getSecurity()));
}
if (this.getType() != null) {
data.set("type", om.valueToTree(this.getType()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("awscdk-resources-mongodbatlas.StreamsConnection"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
StreamsConnection.Jsii$Proxy that = (StreamsConnection.Jsii$Proxy) o;
if (this.authentication != null ? !this.authentication.equals(that.authentication) : that.authentication != null) return false;
if (this.bootstrapServers != null ? !this.bootstrapServers.equals(that.bootstrapServers) : that.bootstrapServers != null) return false;
if (this.clusterName != null ? !this.clusterName.equals(that.clusterName) : that.clusterName != null) return false;
if (this.dbRoleToExecute != null ? !this.dbRoleToExecute.equals(that.dbRoleToExecute) : that.dbRoleToExecute != null) return false;
if (this.name != null ? !this.name.equals(that.name) : that.name != null) return false;
if (this.security != null ? !this.security.equals(that.security) : that.security != null) return false;
return this.type != null ? this.type.equals(that.type) : that.type == null;
}
@Override
public final int hashCode() {
int result = this.authentication != null ? this.authentication.hashCode() : 0;
result = 31 * result + (this.bootstrapServers != null ? this.bootstrapServers.hashCode() : 0);
result = 31 * result + (this.clusterName != null ? this.clusterName.hashCode() : 0);
result = 31 * result + (this.dbRoleToExecute != null ? this.dbRoleToExecute.hashCode() : 0);
result = 31 * result + (this.name != null ? this.name.hashCode() : 0);
result = 31 * result + (this.security != null ? this.security.hashCode() : 0);
result = 31 * result + (this.type != null ? this.type.hashCode() : 0);
return result;
}
}
}