use of software.amazon.awssdk.core.interceptor.trait.HttpChecksum in project aws-sdk-java-v2 by aws.
the class HttpChecksumResolver method getResolvedChecksumSpecs.
public static ChecksumSpecs getResolvedChecksumSpecs(ExecutionAttributes executionAttributes) {
HttpChecksum httpChecksumTraitInOperation = executionAttributes.getAttribute(SdkInternalExecutionAttribute.HTTP_CHECKSUM);
if (httpChecksumTraitInOperation == null) {
return null;
}
boolean hasRequestValidation = hasRequestValidationMode(httpChecksumTraitInOperation);
String checksumHeaderName = httpChecksumTraitInOperation.requestAlgorithm() != null ? HttpChecksumUtils.httpChecksumHeader(httpChecksumTraitInOperation.requestAlgorithm()) : null;
List<Algorithm> responseValidationAlgorithms = getResponseValidationAlgorithms(httpChecksumTraitInOperation);
return ChecksumSpecs.builder().algorithm(Algorithm.fromValue(httpChecksumTraitInOperation.requestAlgorithm())).headerName(checksumHeaderName).responseValidationAlgorithms(responseValidationAlgorithms).isValidationEnabled(hasRequestValidation).isRequestChecksumRequired(httpChecksumTraitInOperation.isRequestChecksumRequired()).isRequestStreaming(httpChecksumTraitInOperation.isRequestStreaming()).build();
}
Aggregations