/* * Copyright 2018-2023 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 com.amazonaws.services.batch.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* The retry strategy that's associated with a job. For more information, see Automated job retries in the Batch * User Guide. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RetryStrategy implements Serializable, Cloneable, StructuredPojo { /** *
* The number of times to move a job to the RUNNABLE
status. You can specify between 1 and 10 attempts.
* If the value of attempts
is greater than one, the job is retried on failure the same number of
* attempts as the value.
*
* Array of up to 5 objects that specify the conditions where jobs are retried or failed. If this parameter is
* specified, then the attempts
parameter must also be specified. If none of the listed conditions
* match, then the job is retried.
*
* The number of times to move a job to the RUNNABLE
status. You can specify between 1 and 10 attempts.
* If the value of attempts
is greater than one, the job is retried on failure the same number of
* attempts as the value.
*
RUNNABLE
status. You can specify between 1 and 10
* attempts. If the value of attempts
is greater than one, the job is retried on failure the
* same number of attempts as the value.
*/
public void setAttempts(Integer attempts) {
this.attempts = attempts;
}
/**
*
* The number of times to move a job to the RUNNABLE
status. You can specify between 1 and 10 attempts.
* If the value of attempts
is greater than one, the job is retried on failure the same number of
* attempts as the value.
*
RUNNABLE
status. You can specify between 1 and 10
* attempts. If the value of attempts
is greater than one, the job is retried on failure the
* same number of attempts as the value.
*/
public Integer getAttempts() {
return this.attempts;
}
/**
*
* The number of times to move a job to the RUNNABLE
status. You can specify between 1 and 10 attempts.
* If the value of attempts
is greater than one, the job is retried on failure the same number of
* attempts as the value.
*
RUNNABLE
status. You can specify between 1 and 10
* attempts. If the value of attempts
is greater than one, the job is retried on failure the
* same number of attempts as the value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RetryStrategy withAttempts(Integer attempts) {
setAttempts(attempts);
return this;
}
/**
*
* Array of up to 5 objects that specify the conditions where jobs are retried or failed. If this parameter is
* specified, then the attempts
parameter must also be specified. If none of the listed conditions
* match, then the job is retried.
*
attempts
parameter must also be specified. If none of the listed
* conditions match, then the job is retried.
*/
public java.util.List
* Array of up to 5 objects that specify the conditions where jobs are retried or failed. If this parameter is
* specified, then the attempts
parameter must also be specified. If none of the listed conditions
* match, then the job is retried.
*
attempts
parameter must also be specified. If none of the listed
* conditions match, then the job is retried.
*/
public void setEvaluateOnExit(java.util.Collection
* Array of up to 5 objects that specify the conditions where jobs are retried or failed. If this parameter is
* specified, then the attempts
parameter must also be specified. If none of the listed conditions
* match, then the job is retried.
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setEvaluateOnExit(java.util.Collection)} or {@link #withEvaluateOnExit(java.util.Collection)} if you want * to override the existing values. *
* * @param evaluateOnExit * Array of up to 5 objects that specify the conditions where jobs are retried or failed. If this parameter * is specified, then theattempts
parameter must also be specified. If none of the listed
* conditions match, then the job is retried.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RetryStrategy withEvaluateOnExit(EvaluateOnExit... evaluateOnExit) {
if (this.evaluateOnExit == null) {
setEvaluateOnExit(new java.util.ArrayList
* Array of up to 5 objects that specify the conditions where jobs are retried or failed. If this parameter is
* specified, then the attempts
parameter must also be specified. If none of the listed conditions
* match, then the job is retried.
*
attempts
parameter must also be specified. If none of the listed
* conditions match, then the job is retried.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RetryStrategy withEvaluateOnExit(java.util.Collection