software.amazon.awscdk.integtests.alpha.WaiterStateMachine Maven / Gradle / Ivy
Show all versions of cdk-integ-tests-alpha Show documentation
package software.amazon.awscdk.integtests.alpha;
/**
* (experimental) A very simple StateMachine construct highly customized to the provider framework.
*
* This is so that this package does not need to depend on aws-stepfunctions module.
*
* The state machine continuously calls the isCompleteHandler, until it succeeds or times out.
* The handler is called maxAttempts
times with an interval
duration and a backoffRate
rate.
*
* For example with:
*
*
* - maxAttempts = 360 (30 minutes)
* - interval = 5
* - backoffRate = 1 (no backoff)
*
*
* it will make the API Call every 5 seconds and fail after 360 failures.
*
* If the backoff rate is changed to 2 (for example), it will
*
*
* - make the first call
* - wait 5 seconds
* - make the second call
* - wait 15 seconds
* - etc.
*
*
* Example:
*
*
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import software.amazon.awscdk.integtests.alpha.*;
* import software.amazon.awscdk.*;
* WaiterStateMachine waiterStateMachine = WaiterStateMachine.Builder.create(this, "MyWaiterStateMachine")
* .backoffRate(123)
* .interval(Duration.minutes(30))
* .totalTimeout(Duration.minutes(30))
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.102.0 (build e354887)", date = "2024-08-23T05:56:25.372Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.integtests.alpha.$Module.class, fqn = "@aws-cdk/integ-tests-alpha.WaiterStateMachine")
public class WaiterStateMachine extends software.constructs.Construct {
protected WaiterStateMachine(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected WaiterStateMachine(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public WaiterStateMachine(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.Nullable software.amazon.awscdk.integtests.alpha.WaiterStateMachineProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), props });
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public WaiterStateMachine(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required") });
}
/**
* (experimental) The AssertionsProvide that handles async requests.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.integtests.alpha.AssertionsProvider getIsCompleteProvider() {
return software.amazon.jsii.Kernel.get(this, "isCompleteProvider", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.integtests.alpha.AssertionsProvider.class));
}
/**
* (experimental) The IAM Role ARN of the role used by the state machine.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getRoleArn() {
return software.amazon.jsii.Kernel.get(this, "roleArn", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) The ARN of the statemachine.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getStateMachineArn() {
return software.amazon.jsii.Kernel.get(this, "stateMachineArn", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) A fluent builder for {@link software.amazon.awscdk.integtests.alpha.WaiterStateMachine}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private software.amazon.awscdk.integtests.alpha.WaiterStateMachineProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
}
/**
* (experimental) Backoff between attempts.
*
* This is the multiplier by which the retry interval increases
* after each retry attempt.
*
* By default there is no backoff. Each retry will wait the amount of time
* specified by interval
.
*
* Default: 1 (no backoff)
*
* @return {@code this}
* @param backoffRate Backoff between attempts. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder backoffRate(final java.lang.Number backoffRate) {
this.props().backoffRate(backoffRate);
return this;
}
/**
* (experimental) The interval (number of seconds) to wait between attempts.
*
* Default: Duration.seconds(5)
*
* @return {@code this}
* @param interval The interval (number of seconds) to wait between attempts. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder interval(final software.amazon.awscdk.Duration interval) {
this.props().interval(interval);
return this;
}
/**
* (experimental) The total time that the state machine will wait for a successful response.
*
* Default: Duration.minutes(30)
*
* @return {@code this}
* @param totalTimeout The total time that the state machine will wait for a successful response. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder totalTimeout(final software.amazon.awscdk.Duration totalTimeout) {
this.props().totalTimeout(totalTimeout);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awscdk.integtests.alpha.WaiterStateMachine}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.amazon.awscdk.integtests.alpha.WaiterStateMachine build() {
return new software.amazon.awscdk.integtests.alpha.WaiterStateMachine(
this.scope,
this.id,
this.props != null ? this.props.build() : null
);
}
private software.amazon.awscdk.integtests.alpha.WaiterStateMachineProps.Builder props() {
if (this.props == null) {
this.props = new software.amazon.awscdk.integtests.alpha.WaiterStateMachineProps.Builder();
}
return this.props;
}
}
}