io.github.cdklabs.cdkmonitoringconstructs.BaseDlqAlarms Maven / Gradle / Ivy
package io.github.cdklabs.cdkmonitoringconstructs;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-24T17:32:51.830Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdkmonitoringconstructs.$Module.class, fqn = "cdk-monitoring-constructs.BaseDlqAlarms")
@software.amazon.jsii.Jsii.Proxy(BaseDlqAlarms.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface BaseDlqAlarms extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Alarm on the number of messages added to a queue.
*
* Note that this corresponds with the NumberOfMessagesSent metric, which does not capture messages sent to the DLQ
* as a result of a failed processing attempt.
*
* @see https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html#sqs-dlq-number-of-messages
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getAddDeadLetterQueueMaxIncomingMessagesAlarm() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getAddDeadLetterQueueMaxMessageAgeAlarm() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getAddDeadLetterQueueMaxSizeAlarm() {
return null;
}
/**
* @return a {@link Builder} of {@link BaseDlqAlarms}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link BaseDlqAlarms}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.Map addDeadLetterQueueMaxIncomingMessagesAlarm;
java.util.Map addDeadLetterQueueMaxMessageAgeAlarm;
java.util.Map addDeadLetterQueueMaxSizeAlarm;
/**
* Sets the value of {@link BaseDlqAlarms#getAddDeadLetterQueueMaxIncomingMessagesAlarm}
* @param addDeadLetterQueueMaxIncomingMessagesAlarm Alarm on the number of messages added to a queue.
* Note that this corresponds with the NumberOfMessagesSent metric, which does not capture messages sent to the DLQ
* as a result of a failed processing attempt.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder addDeadLetterQueueMaxIncomingMessagesAlarm(java.util.Map addDeadLetterQueueMaxIncomingMessagesAlarm) {
this.addDeadLetterQueueMaxIncomingMessagesAlarm = (java.util.Map)addDeadLetterQueueMaxIncomingMessagesAlarm;
return this;
}
/**
* Sets the value of {@link BaseDlqAlarms#getAddDeadLetterQueueMaxMessageAgeAlarm}
* @param addDeadLetterQueueMaxMessageAgeAlarm the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder addDeadLetterQueueMaxMessageAgeAlarm(java.util.Map addDeadLetterQueueMaxMessageAgeAlarm) {
this.addDeadLetterQueueMaxMessageAgeAlarm = (java.util.Map)addDeadLetterQueueMaxMessageAgeAlarm;
return this;
}
/**
* Sets the value of {@link BaseDlqAlarms#getAddDeadLetterQueueMaxSizeAlarm}
* @param addDeadLetterQueueMaxSizeAlarm the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder addDeadLetterQueueMaxSizeAlarm(java.util.Map addDeadLetterQueueMaxSizeAlarm) {
this.addDeadLetterQueueMaxSizeAlarm = (java.util.Map)addDeadLetterQueueMaxSizeAlarm;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link BaseDlqAlarms}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public BaseDlqAlarms build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link BaseDlqAlarms}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements BaseDlqAlarms {
private final java.util.Map addDeadLetterQueueMaxIncomingMessagesAlarm;
private final java.util.Map addDeadLetterQueueMaxMessageAgeAlarm;
private final java.util.Map addDeadLetterQueueMaxSizeAlarm;
/**
* 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.addDeadLetterQueueMaxIncomingMessagesAlarm = software.amazon.jsii.Kernel.get(this, "addDeadLetterQueueMaxIncomingMessagesAlarm", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.MaxIncomingMessagesCountThreshold.class)));
this.addDeadLetterQueueMaxMessageAgeAlarm = software.amazon.jsii.Kernel.get(this, "addDeadLetterQueueMaxMessageAgeAlarm", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.MaxMessageAgeThreshold.class)));
this.addDeadLetterQueueMaxSizeAlarm = software.amazon.jsii.Kernel.get(this, "addDeadLetterQueueMaxSizeAlarm", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.MaxMessageCountThreshold.class)));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.addDeadLetterQueueMaxIncomingMessagesAlarm = (java.util.Map)builder.addDeadLetterQueueMaxIncomingMessagesAlarm;
this.addDeadLetterQueueMaxMessageAgeAlarm = (java.util.Map)builder.addDeadLetterQueueMaxMessageAgeAlarm;
this.addDeadLetterQueueMaxSizeAlarm = (java.util.Map)builder.addDeadLetterQueueMaxSizeAlarm;
}
@Override
public final java.util.Map getAddDeadLetterQueueMaxIncomingMessagesAlarm() {
return this.addDeadLetterQueueMaxIncomingMessagesAlarm;
}
@Override
public final java.util.Map getAddDeadLetterQueueMaxMessageAgeAlarm() {
return this.addDeadLetterQueueMaxMessageAgeAlarm;
}
@Override
public final java.util.Map getAddDeadLetterQueueMaxSizeAlarm() {
return this.addDeadLetterQueueMaxSizeAlarm;
}
@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.getAddDeadLetterQueueMaxIncomingMessagesAlarm() != null) {
data.set("addDeadLetterQueueMaxIncomingMessagesAlarm", om.valueToTree(this.getAddDeadLetterQueueMaxIncomingMessagesAlarm()));
}
if (this.getAddDeadLetterQueueMaxMessageAgeAlarm() != null) {
data.set("addDeadLetterQueueMaxMessageAgeAlarm", om.valueToTree(this.getAddDeadLetterQueueMaxMessageAgeAlarm()));
}
if (this.getAddDeadLetterQueueMaxSizeAlarm() != null) {
data.set("addDeadLetterQueueMaxSizeAlarm", om.valueToTree(this.getAddDeadLetterQueueMaxSizeAlarm()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk-monitoring-constructs.BaseDlqAlarms"));
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;
BaseDlqAlarms.Jsii$Proxy that = (BaseDlqAlarms.Jsii$Proxy) o;
if (this.addDeadLetterQueueMaxIncomingMessagesAlarm != null ? !this.addDeadLetterQueueMaxIncomingMessagesAlarm.equals(that.addDeadLetterQueueMaxIncomingMessagesAlarm) : that.addDeadLetterQueueMaxIncomingMessagesAlarm != null) return false;
if (this.addDeadLetterQueueMaxMessageAgeAlarm != null ? !this.addDeadLetterQueueMaxMessageAgeAlarm.equals(that.addDeadLetterQueueMaxMessageAgeAlarm) : that.addDeadLetterQueueMaxMessageAgeAlarm != null) return false;
return this.addDeadLetterQueueMaxSizeAlarm != null ? this.addDeadLetterQueueMaxSizeAlarm.equals(that.addDeadLetterQueueMaxSizeAlarm) : that.addDeadLetterQueueMaxSizeAlarm == null;
}
@Override
public final int hashCode() {
int result = this.addDeadLetterQueueMaxIncomingMessagesAlarm != null ? this.addDeadLetterQueueMaxIncomingMessagesAlarm.hashCode() : 0;
result = 31 * result + (this.addDeadLetterQueueMaxMessageAgeAlarm != null ? this.addDeadLetterQueueMaxMessageAgeAlarm.hashCode() : 0);
result = 31 * result + (this.addDeadLetterQueueMaxSizeAlarm != null ? this.addDeadLetterQueueMaxSizeAlarm.hashCode() : 0);
return result;
}
}
}