org.openmetadata.schema.services.connections.messaging.KafkaConnection Maven / Gradle / Ivy
package org.openmetadata.schema.services.connections.messaging;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.processing.Generated;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
import org.openmetadata.annotations.MaskedField;
import org.openmetadata.annotations.PasswordField;
/**
* KafkaConnection
*
* Kafka Connection Config
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"type",
"bootstrapServers",
"schemaRegistryURL",
"saslUsername",
"saslPassword",
"securityProtocol",
"saslMechanism",
"basicAuthUserInfo",
"consumerConfig",
"schemaRegistryConfig",
"schemaRegistryTopicSuffixName",
"schemaRegistrySSL",
"supportsMetadataExtraction"
})
@Generated("jsonschema2pojo")
public class KafkaConnection {
/**
* Kafka service type
*
*/
@JsonProperty("type")
@JsonPropertyDescription("Kafka service type")
private KafkaConnection.KafkaType type = KafkaConnection.KafkaType.fromValue("Kafka");
/**
* Bootstrap Servers
*
* Kafka bootstrap servers. add them in comma separated values ex: host1:9092,host2:9092
* (Required)
*
*/
@JsonProperty("bootstrapServers")
@JsonPropertyDescription("Kafka bootstrap servers. add them in comma separated values ex: host1:9092,host2:9092")
@NotNull
private String bootstrapServers;
/**
* Schema Registry URL
*
* Confluent Kafka Schema Registry URL.
*
*/
@JsonProperty("schemaRegistryURL")
@JsonPropertyDescription("Confluent Kafka Schema Registry URL.")
private URI schemaRegistryURL;
/**
* SASL Username
*
* sasl.username consumer config property
*
*/
@JsonProperty("saslUsername")
@JsonPropertyDescription("sasl.username consumer config property")
private String saslUsername;
/**
* SASL Password
*
* sasl.password consumer config property
*
*/
@JsonProperty("saslPassword")
@JsonPropertyDescription("sasl.password consumer config property")
@PasswordField
private String saslPassword;
/**
* Security Protocol
*
* security.protocol consumer config property
*
*/
@JsonProperty("securityProtocol")
@JsonPropertyDescription("security.protocol consumer config property")
private KafkaConnection.SecurityProtocol securityProtocol = KafkaConnection.SecurityProtocol.fromValue("PLAINTEXT");
/**
* SaslMechanismType
*
* SASL Mechanism consumer config property
*
*/
@JsonProperty("saslMechanism")
@JsonPropertyDescription("SASL Mechanism consumer config property")
private SaslMechanismType saslMechanism = SaslMechanismType.fromValue("PLAIN");
/**
* Schema Registry Basic Auth User Info
*
* basic.auth.user.info schema registry config property, Client HTTP credentials in the form of username:password.
*
*/
@JsonProperty("basicAuthUserInfo")
@JsonPropertyDescription("basic.auth.user.info schema registry config property, Client HTTP credentials in the form of username:password.")
@PasswordField
private String basicAuthUserInfo;
/**
* Consumer Config
*
* Confluent Kafka Consumer Config. From https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
*
*/
@JsonProperty("consumerConfig")
@JsonPropertyDescription("Confluent Kafka Consumer Config. From https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md")
@Valid
private ConsumerConfig consumerConfig;
/**
* Schema Registry Config
*
* Confluent Kafka Schema Registry Config. From https://docs.confluent.io/5.5.1/clients/confluent-kafka-python/index.html#confluent_kafka.schema_registry.SchemaRegistryClient
*
*/
@JsonProperty("schemaRegistryConfig")
@JsonPropertyDescription("Confluent Kafka Schema Registry Config. From https://docs.confluent.io/5.5.1/clients/confluent-kafka-python/index.html#confluent_kafka.schema_registry.SchemaRegistryClient")
@Valid
private SchemaRegistryConfig schemaRegistryConfig;
/**
* Schema Registry Topic Suffix Name
*
* Schema Registry Topic Suffix Name. The suffix to be appended to the topic name to get topic schema from registry.
*
*/
@JsonProperty("schemaRegistryTopicSuffixName")
@JsonPropertyDescription("Schema Registry Topic Suffix Name. The suffix to be appended to the topic name to get topic schema from registry.")
private String schemaRegistryTopicSuffixName = "-value";
/**
* SSL Config
*
* Client SSL configuration
*
*/
@JsonProperty("schemaRegistrySSL")
@JsonPropertyDescription("Client SSL configuration")
@MaskedField
private Object schemaRegistrySSL;
/**
* Supports Metadata Extraction.
*
*/
@JsonProperty("supportsMetadataExtraction")
@JsonPropertyDescription("Supports Metadata Extraction.")
private Boolean supportsMetadataExtraction = true;
/**
* Kafka service type
*
*/
@JsonProperty("type")
public KafkaConnection.KafkaType getType() {
return type;
}
/**
* Kafka service type
*
*/
@JsonProperty("type")
public void setType(KafkaConnection.KafkaType type) {
this.type = type;
}
public KafkaConnection withType(KafkaConnection.KafkaType type) {
this.type = type;
return this;
}
/**
* Bootstrap Servers
*
* Kafka bootstrap servers. add them in comma separated values ex: host1:9092,host2:9092
* (Required)
*
*/
@JsonProperty("bootstrapServers")
public String getBootstrapServers() {
return bootstrapServers;
}
/**
* Bootstrap Servers
*
* Kafka bootstrap servers. add them in comma separated values ex: host1:9092,host2:9092
* (Required)
*
*/
@JsonProperty("bootstrapServers")
public void setBootstrapServers(String bootstrapServers) {
this.bootstrapServers = bootstrapServers;
}
public KafkaConnection withBootstrapServers(String bootstrapServers) {
this.bootstrapServers = bootstrapServers;
return this;
}
/**
* Schema Registry URL
*
* Confluent Kafka Schema Registry URL.
*
*/
@JsonProperty("schemaRegistryURL")
public URI getSchemaRegistryURL() {
return schemaRegistryURL;
}
/**
* Schema Registry URL
*
* Confluent Kafka Schema Registry URL.
*
*/
@JsonProperty("schemaRegistryURL")
public void setSchemaRegistryURL(URI schemaRegistryURL) {
this.schemaRegistryURL = schemaRegistryURL;
}
public KafkaConnection withSchemaRegistryURL(URI schemaRegistryURL) {
this.schemaRegistryURL = schemaRegistryURL;
return this;
}
/**
* SASL Username
*
* sasl.username consumer config property
*
*/
@JsonProperty("saslUsername")
public String getSaslUsername() {
return saslUsername;
}
/**
* SASL Username
*
* sasl.username consumer config property
*
*/
@JsonProperty("saslUsername")
public void setSaslUsername(String saslUsername) {
this.saslUsername = saslUsername;
}
public KafkaConnection withSaslUsername(String saslUsername) {
this.saslUsername = saslUsername;
return this;
}
/**
* SASL Password
*
* sasl.password consumer config property
*
*/
@JsonProperty("saslPassword")
@PasswordField
public String getSaslPassword() {
return saslPassword;
}
/**
* SASL Password
*
* sasl.password consumer config property
*
*/
@JsonProperty("saslPassword")
@PasswordField
public void setSaslPassword(String saslPassword) {
this.saslPassword = saslPassword;
}
public KafkaConnection withSaslPassword(String saslPassword) {
this.saslPassword = saslPassword;
return this;
}
/**
* Security Protocol
*
* security.protocol consumer config property
*
*/
@JsonProperty("securityProtocol")
public KafkaConnection.SecurityProtocol getSecurityProtocol() {
return securityProtocol;
}
/**
* Security Protocol
*
* security.protocol consumer config property
*
*/
@JsonProperty("securityProtocol")
public void setSecurityProtocol(KafkaConnection.SecurityProtocol securityProtocol) {
this.securityProtocol = securityProtocol;
}
public KafkaConnection withSecurityProtocol(KafkaConnection.SecurityProtocol securityProtocol) {
this.securityProtocol = securityProtocol;
return this;
}
/**
* SaslMechanismType
*
* SASL Mechanism consumer config property
*
*/
@JsonProperty("saslMechanism")
public SaslMechanismType getSaslMechanism() {
return saslMechanism;
}
/**
* SaslMechanismType
*
* SASL Mechanism consumer config property
*
*/
@JsonProperty("saslMechanism")
public void setSaslMechanism(SaslMechanismType saslMechanism) {
this.saslMechanism = saslMechanism;
}
public KafkaConnection withSaslMechanism(SaslMechanismType saslMechanism) {
this.saslMechanism = saslMechanism;
return this;
}
/**
* Schema Registry Basic Auth User Info
*
* basic.auth.user.info schema registry config property, Client HTTP credentials in the form of username:password.
*
*/
@JsonProperty("basicAuthUserInfo")
@PasswordField
public String getBasicAuthUserInfo() {
return basicAuthUserInfo;
}
/**
* Schema Registry Basic Auth User Info
*
* basic.auth.user.info schema registry config property, Client HTTP credentials in the form of username:password.
*
*/
@JsonProperty("basicAuthUserInfo")
@PasswordField
public void setBasicAuthUserInfo(String basicAuthUserInfo) {
this.basicAuthUserInfo = basicAuthUserInfo;
}
public KafkaConnection withBasicAuthUserInfo(String basicAuthUserInfo) {
this.basicAuthUserInfo = basicAuthUserInfo;
return this;
}
/**
* Consumer Config
*
* Confluent Kafka Consumer Config. From https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
*
*/
@JsonProperty("consumerConfig")
public ConsumerConfig getConsumerConfig() {
return consumerConfig;
}
/**
* Consumer Config
*
* Confluent Kafka Consumer Config. From https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
*
*/
@JsonProperty("consumerConfig")
public void setConsumerConfig(ConsumerConfig consumerConfig) {
this.consumerConfig = consumerConfig;
}
public KafkaConnection withConsumerConfig(ConsumerConfig consumerConfig) {
this.consumerConfig = consumerConfig;
return this;
}
/**
* Schema Registry Config
*
* Confluent Kafka Schema Registry Config. From https://docs.confluent.io/5.5.1/clients/confluent-kafka-python/index.html#confluent_kafka.schema_registry.SchemaRegistryClient
*
*/
@JsonProperty("schemaRegistryConfig")
public SchemaRegistryConfig getSchemaRegistryConfig() {
return schemaRegistryConfig;
}
/**
* Schema Registry Config
*
* Confluent Kafka Schema Registry Config. From https://docs.confluent.io/5.5.1/clients/confluent-kafka-python/index.html#confluent_kafka.schema_registry.SchemaRegistryClient
*
*/
@JsonProperty("schemaRegistryConfig")
public void setSchemaRegistryConfig(SchemaRegistryConfig schemaRegistryConfig) {
this.schemaRegistryConfig = schemaRegistryConfig;
}
public KafkaConnection withSchemaRegistryConfig(SchemaRegistryConfig schemaRegistryConfig) {
this.schemaRegistryConfig = schemaRegistryConfig;
return this;
}
/**
* Schema Registry Topic Suffix Name
*
* Schema Registry Topic Suffix Name. The suffix to be appended to the topic name to get topic schema from registry.
*
*/
@JsonProperty("schemaRegistryTopicSuffixName")
public String getSchemaRegistryTopicSuffixName() {
return schemaRegistryTopicSuffixName;
}
/**
* Schema Registry Topic Suffix Name
*
* Schema Registry Topic Suffix Name. The suffix to be appended to the topic name to get topic schema from registry.
*
*/
@JsonProperty("schemaRegistryTopicSuffixName")
public void setSchemaRegistryTopicSuffixName(String schemaRegistryTopicSuffixName) {
this.schemaRegistryTopicSuffixName = schemaRegistryTopicSuffixName;
}
public KafkaConnection withSchemaRegistryTopicSuffixName(String schemaRegistryTopicSuffixName) {
this.schemaRegistryTopicSuffixName = schemaRegistryTopicSuffixName;
return this;
}
/**
* SSL Config
*
* Client SSL configuration
*
*/
@JsonProperty("schemaRegistrySSL")
@MaskedField
public Object getSchemaRegistrySSL() {
return schemaRegistrySSL;
}
/**
* SSL Config
*
* Client SSL configuration
*
*/
@JsonProperty("schemaRegistrySSL")
@MaskedField
public void setSchemaRegistrySSL(Object schemaRegistrySSL) {
this.schemaRegistrySSL = schemaRegistrySSL;
}
public KafkaConnection withSchemaRegistrySSL(Object schemaRegistrySSL) {
this.schemaRegistrySSL = schemaRegistrySSL;
return this;
}
/**
* Supports Metadata Extraction.
*
*/
@JsonProperty("supportsMetadataExtraction")
public Boolean getSupportsMetadataExtraction() {
return supportsMetadataExtraction;
}
/**
* Supports Metadata Extraction.
*
*/
@JsonProperty("supportsMetadataExtraction")
public void setSupportsMetadataExtraction(Boolean supportsMetadataExtraction) {
this.supportsMetadataExtraction = supportsMetadataExtraction;
}
public KafkaConnection withSupportsMetadataExtraction(Boolean supportsMetadataExtraction) {
this.supportsMetadataExtraction = supportsMetadataExtraction;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(KafkaConnection.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("type");
sb.append('=');
sb.append(((this.type == null)?"":this.type));
sb.append(',');
sb.append("bootstrapServers");
sb.append('=');
sb.append(((this.bootstrapServers == null)?"":this.bootstrapServers));
sb.append(',');
sb.append("schemaRegistryURL");
sb.append('=');
sb.append(((this.schemaRegistryURL == null)?"":this.schemaRegistryURL));
sb.append(',');
sb.append("saslUsername");
sb.append('=');
sb.append(((this.saslUsername == null)?"":this.saslUsername));
sb.append(',');
sb.append("saslPassword");
sb.append('=');
sb.append(((this.saslPassword == null)?"":this.saslPassword));
sb.append(',');
sb.append("securityProtocol");
sb.append('=');
sb.append(((this.securityProtocol == null)?"":this.securityProtocol));
sb.append(',');
sb.append("saslMechanism");
sb.append('=');
sb.append(((this.saslMechanism == null)?"":this.saslMechanism));
sb.append(',');
sb.append("basicAuthUserInfo");
sb.append('=');
sb.append(((this.basicAuthUserInfo == null)?"":this.basicAuthUserInfo));
sb.append(',');
sb.append("consumerConfig");
sb.append('=');
sb.append(((this.consumerConfig == null)?"":this.consumerConfig));
sb.append(',');
sb.append("schemaRegistryConfig");
sb.append('=');
sb.append(((this.schemaRegistryConfig == null)?"":this.schemaRegistryConfig));
sb.append(',');
sb.append("schemaRegistryTopicSuffixName");
sb.append('=');
sb.append(((this.schemaRegistryTopicSuffixName == null)?"":this.schemaRegistryTopicSuffixName));
sb.append(',');
sb.append("schemaRegistrySSL");
sb.append('=');
sb.append(((this.schemaRegistrySSL == null)?"":this.schemaRegistrySSL));
sb.append(',');
sb.append("supportsMetadataExtraction");
sb.append('=');
sb.append(((this.supportsMetadataExtraction == null)?"":this.supportsMetadataExtraction));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.schemaRegistryURL == null)? 0 :this.schemaRegistryURL.hashCode()));
result = ((result* 31)+((this.supportsMetadataExtraction == null)? 0 :this.supportsMetadataExtraction.hashCode()));
result = ((result* 31)+((this.consumerConfig == null)? 0 :this.consumerConfig.hashCode()));
result = ((result* 31)+((this.basicAuthUserInfo == null)? 0 :this.basicAuthUserInfo.hashCode()));
result = ((result* 31)+((this.saslUsername == null)? 0 :this.saslUsername.hashCode()));
result = ((result* 31)+((this.saslMechanism == null)? 0 :this.saslMechanism.hashCode()));
result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode()));
result = ((result* 31)+((this.securityProtocol == null)? 0 :this.securityProtocol.hashCode()));
result = ((result* 31)+((this.bootstrapServers == null)? 0 :this.bootstrapServers.hashCode()));
result = ((result* 31)+((this.schemaRegistryTopicSuffixName == null)? 0 :this.schemaRegistryTopicSuffixName.hashCode()));
result = ((result* 31)+((this.saslPassword == null)? 0 :this.saslPassword.hashCode()));
result = ((result* 31)+((this.schemaRegistryConfig == null)? 0 :this.schemaRegistryConfig.hashCode()));
result = ((result* 31)+((this.schemaRegistrySSL == null)? 0 :this.schemaRegistrySSL.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof KafkaConnection) == false) {
return false;
}
KafkaConnection rhs = ((KafkaConnection) other);
return ((((((((((((((this.schemaRegistryURL == rhs.schemaRegistryURL)||((this.schemaRegistryURL!= null)&&this.schemaRegistryURL.equals(rhs.schemaRegistryURL)))&&((this.supportsMetadataExtraction == rhs.supportsMetadataExtraction)||((this.supportsMetadataExtraction!= null)&&this.supportsMetadataExtraction.equals(rhs.supportsMetadataExtraction))))&&((this.consumerConfig == rhs.consumerConfig)||((this.consumerConfig!= null)&&this.consumerConfig.equals(rhs.consumerConfig))))&&((this.basicAuthUserInfo == rhs.basicAuthUserInfo)||((this.basicAuthUserInfo!= null)&&this.basicAuthUserInfo.equals(rhs.basicAuthUserInfo))))&&((this.saslUsername == rhs.saslUsername)||((this.saslUsername!= null)&&this.saslUsername.equals(rhs.saslUsername))))&&((this.saslMechanism == rhs.saslMechanism)||((this.saslMechanism!= null)&&this.saslMechanism.equals(rhs.saslMechanism))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.securityProtocol == rhs.securityProtocol)||((this.securityProtocol!= null)&&this.securityProtocol.equals(rhs.securityProtocol))))&&((this.bootstrapServers == rhs.bootstrapServers)||((this.bootstrapServers!= null)&&this.bootstrapServers.equals(rhs.bootstrapServers))))&&((this.schemaRegistryTopicSuffixName == rhs.schemaRegistryTopicSuffixName)||((this.schemaRegistryTopicSuffixName!= null)&&this.schemaRegistryTopicSuffixName.equals(rhs.schemaRegistryTopicSuffixName))))&&((this.saslPassword == rhs.saslPassword)||((this.saslPassword!= null)&&this.saslPassword.equals(rhs.saslPassword))))&&((this.schemaRegistryConfig == rhs.schemaRegistryConfig)||((this.schemaRegistryConfig!= null)&&this.schemaRegistryConfig.equals(rhs.schemaRegistryConfig))))&&((this.schemaRegistrySSL == rhs.schemaRegistrySSL)||((this.schemaRegistrySSL!= null)&&this.schemaRegistrySSL.equals(rhs.schemaRegistrySSL))));
}
/**
* Kafka service type
*
*/
@Generated("jsonschema2pojo")
public enum KafkaType {
KAFKA("Kafka");
private final String value;
private final static Map CONSTANTS = new HashMap();
static {
for (KafkaConnection.KafkaType c: values()) {
CONSTANTS.put(c.value, c);
}
}
KafkaType(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static KafkaConnection.KafkaType fromValue(String value) {
KafkaConnection.KafkaType constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
/**
* Security Protocol
*
* security.protocol consumer config property
*
*/
@Generated("jsonschema2pojo")
public enum SecurityProtocol {
PLAINTEXT("PLAINTEXT"),
SASL_PLAINTEXT("SASL_PLAINTEXT"),
SASL_SSL("SASL_SSL"),
SSL("SSL");
private final String value;
private final static Map CONSTANTS = new HashMap();
static {
for (KafkaConnection.SecurityProtocol c: values()) {
CONSTANTS.put(c.value, c);
}
}
SecurityProtocol(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static KafkaConnection.SecurityProtocol fromValue(String value) {
KafkaConnection.SecurityProtocol constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}