/* * 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.appmesh.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* An object that represents a retry policy. Specify at least one value for at least one of the types of
* RetryEvents
, a value for maxRetries
, and a value for perRetryTimeout
. Both
* server-error
and gateway-error
under httpRetryEvents
include the Envoy
* reset
policy. For more information on the reset
policy, see the Envoy documentation.
*
* Specify at least one of the valid values. *
*/ private java.util.List* Specify at least one of the following values. *
** server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511 *
** gateway-error – HTTP status codes 502, 503, and 504 *
** client-error – HTTP status code 409 *
** stream-error – Retry on refused stream *
** The maximum number of retry attempts. *
*/ private Long maxRetries; /** ** The timeout for each retry attempt. *
*/ private Duration perRetryTimeout; /** ** Specify a valid value. The event occurs before any processing of a request has started and is encountered when * the upstream is temporarily or permanently unavailable. *
*/ private java.util.List* Specify at least one of the valid values. *
* * @return Specify at least one of the valid values. * @see GrpcRetryPolicyEvent */ public java.util.List* Specify at least one of the valid values. *
* * @param grpcRetryEvents * Specify at least one of the valid values. * @see GrpcRetryPolicyEvent */ public void setGrpcRetryEvents(java.util.Collection* Specify at least one of the valid values. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setGrpcRetryEvents(java.util.Collection)} or {@link #withGrpcRetryEvents(java.util.Collection)} if you * want to override the existing values. *
* * @param grpcRetryEvents * Specify at least one of the valid values. * @return Returns a reference to this object so that method calls can be chained together. * @see GrpcRetryPolicyEvent */ public GrpcRetryPolicy withGrpcRetryEvents(String... grpcRetryEvents) { if (this.grpcRetryEvents == null) { setGrpcRetryEvents(new java.util.ArrayList* Specify at least one of the valid values. *
* * @param grpcRetryEvents * Specify at least one of the valid values. * @return Returns a reference to this object so that method calls can be chained together. * @see GrpcRetryPolicyEvent */ public GrpcRetryPolicy withGrpcRetryEvents(java.util.Collection* Specify at least one of the valid values. *
* * @param grpcRetryEvents * Specify at least one of the valid values. * @return Returns a reference to this object so that method calls can be chained together. * @see GrpcRetryPolicyEvent */ public GrpcRetryPolicy withGrpcRetryEvents(GrpcRetryPolicyEvent... grpcRetryEvents) { java.util.ArrayList* Specify at least one of the following values. *
** server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511 *
** gateway-error – HTTP status codes 502, 503, and 504 *
** client-error – HTTP status code 409 *
** stream-error – Retry on refused stream *
** server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511 *
** gateway-error – HTTP status codes 502, 503, and 504 *
** client-error – HTTP status code 409 *
** stream-error – Retry on refused stream *
** Specify at least one of the following values. *
** server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511 *
** gateway-error – HTTP status codes 502, 503, and 504 *
** client-error – HTTP status code 409 *
** stream-error – Retry on refused stream *
** server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511 *
** gateway-error – HTTP status codes 502, 503, and 504 *
** client-error – HTTP status code 409 *
** stream-error – Retry on refused stream *
** Specify at least one of the following values. *
** server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511 *
** gateway-error – HTTP status codes 502, 503, and 504 *
** client-error – HTTP status code 409 *
** stream-error – Retry on refused stream *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setHttpRetryEvents(java.util.Collection)} or {@link #withHttpRetryEvents(java.util.Collection)} if you * want to override the existing values. *
* * @param httpRetryEvents * Specify at least one of the following values. ** server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511 *
** gateway-error – HTTP status codes 502, 503, and 504 *
** client-error – HTTP status code 409 *
** stream-error – Retry on refused stream *
** Specify at least one of the following values. *
** server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511 *
** gateway-error – HTTP status codes 502, 503, and 504 *
** client-error – HTTP status code 409 *
** stream-error – Retry on refused stream *
** server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511 *
** gateway-error – HTTP status codes 502, 503, and 504 *
** client-error – HTTP status code 409 *
** stream-error – Retry on refused stream *
** The maximum number of retry attempts. *
* * @param maxRetries * The maximum number of retry attempts. */ public void setMaxRetries(Long maxRetries) { this.maxRetries = maxRetries; } /** ** The maximum number of retry attempts. *
* * @return The maximum number of retry attempts. */ public Long getMaxRetries() { return this.maxRetries; } /** ** The maximum number of retry attempts. *
* * @param maxRetries * The maximum number of retry attempts. * @return Returns a reference to this object so that method calls can be chained together. */ public GrpcRetryPolicy withMaxRetries(Long maxRetries) { setMaxRetries(maxRetries); return this; } /** ** The timeout for each retry attempt. *
* * @param perRetryTimeout * The timeout for each retry attempt. */ public void setPerRetryTimeout(Duration perRetryTimeout) { this.perRetryTimeout = perRetryTimeout; } /** ** The timeout for each retry attempt. *
* * @return The timeout for each retry attempt. */ public Duration getPerRetryTimeout() { return this.perRetryTimeout; } /** ** The timeout for each retry attempt. *
* * @param perRetryTimeout * The timeout for each retry attempt. * @return Returns a reference to this object so that method calls can be chained together. */ public GrpcRetryPolicy withPerRetryTimeout(Duration perRetryTimeout) { setPerRetryTimeout(perRetryTimeout); return this; } /** ** Specify a valid value. The event occurs before any processing of a request has started and is encountered when * the upstream is temporarily or permanently unavailable. *
* * @return Specify a valid value. The event occurs before any processing of a request has started and is encountered * when the upstream is temporarily or permanently unavailable. * @see TcpRetryPolicyEvent */ public java.util.List* Specify a valid value. The event occurs before any processing of a request has started and is encountered when * the upstream is temporarily or permanently unavailable. *
* * @param tcpRetryEvents * Specify a valid value. The event occurs before any processing of a request has started and is encountered * when the upstream is temporarily or permanently unavailable. * @see TcpRetryPolicyEvent */ public void setTcpRetryEvents(java.util.Collection* Specify a valid value. The event occurs before any processing of a request has started and is encountered when * the upstream is temporarily or permanently unavailable. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTcpRetryEvents(java.util.Collection)} or {@link #withTcpRetryEvents(java.util.Collection)} if you want * to override the existing values. *
* * @param tcpRetryEvents * Specify a valid value. The event occurs before any processing of a request has started and is encountered * when the upstream is temporarily or permanently unavailable. * @return Returns a reference to this object so that method calls can be chained together. * @see TcpRetryPolicyEvent */ public GrpcRetryPolicy withTcpRetryEvents(String... tcpRetryEvents) { if (this.tcpRetryEvents == null) { setTcpRetryEvents(new java.util.ArrayList* Specify a valid value. The event occurs before any processing of a request has started and is encountered when * the upstream is temporarily or permanently unavailable. *
* * @param tcpRetryEvents * Specify a valid value. The event occurs before any processing of a request has started and is encountered * when the upstream is temporarily or permanently unavailable. * @return Returns a reference to this object so that method calls can be chained together. * @see TcpRetryPolicyEvent */ public GrpcRetryPolicy withTcpRetryEvents(java.util.Collection* Specify a valid value. The event occurs before any processing of a request has started and is encountered when * the upstream is temporarily or permanently unavailable. *
* * @param tcpRetryEvents * Specify a valid value. The event occurs before any processing of a request has started and is encountered * when the upstream is temporarily or permanently unavailable. * @return Returns a reference to this object so that method calls can be chained together. * @see TcpRetryPolicyEvent */ public GrpcRetryPolicy withTcpRetryEvents(TcpRetryPolicyEvent... tcpRetryEvents) { java.util.ArrayList