software.amazon.awscdk.services.pipes.sources.alpha.StreamSourceParameters Maven / Gradle / Ivy
Show all versions of pipes-sources-alpha Show documentation
package software.amazon.awscdk.services.pipes.sources.alpha;
/**
* (experimental) Base parameters for streaming sources.
*
* Example:
*
*
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import software.amazon.awscdk.services.pipes.sources.alpha.*;
* import software.amazon.awscdk.*;
* import software.amazon.awscdk.services.sqs.*;
* Queue queue;
* StreamSourceParameters streamSourceParameters = StreamSourceParameters.builder()
* .batchSize(123)
* .deadLetterTarget(queue)
* .maximumBatchingWindow(Duration.minutes(30))
* .maximumRecordAge(Duration.minutes(30))
* .maximumRetryAttempts(123)
* .onPartialBatchItemFailure(OnPartialBatchItemFailure.AUTOMATIC_BISECT)
* .parallelizationFactor(123)
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-11-13T21:17:43.523Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.pipes.sources.alpha.$Module.class, fqn = "@aws-cdk/aws-pipes-sources-alpha.StreamSourceParameters")
@software.amazon.jsii.Jsii.Proxy(StreamSourceParameters.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface StreamSourceParameters extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The maximum number of records to include in each batch.
*
* Default: 1
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-batchsize
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getBatchSize() {
return null;
}
/**
* (experimental) Define the target to send dead-letter queue events to.
*
* The dead-letter queue stores any events that are not successfully delivered to a Pipes target after all retry attempts are exhausted.
* You can then resolve the issue that caused the failed invocations and replay the events at a later time.
* In some cases, such as when access is denied to a resource, events are sent directly to the dead-letter queue and are not retried.
*
* Default: - no dead-letter queue or topic
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-deadletterconfig
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Object getDeadLetterTarget() {
return null;
}
/**
* (experimental) The maximum length of a time to wait for events.
*
* Default: - the events will be handled immediately
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-maximumbatchingwindowinseconds
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getMaximumBatchingWindow() {
return null;
}
/**
* (experimental) Discard records older than the specified age.
*
* The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, EventBridge never discards old records.
*
* Default: -1 - EventBridge won't discard old records
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-maximumrecordageinseconds
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getMaximumRecordAge() {
return null;
}
/**
* (experimental) Discard records after the specified number of retries.
*
* The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, EventBridge retries failed records until the record expires in the event source.
*
* Default: -1 - EventBridge will retry failed records until the record expires in the event source
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-maximumretryattempts
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getMaximumRetryAttempts() {
return null;
}
/**
* (experimental) Define how to handle item process failures.
*
* {@link OnPartialBatchItemFailure.AUTOMATIC_BISECT} halves each batch and will retry each half until all the records are processed or there is one failed message left in the batch.
*
* Default: off - EventBridge will retry the entire batch
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-onpartialbatchitemfailure
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.pipes.sources.alpha.OnPartialBatchItemFailure getOnPartialBatchItemFailure() {
return null;
}
/**
* (experimental) The number of batches to process concurrently from each shard.
*
* Default: 1
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-parallelizationfactor
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getParallelizationFactor() {
return null;
}
/**
* @return a {@link Builder} of {@link StreamSourceParameters}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link StreamSourceParameters}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Number batchSize;
java.lang.Object deadLetterTarget;
software.amazon.awscdk.Duration maximumBatchingWindow;
software.amazon.awscdk.Duration maximumRecordAge;
java.lang.Number maximumRetryAttempts;
software.amazon.awscdk.services.pipes.sources.alpha.OnPartialBatchItemFailure onPartialBatchItemFailure;
java.lang.Number parallelizationFactor;
/**
* Sets the value of {@link StreamSourceParameters#getBatchSize}
* @param batchSize The maximum number of records to include in each batch.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder batchSize(java.lang.Number batchSize) {
this.batchSize = batchSize;
return this;
}
/**
* Sets the value of {@link StreamSourceParameters#getDeadLetterTarget}
* @param deadLetterTarget Define the target to send dead-letter queue events to.
* The dead-letter queue stores any events that are not successfully delivered to a Pipes target after all retry attempts are exhausted.
* You can then resolve the issue that caused the failed invocations and replay the events at a later time.
* In some cases, such as when access is denied to a resource, events are sent directly to the dead-letter queue and are not retried.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder deadLetterTarget(software.amazon.awscdk.services.sqs.IQueue deadLetterTarget) {
this.deadLetterTarget = deadLetterTarget;
return this;
}
/**
* Sets the value of {@link StreamSourceParameters#getDeadLetterTarget}
* @param deadLetterTarget Define the target to send dead-letter queue events to.
* The dead-letter queue stores any events that are not successfully delivered to a Pipes target after all retry attempts are exhausted.
* You can then resolve the issue that caused the failed invocations and replay the events at a later time.
* In some cases, such as when access is denied to a resource, events are sent directly to the dead-letter queue and are not retried.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder deadLetterTarget(software.amazon.awscdk.services.sns.ITopic deadLetterTarget) {
this.deadLetterTarget = deadLetterTarget;
return this;
}
/**
* Sets the value of {@link StreamSourceParameters#getMaximumBatchingWindow}
* @param maximumBatchingWindow The maximum length of a time to wait for events.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maximumBatchingWindow(software.amazon.awscdk.Duration maximumBatchingWindow) {
this.maximumBatchingWindow = maximumBatchingWindow;
return this;
}
/**
* Sets the value of {@link StreamSourceParameters#getMaximumRecordAge}
* @param maximumRecordAge Discard records older than the specified age.
* The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, EventBridge never discards old records.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maximumRecordAge(software.amazon.awscdk.Duration maximumRecordAge) {
this.maximumRecordAge = maximumRecordAge;
return this;
}
/**
* Sets the value of {@link StreamSourceParameters#getMaximumRetryAttempts}
* @param maximumRetryAttempts Discard records after the specified number of retries.
* The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, EventBridge retries failed records until the record expires in the event source.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maximumRetryAttempts(java.lang.Number maximumRetryAttempts) {
this.maximumRetryAttempts = maximumRetryAttempts;
return this;
}
/**
* Sets the value of {@link StreamSourceParameters#getOnPartialBatchItemFailure}
* @param onPartialBatchItemFailure Define how to handle item process failures.
* {@link OnPartialBatchItemFailure.AUTOMATIC_BISECT} halves each batch and will retry each half until all the records are processed or there is one failed message left in the batch.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder onPartialBatchItemFailure(software.amazon.awscdk.services.pipes.sources.alpha.OnPartialBatchItemFailure onPartialBatchItemFailure) {
this.onPartialBatchItemFailure = onPartialBatchItemFailure;
return this;
}
/**
* Sets the value of {@link StreamSourceParameters#getParallelizationFactor}
* @param parallelizationFactor The number of batches to process concurrently from each shard.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder parallelizationFactor(java.lang.Number parallelizationFactor) {
this.parallelizationFactor = parallelizationFactor;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link StreamSourceParameters}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public StreamSourceParameters build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link StreamSourceParameters}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements StreamSourceParameters {
private final java.lang.Number batchSize;
private final java.lang.Object deadLetterTarget;
private final software.amazon.awscdk.Duration maximumBatchingWindow;
private final software.amazon.awscdk.Duration maximumRecordAge;
private final java.lang.Number maximumRetryAttempts;
private final software.amazon.awscdk.services.pipes.sources.alpha.OnPartialBatchItemFailure onPartialBatchItemFailure;
private final java.lang.Number parallelizationFactor;
/**
* 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.batchSize = software.amazon.jsii.Kernel.get(this, "batchSize", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.deadLetterTarget = software.amazon.jsii.Kernel.get(this, "deadLetterTarget", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
this.maximumBatchingWindow = software.amazon.jsii.Kernel.get(this, "maximumBatchingWindow", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class));
this.maximumRecordAge = software.amazon.jsii.Kernel.get(this, "maximumRecordAge", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class));
this.maximumRetryAttempts = software.amazon.jsii.Kernel.get(this, "maximumRetryAttempts", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.onPartialBatchItemFailure = software.amazon.jsii.Kernel.get(this, "onPartialBatchItemFailure", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.pipes.sources.alpha.OnPartialBatchItemFailure.class));
this.parallelizationFactor = software.amazon.jsii.Kernel.get(this, "parallelizationFactor", software.amazon.jsii.NativeType.forClass(java.lang.Number.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.batchSize = builder.batchSize;
this.deadLetterTarget = builder.deadLetterTarget;
this.maximumBatchingWindow = builder.maximumBatchingWindow;
this.maximumRecordAge = builder.maximumRecordAge;
this.maximumRetryAttempts = builder.maximumRetryAttempts;
this.onPartialBatchItemFailure = builder.onPartialBatchItemFailure;
this.parallelizationFactor = builder.parallelizationFactor;
}
@Override
public final java.lang.Number getBatchSize() {
return this.batchSize;
}
@Override
public final java.lang.Object getDeadLetterTarget() {
return this.deadLetterTarget;
}
@Override
public final software.amazon.awscdk.Duration getMaximumBatchingWindow() {
return this.maximumBatchingWindow;
}
@Override
public final software.amazon.awscdk.Duration getMaximumRecordAge() {
return this.maximumRecordAge;
}
@Override
public final java.lang.Number getMaximumRetryAttempts() {
return this.maximumRetryAttempts;
}
@Override
public final software.amazon.awscdk.services.pipes.sources.alpha.OnPartialBatchItemFailure getOnPartialBatchItemFailure() {
return this.onPartialBatchItemFailure;
}
@Override
public final java.lang.Number getParallelizationFactor() {
return this.parallelizationFactor;
}
@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.getBatchSize() != null) {
data.set("batchSize", om.valueToTree(this.getBatchSize()));
}
if (this.getDeadLetterTarget() != null) {
data.set("deadLetterTarget", om.valueToTree(this.getDeadLetterTarget()));
}
if (this.getMaximumBatchingWindow() != null) {
data.set("maximumBatchingWindow", om.valueToTree(this.getMaximumBatchingWindow()));
}
if (this.getMaximumRecordAge() != null) {
data.set("maximumRecordAge", om.valueToTree(this.getMaximumRecordAge()));
}
if (this.getMaximumRetryAttempts() != null) {
data.set("maximumRetryAttempts", om.valueToTree(this.getMaximumRetryAttempts()));
}
if (this.getOnPartialBatchItemFailure() != null) {
data.set("onPartialBatchItemFailure", om.valueToTree(this.getOnPartialBatchItemFailure()));
}
if (this.getParallelizationFactor() != null) {
data.set("parallelizationFactor", om.valueToTree(this.getParallelizationFactor()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-pipes-sources-alpha.StreamSourceParameters"));
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;
StreamSourceParameters.Jsii$Proxy that = (StreamSourceParameters.Jsii$Proxy) o;
if (this.batchSize != null ? !this.batchSize.equals(that.batchSize) : that.batchSize != null) return false;
if (this.deadLetterTarget != null ? !this.deadLetterTarget.equals(that.deadLetterTarget) : that.deadLetterTarget != null) return false;
if (this.maximumBatchingWindow != null ? !this.maximumBatchingWindow.equals(that.maximumBatchingWindow) : that.maximumBatchingWindow != null) return false;
if (this.maximumRecordAge != null ? !this.maximumRecordAge.equals(that.maximumRecordAge) : that.maximumRecordAge != null) return false;
if (this.maximumRetryAttempts != null ? !this.maximumRetryAttempts.equals(that.maximumRetryAttempts) : that.maximumRetryAttempts != null) return false;
if (this.onPartialBatchItemFailure != null ? !this.onPartialBatchItemFailure.equals(that.onPartialBatchItemFailure) : that.onPartialBatchItemFailure != null) return false;
return this.parallelizationFactor != null ? this.parallelizationFactor.equals(that.parallelizationFactor) : that.parallelizationFactor == null;
}
@Override
public final int hashCode() {
int result = this.batchSize != null ? this.batchSize.hashCode() : 0;
result = 31 * result + (this.deadLetterTarget != null ? this.deadLetterTarget.hashCode() : 0);
result = 31 * result + (this.maximumBatchingWindow != null ? this.maximumBatchingWindow.hashCode() : 0);
result = 31 * result + (this.maximumRecordAge != null ? this.maximumRecordAge.hashCode() : 0);
result = 31 * result + (this.maximumRetryAttempts != null ? this.maximumRetryAttempts.hashCode() : 0);
result = 31 * result + (this.onPartialBatchItemFailure != null ? this.onPartialBatchItemFailure.hashCode() : 0);
result = 31 * result + (this.parallelizationFactor != null ? this.parallelizationFactor.hashCode() : 0);
return result;
}
}
}