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

software.amazon.awssdk.services.kafkaconnect.model.ConnectorSummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Kafka Connect module holds the client classes that are used for communicating with Kafka Connect.

There is a newer version: 2.28.4
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.kafkaconnect.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Summary of a connector. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ConnectorSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CAPACITY_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("capacity") .getter(getter(ConnectorSummary::capacity)).setter(setter(Builder::capacity)) .constructor(CapacityDescription::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("capacity").build()).build(); private static final SdkField CONNECTOR_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("connectorArn").getter(getter(ConnectorSummary::connectorArn)).setter(setter(Builder::connectorArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectorArn").build()).build(); private static final SdkField CONNECTOR_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("connectorDescription").getter(getter(ConnectorSummary::connectorDescription)) .setter(setter(Builder::connectorDescription)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectorDescription").build()) .build(); private static final SdkField CONNECTOR_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("connectorName").getter(getter(ConnectorSummary::connectorName)).setter(setter(Builder::connectorName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectorName").build()).build(); private static final SdkField CONNECTOR_STATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("connectorState").getter(getter(ConnectorSummary::connectorStateAsString)) .setter(setter(Builder::connectorState)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectorState").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("creationTime") .getter(getter(ConnectorSummary::creationTime)) .setter(setter(Builder::creationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationTime").build(), TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build(); private static final SdkField CURRENT_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("currentVersion").getter(getter(ConnectorSummary::currentVersion)) .setter(setter(Builder::currentVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("currentVersion").build()).build(); private static final SdkField KAFKA_CLUSTER_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("kafkaCluster") .getter(getter(ConnectorSummary::kafkaCluster)).setter(setter(Builder::kafkaCluster)) .constructor(KafkaClusterDescription::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kafkaCluster").build()).build(); private static final SdkField KAFKA_CLUSTER_CLIENT_AUTHENTICATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("kafkaClusterClientAuthentication") .getter(getter(ConnectorSummary::kafkaClusterClientAuthentication)) .setter(setter(Builder::kafkaClusterClientAuthentication)) .constructor(KafkaClusterClientAuthenticationDescription::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kafkaClusterClientAuthentication") .build()).build(); private static final SdkField KAFKA_CLUSTER_ENCRYPTION_IN_TRANSIT_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("kafkaClusterEncryptionInTransit") .getter(getter(ConnectorSummary::kafkaClusterEncryptionInTransit)) .setter(setter(Builder::kafkaClusterEncryptionInTransit)) .constructor(KafkaClusterEncryptionInTransitDescription::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kafkaClusterEncryptionInTransit") .build()).build(); private static final SdkField KAFKA_CONNECT_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("kafkaConnectVersion").getter(getter(ConnectorSummary::kafkaConnectVersion)) .setter(setter(Builder::kafkaConnectVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kafkaConnectVersion").build()) .build(); private static final SdkField LOG_DELIVERY_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("logDelivery") .getter(getter(ConnectorSummary::logDelivery)).setter(setter(Builder::logDelivery)) .constructor(LogDeliveryDescription::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("logDelivery").build()).build(); private static final SdkField> PLUGINS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("plugins") .getter(getter(ConnectorSummary::plugins)) .setter(setter(Builder::plugins)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("plugins").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(PluginDescription::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField SERVICE_EXECUTION_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("serviceExecutionRoleArn").getter(getter(ConnectorSummary::serviceExecutionRoleArn)) .setter(setter(Builder::serviceExecutionRoleArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceExecutionRoleArn").build()) .build(); private static final SdkField WORKER_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("workerConfiguration") .getter(getter(ConnectorSummary::workerConfiguration)).setter(setter(Builder::workerConfiguration)) .constructor(WorkerConfigurationDescription::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("workerConfiguration").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CAPACITY_FIELD, CONNECTOR_ARN_FIELD, CONNECTOR_DESCRIPTION_FIELD, CONNECTOR_NAME_FIELD, CONNECTOR_STATE_FIELD, CREATION_TIME_FIELD, CURRENT_VERSION_FIELD, KAFKA_CLUSTER_FIELD, KAFKA_CLUSTER_CLIENT_AUTHENTICATION_FIELD, KAFKA_CLUSTER_ENCRYPTION_IN_TRANSIT_FIELD, KAFKA_CONNECT_VERSION_FIELD, LOG_DELIVERY_FIELD, PLUGINS_FIELD, SERVICE_EXECUTION_ROLE_ARN_FIELD, WORKER_CONFIGURATION_FIELD)); private static final long serialVersionUID = 1L; private final CapacityDescription capacity; private final String connectorArn; private final String connectorDescription; private final String connectorName; private final String connectorState; private final Instant creationTime; private final String currentVersion; private final KafkaClusterDescription kafkaCluster; private final KafkaClusterClientAuthenticationDescription kafkaClusterClientAuthentication; private final KafkaClusterEncryptionInTransitDescription kafkaClusterEncryptionInTransit; private final String kafkaConnectVersion; private final LogDeliveryDescription logDelivery; private final List plugins; private final String serviceExecutionRoleArn; private final WorkerConfigurationDescription workerConfiguration; private ConnectorSummary(BuilderImpl builder) { this.capacity = builder.capacity; this.connectorArn = builder.connectorArn; this.connectorDescription = builder.connectorDescription; this.connectorName = builder.connectorName; this.connectorState = builder.connectorState; this.creationTime = builder.creationTime; this.currentVersion = builder.currentVersion; this.kafkaCluster = builder.kafkaCluster; this.kafkaClusterClientAuthentication = builder.kafkaClusterClientAuthentication; this.kafkaClusterEncryptionInTransit = builder.kafkaClusterEncryptionInTransit; this.kafkaConnectVersion = builder.kafkaConnectVersion; this.logDelivery = builder.logDelivery; this.plugins = builder.plugins; this.serviceExecutionRoleArn = builder.serviceExecutionRoleArn; this.workerConfiguration = builder.workerConfiguration; } /** *

* The connector's compute capacity settings. *

* * @return The connector's compute capacity settings. */ public final CapacityDescription capacity() { return capacity; } /** *

* The Amazon Resource Name (ARN) of the connector. *

* * @return The Amazon Resource Name (ARN) of the connector. */ public final String connectorArn() { return connectorArn; } /** *

* The description of the connector. *

* * @return The description of the connector. */ public final String connectorDescription() { return connectorDescription; } /** *

* The name of the connector. *

* * @return The name of the connector. */ public final String connectorName() { return connectorName; } /** *

* The state of the connector. *

*

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

* * @return The state of the connector. * @see ConnectorState */ public final ConnectorState connectorState() { return ConnectorState.fromValue(connectorState); } /** *

* The state of the connector. *

*

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

* * @return The state of the connector. * @see ConnectorState */ public final String connectorStateAsString() { return connectorState; } /** *

* The time that the connector was created. *

* * @return The time that the connector was created. */ public final Instant creationTime() { return creationTime; } /** *

* The current version of the connector. *

* * @return The current version of the connector. */ public final String currentVersion() { return currentVersion; } /** *

* The details of the Apache Kafka cluster to which the connector is connected. *

* * @return The details of the Apache Kafka cluster to which the connector is connected. */ public final KafkaClusterDescription kafkaCluster() { return kafkaCluster; } /** *

* The type of client authentication used to connect to the Apache Kafka cluster. The value is NONE when no client * authentication is used. *

* * @return The type of client authentication used to connect to the Apache Kafka cluster. The value is NONE when no * client authentication is used. */ public final KafkaClusterClientAuthenticationDescription kafkaClusterClientAuthentication() { return kafkaClusterClientAuthentication; } /** *

* Details of encryption in transit to the Apache Kafka cluster. *

* * @return Details of encryption in transit to the Apache Kafka cluster. */ public final KafkaClusterEncryptionInTransitDescription kafkaClusterEncryptionInTransit() { return kafkaClusterEncryptionInTransit; } /** *

* The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the * plugins. *

* * @return The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and * the plugins. */ public final String kafkaConnectVersion() { return kafkaConnectVersion; } /** *

* The settings for delivering connector logs to Amazon CloudWatch Logs. *

* * @return The settings for delivering connector logs to Amazon CloudWatch Logs. */ public final LogDeliveryDescription logDelivery() { return logDelivery; } /** * For responses, this returns true if the service returned a value for the Plugins property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasPlugins() { return plugins != null && !(plugins instanceof SdkAutoConstructList); } /** *

* Specifies which plugins were used for this connector. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasPlugins} method. *

* * @return Specifies which plugins were used for this connector. */ public final List plugins() { return plugins; } /** *

* The Amazon Resource Name (ARN) of the IAM role used by the connector to access Amazon Web Services resources. *

* * @return The Amazon Resource Name (ARN) of the IAM role used by the connector to access Amazon Web Services * resources. */ public final String serviceExecutionRoleArn() { return serviceExecutionRoleArn; } /** *

* The worker configurations that are in use with the connector. *

* * @return The worker configurations that are in use with the connector. */ public final WorkerConfigurationDescription workerConfiguration() { return workerConfiguration; } @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(capacity()); hashCode = 31 * hashCode + Objects.hashCode(connectorArn()); hashCode = 31 * hashCode + Objects.hashCode(connectorDescription()); hashCode = 31 * hashCode + Objects.hashCode(connectorName()); hashCode = 31 * hashCode + Objects.hashCode(connectorStateAsString()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(currentVersion()); hashCode = 31 * hashCode + Objects.hashCode(kafkaCluster()); hashCode = 31 * hashCode + Objects.hashCode(kafkaClusterClientAuthentication()); hashCode = 31 * hashCode + Objects.hashCode(kafkaClusterEncryptionInTransit()); hashCode = 31 * hashCode + Objects.hashCode(kafkaConnectVersion()); hashCode = 31 * hashCode + Objects.hashCode(logDelivery()); hashCode = 31 * hashCode + Objects.hashCode(hasPlugins() ? plugins() : null); hashCode = 31 * hashCode + Objects.hashCode(serviceExecutionRoleArn()); hashCode = 31 * hashCode + Objects.hashCode(workerConfiguration()); 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 ConnectorSummary)) { return false; } ConnectorSummary other = (ConnectorSummary) obj; return Objects.equals(capacity(), other.capacity()) && Objects.equals(connectorArn(), other.connectorArn()) && Objects.equals(connectorDescription(), other.connectorDescription()) && Objects.equals(connectorName(), other.connectorName()) && Objects.equals(connectorStateAsString(), other.connectorStateAsString()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(currentVersion(), other.currentVersion()) && Objects.equals(kafkaCluster(), other.kafkaCluster()) && Objects.equals(kafkaClusterClientAuthentication(), other.kafkaClusterClientAuthentication()) && Objects.equals(kafkaClusterEncryptionInTransit(), other.kafkaClusterEncryptionInTransit()) && Objects.equals(kafkaConnectVersion(), other.kafkaConnectVersion()) && Objects.equals(logDelivery(), other.logDelivery()) && hasPlugins() == other.hasPlugins() && Objects.equals(plugins(), other.plugins()) && Objects.equals(serviceExecutionRoleArn(), other.serviceExecutionRoleArn()) && Objects.equals(workerConfiguration(), other.workerConfiguration()); } /** * 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("ConnectorSummary").add("Capacity", capacity()).add("ConnectorArn", connectorArn()) .add("ConnectorDescription", connectorDescription()).add("ConnectorName", connectorName()) .add("ConnectorState", connectorStateAsString()).add("CreationTime", creationTime()) .add("CurrentVersion", currentVersion()).add("KafkaCluster", kafkaCluster()) .add("KafkaClusterClientAuthentication", kafkaClusterClientAuthentication()) .add("KafkaClusterEncryptionInTransit", kafkaClusterEncryptionInTransit()) .add("KafkaConnectVersion", kafkaConnectVersion()).add("LogDelivery", logDelivery()) .add("Plugins", hasPlugins() ? plugins() : null).add("ServiceExecutionRoleArn", serviceExecutionRoleArn()) .add("WorkerConfiguration", workerConfiguration()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "capacity": return Optional.ofNullable(clazz.cast(capacity())); case "connectorArn": return Optional.ofNullable(clazz.cast(connectorArn())); case "connectorDescription": return Optional.ofNullable(clazz.cast(connectorDescription())); case "connectorName": return Optional.ofNullable(clazz.cast(connectorName())); case "connectorState": return Optional.ofNullable(clazz.cast(connectorStateAsString())); case "creationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "currentVersion": return Optional.ofNullable(clazz.cast(currentVersion())); case "kafkaCluster": return Optional.ofNullable(clazz.cast(kafkaCluster())); case "kafkaClusterClientAuthentication": return Optional.ofNullable(clazz.cast(kafkaClusterClientAuthentication())); case "kafkaClusterEncryptionInTransit": return Optional.ofNullable(clazz.cast(kafkaClusterEncryptionInTransit())); case "kafkaConnectVersion": return Optional.ofNullable(clazz.cast(kafkaConnectVersion())); case "logDelivery": return Optional.ofNullable(clazz.cast(logDelivery())); case "plugins": return Optional.ofNullable(clazz.cast(plugins())); case "serviceExecutionRoleArn": return Optional.ofNullable(clazz.cast(serviceExecutionRoleArn())); case "workerConfiguration": return Optional.ofNullable(clazz.cast(workerConfiguration())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ConnectorSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The connector's compute capacity settings. *

* * @param capacity * The connector's compute capacity settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder capacity(CapacityDescription capacity); /** *

* The connector's compute capacity settings. *

* This is a convenience method that creates an instance of the {@link CapacityDescription.Builder} avoiding the * need to create one manually via {@link CapacityDescription#builder()}. * *

* When the {@link Consumer} completes, {@link CapacityDescription.Builder#build()} is called immediately and * its result is passed to {@link #capacity(CapacityDescription)}. * * @param capacity * a consumer that will call methods on {@link CapacityDescription.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #capacity(CapacityDescription) */ default Builder capacity(Consumer capacity) { return capacity(CapacityDescription.builder().applyMutation(capacity).build()); } /** *

* The Amazon Resource Name (ARN) of the connector. *

* * @param connectorArn * The Amazon Resource Name (ARN) of the connector. * @return Returns a reference to this object so that method calls can be chained together. */ Builder connectorArn(String connectorArn); /** *

* The description of the connector. *

* * @param connectorDescription * The description of the connector. * @return Returns a reference to this object so that method calls can be chained together. */ Builder connectorDescription(String connectorDescription); /** *

* The name of the connector. *

* * @param connectorName * The name of the connector. * @return Returns a reference to this object so that method calls can be chained together. */ Builder connectorName(String connectorName); /** *

* The state of the connector. *

* * @param connectorState * The state of the connector. * @see ConnectorState * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectorState */ Builder connectorState(String connectorState); /** *

* The state of the connector. *

* * @param connectorState * The state of the connector. * @see ConnectorState * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectorState */ Builder connectorState(ConnectorState connectorState); /** *

* The time that the connector was created. *

* * @param creationTime * The time that the connector was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

* The current version of the connector. *

* * @param currentVersion * The current version of the connector. * @return Returns a reference to this object so that method calls can be chained together. */ Builder currentVersion(String currentVersion); /** *

* The details of the Apache Kafka cluster to which the connector is connected. *

* * @param kafkaCluster * The details of the Apache Kafka cluster to which the connector is connected. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kafkaCluster(KafkaClusterDescription kafkaCluster); /** *

* The details of the Apache Kafka cluster to which the connector is connected. *

* This is a convenience method that creates an instance of the {@link KafkaClusterDescription.Builder} avoiding * the need to create one manually via {@link KafkaClusterDescription#builder()}. * *

* When the {@link Consumer} completes, {@link KafkaClusterDescription.Builder#build()} is called immediately * and its result is passed to {@link #kafkaCluster(KafkaClusterDescription)}. * * @param kafkaCluster * a consumer that will call methods on {@link KafkaClusterDescription.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #kafkaCluster(KafkaClusterDescription) */ default Builder kafkaCluster(Consumer kafkaCluster) { return kafkaCluster(KafkaClusterDescription.builder().applyMutation(kafkaCluster).build()); } /** *

* The type of client authentication used to connect to the Apache Kafka cluster. The value is NONE when no * client authentication is used. *

* * @param kafkaClusterClientAuthentication * The type of client authentication used to connect to the Apache Kafka cluster. The value is NONE when * no client authentication is used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kafkaClusterClientAuthentication(KafkaClusterClientAuthenticationDescription kafkaClusterClientAuthentication); /** *

* The type of client authentication used to connect to the Apache Kafka cluster. The value is NONE when no * client authentication is used. *

* This is a convenience method that creates an instance of the * {@link KafkaClusterClientAuthenticationDescription.Builder} avoiding the need to create one manually via * {@link KafkaClusterClientAuthenticationDescription#builder()}. * *

* When the {@link Consumer} completes, {@link KafkaClusterClientAuthenticationDescription.Builder#build()} is * called immediately and its result is passed to * {@link #kafkaClusterClientAuthentication(KafkaClusterClientAuthenticationDescription)}. * * @param kafkaClusterClientAuthentication * a consumer that will call methods on {@link KafkaClusterClientAuthenticationDescription.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #kafkaClusterClientAuthentication(KafkaClusterClientAuthenticationDescription) */ default Builder kafkaClusterClientAuthentication( Consumer kafkaClusterClientAuthentication) { return kafkaClusterClientAuthentication(KafkaClusterClientAuthenticationDescription.builder() .applyMutation(kafkaClusterClientAuthentication).build()); } /** *

* Details of encryption in transit to the Apache Kafka cluster. *

* * @param kafkaClusterEncryptionInTransit * Details of encryption in transit to the Apache Kafka cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kafkaClusterEncryptionInTransit(KafkaClusterEncryptionInTransitDescription kafkaClusterEncryptionInTransit); /** *

* Details of encryption in transit to the Apache Kafka cluster. *

* This is a convenience method that creates an instance of the * {@link KafkaClusterEncryptionInTransitDescription.Builder} avoiding the need to create one manually via * {@link KafkaClusterEncryptionInTransitDescription#builder()}. * *

* When the {@link Consumer} completes, {@link KafkaClusterEncryptionInTransitDescription.Builder#build()} is * called immediately and its result is passed to * {@link #kafkaClusterEncryptionInTransit(KafkaClusterEncryptionInTransitDescription)}. * * @param kafkaClusterEncryptionInTransit * a consumer that will call methods on {@link KafkaClusterEncryptionInTransitDescription.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #kafkaClusterEncryptionInTransit(KafkaClusterEncryptionInTransitDescription) */ default Builder kafkaClusterEncryptionInTransit( Consumer kafkaClusterEncryptionInTransit) { return kafkaClusterEncryptionInTransit(KafkaClusterEncryptionInTransitDescription.builder() .applyMutation(kafkaClusterEncryptionInTransit).build()); } /** *

* The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the * plugins. *

* * @param kafkaConnectVersion * The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and * the plugins. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kafkaConnectVersion(String kafkaConnectVersion); /** *

* The settings for delivering connector logs to Amazon CloudWatch Logs. *

* * @param logDelivery * The settings for delivering connector logs to Amazon CloudWatch Logs. * @return Returns a reference to this object so that method calls can be chained together. */ Builder logDelivery(LogDeliveryDescription logDelivery); /** *

* The settings for delivering connector logs to Amazon CloudWatch Logs. *

* This is a convenience method that creates an instance of the {@link LogDeliveryDescription.Builder} avoiding * the need to create one manually via {@link LogDeliveryDescription#builder()}. * *

* When the {@link Consumer} completes, {@link LogDeliveryDescription.Builder#build()} is called immediately and * its result is passed to {@link #logDelivery(LogDeliveryDescription)}. * * @param logDelivery * a consumer that will call methods on {@link LogDeliveryDescription.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #logDelivery(LogDeliveryDescription) */ default Builder logDelivery(Consumer logDelivery) { return logDelivery(LogDeliveryDescription.builder().applyMutation(logDelivery).build()); } /** *

* Specifies which plugins were used for this connector. *

* * @param plugins * Specifies which plugins were used for this connector. * @return Returns a reference to this object so that method calls can be chained together. */ Builder plugins(Collection plugins); /** *

* Specifies which plugins were used for this connector. *

* * @param plugins * Specifies which plugins were used for this connector. * @return Returns a reference to this object so that method calls can be chained together. */ Builder plugins(PluginDescription... plugins); /** *

* Specifies which plugins were used for this connector. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.kafkaconnect.model.PluginDescription.Builder} avoiding the need to * create one manually via * {@link software.amazon.awssdk.services.kafkaconnect.model.PluginDescription#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.kafkaconnect.model.PluginDescription.Builder#build()} is called * immediately and its result is passed to {@link #plugins(List)}. * * @param plugins * a consumer that will call methods on * {@link software.amazon.awssdk.services.kafkaconnect.model.PluginDescription.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #plugins(java.util.Collection) */ Builder plugins(Consumer... plugins); /** *

* The Amazon Resource Name (ARN) of the IAM role used by the connector to access Amazon Web Services resources. *

* * @param serviceExecutionRoleArn * The Amazon Resource Name (ARN) of the IAM role used by the connector to access Amazon Web Services * resources. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceExecutionRoleArn(String serviceExecutionRoleArn); /** *

* The worker configurations that are in use with the connector. *

* * @param workerConfiguration * The worker configurations that are in use with the connector. * @return Returns a reference to this object so that method calls can be chained together. */ Builder workerConfiguration(WorkerConfigurationDescription workerConfiguration); /** *

* The worker configurations that are in use with the connector. *

* This is a convenience method that creates an instance of the {@link WorkerConfigurationDescription.Builder} * avoiding the need to create one manually via {@link WorkerConfigurationDescription#builder()}. * *

* When the {@link Consumer} completes, {@link WorkerConfigurationDescription.Builder#build()} is called * immediately and its result is passed to {@link #workerConfiguration(WorkerConfigurationDescription)}. * * @param workerConfiguration * a consumer that will call methods on {@link WorkerConfigurationDescription.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #workerConfiguration(WorkerConfigurationDescription) */ default Builder workerConfiguration(Consumer workerConfiguration) { return workerConfiguration(WorkerConfigurationDescription.builder().applyMutation(workerConfiguration).build()); } } static final class BuilderImpl implements Builder { private CapacityDescription capacity; private String connectorArn; private String connectorDescription; private String connectorName; private String connectorState; private Instant creationTime; private String currentVersion; private KafkaClusterDescription kafkaCluster; private KafkaClusterClientAuthenticationDescription kafkaClusterClientAuthentication; private KafkaClusterEncryptionInTransitDescription kafkaClusterEncryptionInTransit; private String kafkaConnectVersion; private LogDeliveryDescription logDelivery; private List plugins = DefaultSdkAutoConstructList.getInstance(); private String serviceExecutionRoleArn; private WorkerConfigurationDescription workerConfiguration; private BuilderImpl() { } private BuilderImpl(ConnectorSummary model) { capacity(model.capacity); connectorArn(model.connectorArn); connectorDescription(model.connectorDescription); connectorName(model.connectorName); connectorState(model.connectorState); creationTime(model.creationTime); currentVersion(model.currentVersion); kafkaCluster(model.kafkaCluster); kafkaClusterClientAuthentication(model.kafkaClusterClientAuthentication); kafkaClusterEncryptionInTransit(model.kafkaClusterEncryptionInTransit); kafkaConnectVersion(model.kafkaConnectVersion); logDelivery(model.logDelivery); plugins(model.plugins); serviceExecutionRoleArn(model.serviceExecutionRoleArn); workerConfiguration(model.workerConfiguration); } public final CapacityDescription.Builder getCapacity() { return capacity != null ? capacity.toBuilder() : null; } public final void setCapacity(CapacityDescription.BuilderImpl capacity) { this.capacity = capacity != null ? capacity.build() : null; } @Override public final Builder capacity(CapacityDescription capacity) { this.capacity = capacity; return this; } public final String getConnectorArn() { return connectorArn; } public final void setConnectorArn(String connectorArn) { this.connectorArn = connectorArn; } @Override public final Builder connectorArn(String connectorArn) { this.connectorArn = connectorArn; return this; } public final String getConnectorDescription() { return connectorDescription; } public final void setConnectorDescription(String connectorDescription) { this.connectorDescription = connectorDescription; } @Override public final Builder connectorDescription(String connectorDescription) { this.connectorDescription = connectorDescription; return this; } public final String getConnectorName() { return connectorName; } public final void setConnectorName(String connectorName) { this.connectorName = connectorName; } @Override public final Builder connectorName(String connectorName) { this.connectorName = connectorName; return this; } public final String getConnectorState() { return connectorState; } public final void setConnectorState(String connectorState) { this.connectorState = connectorState; } @Override public final Builder connectorState(String connectorState) { this.connectorState = connectorState; return this; } @Override public final Builder connectorState(ConnectorState connectorState) { this.connectorState(connectorState == null ? null : connectorState.toString()); return this; } public final Instant getCreationTime() { return creationTime; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final String getCurrentVersion() { return currentVersion; } public final void setCurrentVersion(String currentVersion) { this.currentVersion = currentVersion; } @Override public final Builder currentVersion(String currentVersion) { this.currentVersion = currentVersion; return this; } public final KafkaClusterDescription.Builder getKafkaCluster() { return kafkaCluster != null ? kafkaCluster.toBuilder() : null; } public final void setKafkaCluster(KafkaClusterDescription.BuilderImpl kafkaCluster) { this.kafkaCluster = kafkaCluster != null ? kafkaCluster.build() : null; } @Override public final Builder kafkaCluster(KafkaClusterDescription kafkaCluster) { this.kafkaCluster = kafkaCluster; return this; } public final KafkaClusterClientAuthenticationDescription.Builder getKafkaClusterClientAuthentication() { return kafkaClusterClientAuthentication != null ? kafkaClusterClientAuthentication.toBuilder() : null; } public final void setKafkaClusterClientAuthentication( KafkaClusterClientAuthenticationDescription.BuilderImpl kafkaClusterClientAuthentication) { this.kafkaClusterClientAuthentication = kafkaClusterClientAuthentication != null ? kafkaClusterClientAuthentication .build() : null; } @Override public final Builder kafkaClusterClientAuthentication( KafkaClusterClientAuthenticationDescription kafkaClusterClientAuthentication) { this.kafkaClusterClientAuthentication = kafkaClusterClientAuthentication; return this; } public final KafkaClusterEncryptionInTransitDescription.Builder getKafkaClusterEncryptionInTransit() { return kafkaClusterEncryptionInTransit != null ? kafkaClusterEncryptionInTransit.toBuilder() : null; } public final void setKafkaClusterEncryptionInTransit( KafkaClusterEncryptionInTransitDescription.BuilderImpl kafkaClusterEncryptionInTransit) { this.kafkaClusterEncryptionInTransit = kafkaClusterEncryptionInTransit != null ? kafkaClusterEncryptionInTransit .build() : null; } @Override public final Builder kafkaClusterEncryptionInTransit( KafkaClusterEncryptionInTransitDescription kafkaClusterEncryptionInTransit) { this.kafkaClusterEncryptionInTransit = kafkaClusterEncryptionInTransit; return this; } public final String getKafkaConnectVersion() { return kafkaConnectVersion; } public final void setKafkaConnectVersion(String kafkaConnectVersion) { this.kafkaConnectVersion = kafkaConnectVersion; } @Override public final Builder kafkaConnectVersion(String kafkaConnectVersion) { this.kafkaConnectVersion = kafkaConnectVersion; return this; } public final LogDeliveryDescription.Builder getLogDelivery() { return logDelivery != null ? logDelivery.toBuilder() : null; } public final void setLogDelivery(LogDeliveryDescription.BuilderImpl logDelivery) { this.logDelivery = logDelivery != null ? logDelivery.build() : null; } @Override public final Builder logDelivery(LogDeliveryDescription logDelivery) { this.logDelivery = logDelivery; return this; } public final List getPlugins() { List result = ___listOfPluginDescriptionCopier.copyToBuilder(this.plugins); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setPlugins(Collection plugins) { this.plugins = ___listOfPluginDescriptionCopier.copyFromBuilder(plugins); } @Override public final Builder plugins(Collection plugins) { this.plugins = ___listOfPluginDescriptionCopier.copy(plugins); return this; } @Override @SafeVarargs public final Builder plugins(PluginDescription... plugins) { plugins(Arrays.asList(plugins)); return this; } @Override @SafeVarargs public final Builder plugins(Consumer... plugins) { plugins(Stream.of(plugins).map(c -> PluginDescription.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getServiceExecutionRoleArn() { return serviceExecutionRoleArn; } public final void setServiceExecutionRoleArn(String serviceExecutionRoleArn) { this.serviceExecutionRoleArn = serviceExecutionRoleArn; } @Override public final Builder serviceExecutionRoleArn(String serviceExecutionRoleArn) { this.serviceExecutionRoleArn = serviceExecutionRoleArn; return this; } public final WorkerConfigurationDescription.Builder getWorkerConfiguration() { return workerConfiguration != null ? workerConfiguration.toBuilder() : null; } public final void setWorkerConfiguration(WorkerConfigurationDescription.BuilderImpl workerConfiguration) { this.workerConfiguration = workerConfiguration != null ? workerConfiguration.build() : null; } @Override public final Builder workerConfiguration(WorkerConfigurationDescription workerConfiguration) { this.workerConfiguration = workerConfiguration; return this; } @Override public ConnectorSummary build() { return new ConnectorSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy