Package software.amazon.awssdk.crt.s3
Class S3MetaRequestOptions
java.lang.Object
software.amazon.awssdk.crt.s3.S3MetaRequestOptions
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumA Meta Request represents a group of generated requests that are being done on behalf of the original request.static enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Gets the file I/O options for controlling how client performs file I/O operations.booleanlongbooleanDeprecated.withChecksumAlgorithm(ChecksumAlgorithm checksumAlgorithm) Deprecated.withChecksumConfig(ChecksumConfig checksumConfig) The config related to checksum used for the meta request.withCredentialsProvider(CredentialsProvider credentialsProvider) Deprecated.Please usewithSigningConfig(AwsSigningConfig)instead.withEndpoint(URI endpoint) withFileIoOptions(FileIoOptions fileIoOptions) Sets the file I/O options for controlling how client performs file I/O operations.withHttpRequest(HttpRequest httpRequest) Set the initial HTTP request.withMetaRequestType(S3MetaRequestOptions.MetaRequestType metaRequestType) withObjectSizeHint(Long objectSizeHint) withOperationName(String operationName) The S3 operation name (eg: "CreateBucket"), this MUST be set forS3MetaRequestOptions.MetaRequestType.DEFAULT, it is ignored for other meta request types since the operation is implicit.withRequestFilePath(Path requestFilePath) If set, this file is sent as the request's body, and thewithHttpRequest(software.amazon.awssdk.crt.http.HttpRequest)body stream is ignored.withResponseFileDeleteOnFailure(boolean responseFileDeleteOnFailure) Sets whether to delete the response file on failure when downloading an object from S3.withResponseFileOption(S3MetaRequestOptions.ResponseFileOption responseFileOption) Sets the option for how to handle the response file when downloading an object from S3.withResponseFilePath(Path responseFilePath) If set, this file will be used to write the response body to a file.withResponseFilePosition(long responseFilePosition) Sets the position to start writing to the response file.withResponseHandler(S3MetaRequestResponseHandler responseHandler) withResumeToken(ResumeToken resumeToken) withSigningConfig(AwsSigningConfig signingConfig) The configuration related to signing used by S3 client.withValidateChecksum(boolean validateChecksum) Deprecated.Please usewithChecksumConfig(ChecksumConfig)instead.
-
Constructor Details
-
S3MetaRequestOptions
public S3MetaRequestOptions()
-
-
Method Details
-
withMetaRequestType
public S3MetaRequestOptions withMetaRequestType(S3MetaRequestOptions.MetaRequestType metaRequestType) -
getMetaRequestType
-
withOperationName
The S3 operation name (eg: "CreateBucket"), this MUST be set forS3MetaRequestOptions.MetaRequestType.DEFAULT, it is ignored for other meta request types since the operation is implicit. See S3 API documentation for the canonical list of names. This name is used to fill out details in metrics and error reports. It also drives some operation-specific behavior. If you pass the wrong name, you risk getting the wrong behavior. For example, every operation except "GetObject" has its response checked for error, even if the HTTP status-code was 200 OK (see knowledge center). If you used theDEFAULTtype to do GetObject, but mis-named it "Download", and the object looked like XML with an error code, then the meta-request would fail. You risk logging the full response body, and leaking sensitive data.- Parameters:
operationName- the operation name for thisS3MetaRequestOptions.MetaRequestType.DEFAULTmeta request- Returns:
- this
-
getOperationName
-
withChecksumConfig
The config related to checksum used for the meta request. SeeChecksumConfigfor details.- Parameters:
checksumConfig- The checksum config used for the meta request- Returns:
- this
-
getChecksumConfig
-
withChecksumAlgorithm
Deprecated.Please usewithChecksumConfig(ChecksumConfig)instead. Specify the checksum algorithm to use use for put requests, if unset defaults to NONE and no checksum will be calculated. The location of the checksum will be default to trailer.- Parameters:
checksumAlgorithm- the checksum algorithm to use use for put requests- Returns:
- this
-
getChecksumAlgorithm
Deprecated.- Returns:
- the checksum algorithm to use use for put requests
-
withValidateChecksum
Deprecated.Please usewithChecksumConfig(ChecksumConfig)instead. validateChecksum defaults to false, if set to true, it will cause the client to compare a streamed calculation of the objects checksum to a remotely stored checksum assigned to the object if one exists. The checksumValidated field passed in parameter of the finished callback will inform the user if validation ocurred. A mismatch will result in a AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH error- Parameters:
validateChecksum- Validate the checksum of response if server provides.- Returns:
- this
-
getValidateChecksum
public boolean getValidateChecksum()Deprecated.- Returns:
- Validate the checksum of response if server provides.
-
withHttpRequest
Set the initial HTTP request. Note: When uploading a file, you can get better performance by settingwithRequestFilePath(java.nio.file.Path)instead of setting a body stream on the HttpRequest. (If both are set, the file path is used and body stream is ignored)- Parameters:
httpRequest- initial HTTP request message.- Returns:
- this
-
getHttpRequest
-
withRequestFilePath
If set, this file is sent as the request's body, and thewithHttpRequest(software.amazon.awssdk.crt.http.HttpRequest)body stream is ignored. This can give better upload performance than sending data using the body stream.- Parameters:
requestFilePath- path to file to send as the request's body.- Returns:
- this
-
getRequestFilePath
-
withResponseHandler
-
getResponseHandler
-
withCredentialsProvider
Deprecated.Please usewithSigningConfig(AwsSigningConfig)instead. The credentials provider will be used to create the signing Config to override the client level config. The client config will be used.- Parameters:
credentialsProvider- provide credentials for signing.- Returns:
- this
-
getCredentialsProvider
-
withSigningConfig
The configuration related to signing used by S3 client. It will override the client level configuration if provided. `AwsSigningConfig.getDefaultS3SigningConfig(region, credentialsProvider);` can be used as helper to create the default configuration to be used for S3. If not set, the client configuration will be used. If set: - All fields are optional. The credentials will be resolve from client if not set. - S3 Client will derive the right config for signing process based on this. Notes: - For SIGV4_S3EXPRESS, S3 client will use the credentials in the config to derive the S3Express credentials that are used in the signing process. - Client may make modifications to signing config before passing it on to signer.- Parameters:
signingConfig- configuration related to signing via an AWS signing process.- Returns:
- this
-
getSigningConfig
-
withEndpoint
-
getEndpoint
-
withResumeToken
-
getResumeToken
-
withObjectSizeHint
-
getObjectSizeHint
-
withResponseFilePath
If set, this file will be used to write the response body to a file. And theHttpStreamResponseHandler.onResponseBody(software.amazon.awssdk.crt.http.HttpStream, byte[])will not be invoked.withResponseFileOption(software.amazon.awssdk.crt.s3.S3MetaRequestOptions.ResponseFileOption)configures the write behavior.- Parameters:
responseFilePath- path to file to write response body to.- Returns:
- this
-
getResponseFilePath
-
withResponseFileOption
public S3MetaRequestOptions withResponseFileOption(S3MetaRequestOptions.ResponseFileOption responseFileOption) Sets the option for how to handle the response file when downloading an object from S3. This option is only applicable whenwithResponseFilePath(java.nio.file.Path)is set. By default, the option is set toS3MetaRequestOptions.ResponseFileOption.CREATE_OR_REPLACE.- Parameters:
responseFileOption- The option for handling the response file.- Returns:
- this
-
getResponseFileOption
-
withResponseFilePosition
Sets the position to start writing to the response file. This option is only applicable whenwithResponseFileOption(software.amazon.awssdk.crt.s3.S3MetaRequestOptions.ResponseFileOption)is set toS3MetaRequestOptions.ResponseFileOption.WRITE_TO_POSITION.- Parameters:
responseFilePosition- The position to start writing to the response file.- Returns:
- this
-
getResponseFilePosition
public long getResponseFilePosition() -
withResponseFileDeleteOnFailure
Sets whether to delete the response file on failure when downloading an object from S3. This option is only applicable when a response file path is set.- Parameters:
responseFileDeleteOnFailure- True to delete the response file on failure, False to leave it as-is.- Returns:
- this
-
getResponseFileDeleteOnFailure
public boolean getResponseFileDeleteOnFailure() -
withFileIoOptions
Sets the file I/O options for controlling how client performs file I/O operations. It overrides the client-level settings if provided. Notes: This only applies to the workloads that `withRequestFilePath` was set.- Parameters:
fileIoOptions- the file I/O options to use- Returns:
- this
-
getFileIoOptions
Gets the file I/O options for controlling how client performs file I/O operations.- Returns:
- the file I/O options, or null if not set
-
withChecksumConfig(ChecksumConfig)instead.