public class S3V4AuthErrorRetryStrategy extends java.lang.Object implements AuthErrorRetryStrategy
Modifier and Type | Field and Description |
---|---|
private S3RequestEndpointResolver |
endpointResolver |
private static org.apache.commons.logging.Log |
log |
private SdkPredicate<AmazonServiceException> |
sigV4RetryPredicate |
private static java.lang.String |
V4_REGION_WARNING |
Constructor and Description |
---|
S3V4AuthErrorRetryStrategy(S3RequestEndpointResolver endpointResolver) |
S3V4AuthErrorRetryStrategy(S3RequestEndpointResolver endpointResolver,
SdkPredicate<AmazonServiceException> isSigV4Retryable)
Currently only used for testing
|
Modifier and Type | Method and Description |
---|---|
private AuthRetryParameters |
buildRetryParams(AWSS3V4Signer signer,
java.net.URI endpoint) |
private AWSS3V4Signer |
buildSigV4Signer(java.lang.String region) |
private boolean |
canUseVirtualAddressing() |
private static java.lang.String |
getServingRegionHeader(HttpResponse response) |
private static boolean |
hasServingRegionHeader(HttpResponse response) |
private AuthRetryParameters |
redirectToRegionInHeader(Request<?> request,
HttpResponse response) |
private AuthRetryParameters |
redirectToS3External()
If the response doesn't have the x-amz-region header we have to resort to sending a request
to s3-external-1
|
AuthRetryParameters |
shouldRetryWithAuthParam(Request<?> request,
HttpResponse response,
AmazonServiceException ase)
Returns an alternative signing context (consists of a new signer instance
and a new request endpoint) that should be used to retry the request.
|
private static org.apache.commons.logging.Log log
private static final java.lang.String V4_REGION_WARNING
private final S3RequestEndpointResolver endpointResolver
private final SdkPredicate<AmazonServiceException> sigV4RetryPredicate
public S3V4AuthErrorRetryStrategy(S3RequestEndpointResolver endpointResolver)
S3V4AuthErrorRetryStrategy(S3RequestEndpointResolver endpointResolver, SdkPredicate<AmazonServiceException> isSigV4Retryable)
public AuthRetryParameters shouldRetryWithAuthParam(Request<?> request, HttpResponse response, AmazonServiceException ase)
AuthErrorRetryStrategy
shouldRetryWithAuthParam
in interface AuthErrorRetryStrategy
private boolean canUseVirtualAddressing()
private AuthRetryParameters redirectToRegionInHeader(Request<?> request, HttpResponse response)
private AuthRetryParameters redirectToS3External()
private AWSS3V4Signer buildSigV4Signer(java.lang.String region)
private AuthRetryParameters buildRetryParams(AWSS3V4Signer signer, java.net.URI endpoint)
private static boolean hasServingRegionHeader(HttpResponse response)
private static java.lang.String getServingRegionHeader(HttpResponse response)