Package software.amazon.awssdk.crt.s3
Class ChecksumConfig
- java.lang.Object
-
- software.amazon.awssdk.crt.s3.ChecksumConfig
-
public class ChecksumConfig extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChecksumConfig.ChecksumLocation
-
Constructor Summary
Constructors Constructor Description ChecksumConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChecksumAlgorithm
getChecksumAlgorithm()
ChecksumConfig.ChecksumLocation
getChecksumLocation()
boolean
getValidateChecksum()
List<ChecksumAlgorithm>
getValidateChecksumAlgorithmList()
ChecksumConfig
withChecksumAlgorithm(ChecksumAlgorithm algorithm)
The checksum algorithm used to calculate the checksum of payload uploaded.ChecksumConfig
withChecksumLocation(ChecksumConfig.ChecksumLocation location)
If NONE.ChecksumConfig
withValidateChecksum(boolean validateChecksum)
Enable checksum mode header will be attached to get requests, this will tell s3 to send back checksums headers if they exist.ChecksumConfig
withValidateChecksumAlgorithmList(List<ChecksumAlgorithm> validateChecksumAlgorithmList)
Ignored when validate_response_checksum is not set.
-
-
-
Method Detail
-
withChecksumLocation
public ChecksumConfig withChecksumLocation(ChecksumConfig.ChecksumLocation location)
If NONE. No request payload checksum will be added and calculated. If HEADER, the checksum will be calculated by client and related header added to the request sent. If TRAILER, the payload will be aws_chunked encoded, The checksum will be calculated while reading the payload by client. Related header will be added to the trailer part of the encoded payload. Note the payload of the original request cannot be aws-chunked encoded already. Otherwise, error will be raised.- Parameters:
location
- The location of client added request payload checksum header.- Returns:
- this
-
getChecksumLocation
public ChecksumConfig.ChecksumLocation getChecksumLocation()
- Returns:
- The location of client added checksum header.
-
withChecksumAlgorithm
public ChecksumConfig withChecksumAlgorithm(ChecksumAlgorithm algorithm)
The checksum algorithm used to calculate the checksum of payload uploaded. Must be set if location is not AWS_SCL_NONE. Must be AWS_SCA_NONE if location is AWS_SCL_NONE.- Parameters:
algorithm
- The checksum algorithm used to calculate the checksum of payload uploaded.- Returns:
- this
-
getChecksumAlgorithm
public ChecksumAlgorithm getChecksumAlgorithm()
- Returns:
- The checksum algorithm used to calculate the checksum of payload uploaded.
-
withValidateChecksum
public ChecksumConfig withValidateChecksum(boolean validateChecksum)
Enable checksum mode header will be attached to get requests, this will tell s3 to send back checksums headers if they exist. For object that has checksum, the checksum of whole object will be calculated and validated. The result will finish with a did validate field. For object has checksum for parts, if ALL the parts have been validated, the result will finish with a did validate field. If any part failed the validation, AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH will be raised.- Parameters:
validateChecksum
- Validate the checksum of response if server provides.- Returns:
- this
-
getValidateChecksum
public boolean getValidateChecksum()
-
withValidateChecksumAlgorithmList
public ChecksumConfig withValidateChecksumAlgorithmList(List<ChecksumAlgorithm> validateChecksumAlgorithmList)
Ignored when validate_response_checksum is not set. If not set all the algorithms will be selected as default behavior. The list of algorithms for user to pick up when validate the checksum. Client will pick up the algorithm from the list with the priority based on performance, and the algorithm sent by server. The priority based on performance is [CRC64NVME, CRC32C, CRC32, SHA1, SHA256]. If the response checksum was validated by client, the result will indicate which algorithm was picked.- Parameters:
validateChecksumAlgorithmList
- The list of algorithm picked to validate checksum from response.- Returns:
- this
-
getValidateChecksumAlgorithmList
public List<ChecksumAlgorithm> getValidateChecksumAlgorithmList()
- Returns:
- The list of algorithm picked to validate checksum from response.
-
-