Class ChecksumsEnabledValidator

java.lang.Object
software.amazon.awssdk.services.s3.checksums.ChecksumsEnabledValidator

public final class ChecksumsEnabledValidator extends Object
Class used by SyncChecksumValidationInterceptor and AsyncChecksumValidationInterceptor to determine if trailing checksums should be enabled for a given request.
  • Field Details

  • Method Details

    • getObjectChecksumEnabledPerRequest

      public static boolean getObjectChecksumEnabledPerRequest(SdkRequest request, ExecutionAttributes executionAttributes)
      Checks if trailing checksum is enabled for S3Client.getObject(GetObjectRequest) per request.
      Parameters:
      request - the request
      executionAttributes - the executionAttributes
      Returns:
      true if trailing checksums is enabled, false otherwise
    • getObjectChecksumEnabledPerResponse

      public static boolean getObjectChecksumEnabledPerResponse(SdkRequest request, SdkHttpHeaders responseHeaders)
      Checks if trailing checksum is enabled for S3Client.getObject(GetObjectRequest) per response.
      Parameters:
      request - the request
      responseHeaders - 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 on ClientType and the presence or S3 specific headers.
      Parameters:
      expectedClientType - - The expected client type for enabling checksums
      executionAttributes - - ExecutionAttributes to determine the actual client type
      Returns:
      If trailing checksums should be enabled for this request.
    • responseChecksumIsValid

      public static boolean responseChecksumIsValid(SdkHttpResponse httpResponse)
    • validatePutObjectChecksum

      public static void validatePutObjectChecksum(PutObjectResponse response, ExecutionAttributes executionAttributes)
      Client side validation for PutObjectRequest
      Parameters:
      response - the response
      executionAttributes - the execution attributes