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

org.cdk8s.plus23.TcpSocketProbeOptions Maven / Gradle / Ivy

package org.cdk8s.plus23;

/**
 * Options for `Probe.fromTcpSocket()`.
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.75.0 (build 63bb957)", date = "2023-02-21T09:46:03.700Z")
@software.amazon.jsii.Jsii(module = org.cdk8s.plus23.$Module.class, fqn = "cdk8s-plus-23.TcpSocketProbeOptions")
@software.amazon.jsii.Jsii.Proxy(TcpSocketProbeOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface TcpSocketProbeOptions extends software.amazon.jsii.JsiiSerializable, org.cdk8s.plus23.ProbeOptions {

    /**
     * The host name to connect to on the container.
     * 

* Default: - defaults to the pod IP */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.String getHost() { return null; } /** * The TCP port to connect to on the container. *

* Default: - defaults to `container.port`. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.Number getPort() { return null; } /** * @return a {@link Builder} of {@link TcpSocketProbeOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) static Builder builder() { return new Builder(); } /** * A builder for {@link TcpSocketProbeOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static final class Builder implements software.amazon.jsii.Builder { java.lang.String host; java.lang.Number port; java.lang.Number failureThreshold; org.cdk8s.Duration initialDelaySeconds; org.cdk8s.Duration periodSeconds; java.lang.Number successThreshold; org.cdk8s.Duration timeoutSeconds; /** * Sets the value of {@link TcpSocketProbeOptions#getHost} * @param host The host name to connect to on the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder host(java.lang.String host) { this.host = host; return this; } /** * Sets the value of {@link TcpSocketProbeOptions#getPort} * @param port The TCP port to connect to on the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder port(java.lang.Number port) { this.port = port; return this; } /** * Sets the value of {@link TcpSocketProbeOptions#getFailureThreshold} * @param failureThreshold Minimum consecutive failures for the probe to be considered failed after having succeeded. * Defaults to 3. Minimum value is 1. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder failureThreshold(java.lang.Number failureThreshold) { this.failureThreshold = failureThreshold; return this; } /** * Sets the value of {@link TcpSocketProbeOptions#getInitialDelaySeconds} * @param initialDelaySeconds Number of seconds after the container has started before liveness probes are initiated. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder initialDelaySeconds(org.cdk8s.Duration initialDelaySeconds) { this.initialDelaySeconds = initialDelaySeconds; return this; } /** * Sets the value of {@link TcpSocketProbeOptions#getPeriodSeconds} * @param periodSeconds How often (in seconds) to perform the probe. * Default to 10 seconds. Minimum value is 1. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder periodSeconds(org.cdk8s.Duration periodSeconds) { this.periodSeconds = periodSeconds; return this; } /** * Sets the value of {@link TcpSocketProbeOptions#getSuccessThreshold} * @param successThreshold Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. * Must be 1 for liveness and startup. Minimum value is 1. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder successThreshold(java.lang.Number successThreshold) { this.successThreshold = successThreshold; return this; } /** * Sets the value of {@link TcpSocketProbeOptions#getTimeoutSeconds} * @param timeoutSeconds Number of seconds after which the probe times out. * Defaults to 1 second. Minimum value is 1. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder timeoutSeconds(org.cdk8s.Duration timeoutSeconds) { this.timeoutSeconds = timeoutSeconds; return this; } /** * Builds the configured instance. * @return a new instance of {@link TcpSocketProbeOptions} * @throws NullPointerException if any required attribute was not provided */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override public TcpSocketProbeOptions build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link TcpSocketProbeOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements TcpSocketProbeOptions { private final java.lang.String host; private final java.lang.Number port; private final java.lang.Number failureThreshold; private final org.cdk8s.Duration initialDelaySeconds; private final org.cdk8s.Duration periodSeconds; private final java.lang.Number successThreshold; private final org.cdk8s.Duration timeoutSeconds; /** * 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.host = software.amazon.jsii.Kernel.get(this, "host", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.port = software.amazon.jsii.Kernel.get(this, "port", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); this.failureThreshold = software.amazon.jsii.Kernel.get(this, "failureThreshold", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); this.initialDelaySeconds = software.amazon.jsii.Kernel.get(this, "initialDelaySeconds", software.amazon.jsii.NativeType.forClass(org.cdk8s.Duration.class)); this.periodSeconds = software.amazon.jsii.Kernel.get(this, "periodSeconds", software.amazon.jsii.NativeType.forClass(org.cdk8s.Duration.class)); this.successThreshold = software.amazon.jsii.Kernel.get(this, "successThreshold", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); this.timeoutSeconds = software.amazon.jsii.Kernel.get(this, "timeoutSeconds", software.amazon.jsii.NativeType.forClass(org.cdk8s.Duration.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.host = builder.host; this.port = builder.port; this.failureThreshold = builder.failureThreshold; this.initialDelaySeconds = builder.initialDelaySeconds; this.periodSeconds = builder.periodSeconds; this.successThreshold = builder.successThreshold; this.timeoutSeconds = builder.timeoutSeconds; } @Override public final java.lang.String getHost() { return this.host; } @Override public final java.lang.Number getPort() { return this.port; } @Override public final java.lang.Number getFailureThreshold() { return this.failureThreshold; } @Override public final org.cdk8s.Duration getInitialDelaySeconds() { return this.initialDelaySeconds; } @Override public final org.cdk8s.Duration getPeriodSeconds() { return this.periodSeconds; } @Override public final java.lang.Number getSuccessThreshold() { return this.successThreshold; } @Override public final org.cdk8s.Duration getTimeoutSeconds() { return this.timeoutSeconds; } @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.getHost() != null) { data.set("host", om.valueToTree(this.getHost())); } if (this.getPort() != null) { data.set("port", om.valueToTree(this.getPort())); } if (this.getFailureThreshold() != null) { data.set("failureThreshold", om.valueToTree(this.getFailureThreshold())); } if (this.getInitialDelaySeconds() != null) { data.set("initialDelaySeconds", om.valueToTree(this.getInitialDelaySeconds())); } if (this.getPeriodSeconds() != null) { data.set("periodSeconds", om.valueToTree(this.getPeriodSeconds())); } if (this.getSuccessThreshold() != null) { data.set("successThreshold", om.valueToTree(this.getSuccessThreshold())); } if (this.getTimeoutSeconds() != null) { data.set("timeoutSeconds", om.valueToTree(this.getTimeoutSeconds())); } final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); struct.set("fqn", om.valueToTree("cdk8s-plus-23.TcpSocketProbeOptions")); 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; TcpSocketProbeOptions.Jsii$Proxy that = (TcpSocketProbeOptions.Jsii$Proxy) o; if (this.host != null ? !this.host.equals(that.host) : that.host != null) return false; if (this.port != null ? !this.port.equals(that.port) : that.port != null) return false; if (this.failureThreshold != null ? !this.failureThreshold.equals(that.failureThreshold) : that.failureThreshold != null) return false; if (this.initialDelaySeconds != null ? !this.initialDelaySeconds.equals(that.initialDelaySeconds) : that.initialDelaySeconds != null) return false; if (this.periodSeconds != null ? !this.periodSeconds.equals(that.periodSeconds) : that.periodSeconds != null) return false; if (this.successThreshold != null ? !this.successThreshold.equals(that.successThreshold) : that.successThreshold != null) return false; return this.timeoutSeconds != null ? this.timeoutSeconds.equals(that.timeoutSeconds) : that.timeoutSeconds == null; } @Override public final int hashCode() { int result = this.host != null ? this.host.hashCode() : 0; result = 31 * result + (this.port != null ? this.port.hashCode() : 0); result = 31 * result + (this.failureThreshold != null ? this.failureThreshold.hashCode() : 0); result = 31 * result + (this.initialDelaySeconds != null ? this.initialDelaySeconds.hashCode() : 0); result = 31 * result + (this.periodSeconds != null ? this.periodSeconds.hashCode() : 0); result = 31 * result + (this.successThreshold != null ? this.successThreshold.hashCode() : 0); result = 31 * result + (this.timeoutSeconds != null ? this.timeoutSeconds.hashCode() : 0); return result; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy