mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-13 17:37:16 +01:00
67 lines
2.9 KiB
Java
67 lines
2.9 KiB
Java
package com.amazonaws.retry;
|
|
|
|
import com.amazonaws.AmazonClientException;
|
|
import com.amazonaws.AmazonWebServiceRequest;
|
|
import rx.Single$$ExternalSyntheticBUOutline0;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes20.dex */
|
|
public final class RetryPolicy {
|
|
private final BackoffStrategy backoffStrategy;
|
|
private final boolean honorMaxErrorRetryInClientConfig;
|
|
private final int maxErrorRetry;
|
|
private final RetryCondition retryCondition;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public interface BackoffStrategy {
|
|
public static final BackoffStrategy NO_DELAY = new BackoffStrategy() { // from class: com.amazonaws.retry.RetryPolicy.BackoffStrategy.1
|
|
@Override // com.amazonaws.retry.RetryPolicy.BackoffStrategy
|
|
public long delayBeforeNextRetry(AmazonWebServiceRequest amazonWebServiceRequest, AmazonClientException amazonClientException, int i) {
|
|
return 0L;
|
|
}
|
|
};
|
|
|
|
long delayBeforeNextRetry(AmazonWebServiceRequest amazonWebServiceRequest, AmazonClientException amazonClientException, int i);
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public interface RetryCondition {
|
|
public static final RetryCondition NO_RETRY_CONDITION = new RetryCondition() { // from class: com.amazonaws.retry.RetryPolicy.RetryCondition.1
|
|
@Override // com.amazonaws.retry.RetryPolicy.RetryCondition
|
|
public boolean shouldRetry(AmazonWebServiceRequest amazonWebServiceRequest, AmazonClientException amazonClientException, int i) {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
boolean shouldRetry(AmazonWebServiceRequest amazonWebServiceRequest, AmazonClientException amazonClientException, int i);
|
|
}
|
|
|
|
public RetryPolicy(RetryCondition retryCondition, BackoffStrategy backoffStrategy, int i, boolean z) {
|
|
retryCondition = retryCondition == null ? PredefinedRetryPolicies.DEFAULT_RETRY_CONDITION : retryCondition;
|
|
backoffStrategy = backoffStrategy == null ? PredefinedRetryPolicies.DEFAULT_BACKOFF_STRATEGY : backoffStrategy;
|
|
if (i < 0) {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("Please provide a non-negative value for maxErrorRetry.");
|
|
throw null;
|
|
}
|
|
this.retryCondition = retryCondition;
|
|
this.backoffStrategy = backoffStrategy;
|
|
this.maxErrorRetry = i;
|
|
this.honorMaxErrorRetryInClientConfig = z;
|
|
}
|
|
|
|
public BackoffStrategy getBackoffStrategy() {
|
|
return this.backoffStrategy;
|
|
}
|
|
|
|
public int getMaxErrorRetry() {
|
|
return this.maxErrorRetry;
|
|
}
|
|
|
|
public RetryCondition getRetryCondition() {
|
|
return this.retryCondition;
|
|
}
|
|
|
|
public boolean isMaxErrorRetryInClientConfigHonored() {
|
|
return this.honorMaxErrorRetryInClientConfig;
|
|
}
|
|
}
|