Class S3ExpressChecksumInterceptor

java.lang.Object
software.amazon.awssdk.services.s3.internal.handlers.S3ExpressChecksumInterceptor
All Implemented Interfaces:
ExecutionInterceptor

public final class S3ExpressChecksumInterceptor extends Object implements ExecutionInterceptor
S3Express has different checksum requirements compared to standard S3 calls. This interceptor modifies checksums only for S3Express calls.

Checksums can be configured through model traits on operations as follows

  1. httpChecksumRequired - older setting used in S3Control -> not allowed
  2. httpChecksum is set and required -> always add CRC32 checksum even if algorithm is not specified.
  3. httpChecksum is set but not required -> if algorithm is not specified, behavior differs

Note that, if httpChecksum is not present, no checksum may be calculated. PutBucketPolicy, DeleteObjects are examples of operations that require checksums. PutObject, UploadPart are examples of operations that do not require checksums.

Special cases

  • PutObject -> always calculate CRC32
  • UploadPart -> do not calculate CRC32 if algorithm is missing, unless TM is used
  • Constructor Details

    • S3ExpressChecksumInterceptor

      public S3ExpressChecksumInterceptor()
  • Method Details

    • modifyRequest

      public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes)
      Description copied from interface: ExecutionInterceptor
      Modify an SdkRequest given to a service client before it is marshalled into an SdkHttpFullRequest.
      Specified by:
      modifyRequest in interface ExecutionInterceptor
      Parameters:
      context - The current state of the execution, including the current SDK request from the service client call.
      executionAttributes - A mutable set of attributes scoped to one specific request/response cycle that can be used to give data to future lifecycle methods.
      Returns:
      The potentially-modified request that should be used for the rest of the execution. Must not be null.
    • modifyHttpRequest

      public SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes)
      Description copied from interface: ExecutionInterceptor
      Modify the SdkHttpFullRequest before it is sent to the service.
      Specified by:
      modifyHttpRequest in interface ExecutionInterceptor
      Parameters:
      context - The current state of the execution, including the SDK and current HTTP request.
      executionAttributes - A mutable set of attributes scoped to one specific request/response cycle that can be used to give data to future lifecycle methods.
      Returns:
      The potentially-modified HTTP request that should be sent to the service. Must not be null.