Class ChecksumsEnabledValidator
java.lang.Object
software.amazon.awssdk.services.s3.internal.checksums.ChecksumsEnabledValidator
Class used by
SyncChecksumValidationInterceptor
and
AsyncChecksumValidationInterceptor
to determine if trailing checksums
should be enabled for a given request.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
getObjectChecksumEnabledPerRequest
(SdkRequest request, ExecutionAttributes executionAttributes) Checks if trailing checksum is enabled andChecksumMode
is disabled forS3Client.getObject(GetObjectRequest)
per request.static boolean
getObjectChecksumEnabledPerResponse
(SdkRequest request, SdkHttpHeaders responseHeaders) Checks if trailing checksum is enabled forS3Client.getObject(GetObjectRequest)
per response.static boolean
responseChecksumIsValid
(SdkHttpResponse httpResponse) static boolean
shouldRecordChecksum
(SdkRequest sdkRequest, ClientType expectedClientType, ExecutionAttributes executionAttributes, SdkHttpRequest httpRequest) Validates that checksums should be enabled based onClientType
and the presence of S3 specific headers.static void
validatePutObjectChecksum
(PutObjectResponse response, ExecutionAttributes executionAttributes) Client side validation forPutObjectRequest
-
Field Details
-
CHECKSUM
-
-
Method Details
-
getObjectChecksumEnabledPerRequest
public static boolean getObjectChecksumEnabledPerRequest(SdkRequest request, ExecutionAttributes executionAttributes) Checks if trailing checksum is enabled andChecksumMode
is disabled forS3Client.getObject(GetObjectRequest)
per request.- Parameters:
request
- the requestexecutionAttributes
- the executionAttributes- Returns:
- true if trailing checksums is enabled and ChecksumMode is disabled, false otherwise
-
getObjectChecksumEnabledPerResponse
public static boolean getObjectChecksumEnabledPerResponse(SdkRequest request, SdkHttpHeaders responseHeaders) Checks if trailing checksum is enabled forS3Client.getObject(GetObjectRequest)
per response.- Parameters:
request
- the requestresponseHeaders
- the response headers- Returns:
- true if trailing checksums is enabled, false otherwise
-
shouldRecordChecksum
public static boolean shouldRecordChecksum(SdkRequest sdkRequest, ClientType expectedClientType, ExecutionAttributes executionAttributes, SdkHttpRequest httpRequest) Validates that checksums should be enabled based onClientType
and the presence of S3 specific headers.- Parameters:
expectedClientType
- - The expected client type for enabling checksumsexecutionAttributes
- -ExecutionAttributes
to determine the actual client type- Returns:
- If trailing checksums should be enabled for this request.
-
responseChecksumIsValid
-
validatePutObjectChecksum
public static void validatePutObjectChecksum(PutObjectResponse response, ExecutionAttributes executionAttributes) Client side validation forPutObjectRequest
- Parameters:
response
- the responseexecutionAttributes
- the execution attributes
-