Class PayloadStorageAsyncConfiguration
java.lang.Object
software.amazon.payloadoffloading.PayloadStorageConfigurationBase
software.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
@NotThreadSafe
public class PayloadStorageAsyncConfiguration
extends PayloadStorageConfigurationBase
Amazon payload storage configuration options such as asynchronous Amazon S3 client, bucket name, and payload size threshold for payloads.
Server side encryption is optional and can be enabled using with withServerSideEncryption(ServerSideEncryptionStrategy)
or PayloadStorageConfigurationBase.setServerSideEncryptionStrategy(ServerSideEncryptionStrategy)
There are two possible options for server side encrption. This can be using a customer managed key or AWS managed CMK.
Example usage:
withServerSideEncryption(ServerSideEncrptionFactory.awsManagedCmk())
or
withServerSideEncryption(ServerSideEncrptionFactory.customerKey(YOUR_CUSTOMER_ID))
- See Also:
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionsoftware.amazon.awssdk.services.s3.S3AsyncClientGets the Amazon S3 async client which is being used for storing payloads.voidDisables support for payloads.voidsetPayloadSupportEnabled(software.amazon.awssdk.services.s3.S3AsyncClient s3Async, String s3BucketName) Enables support for payloads using asynchronous storage.withAlwaysThroughS3(boolean alwaysThroughS3) Sets whether or not all payloads regardless of their size should be stored in Amazon S3.withObjectCannedACL(software.amazon.awssdk.services.s3.model.ObjectCannedACL objectCannedACL) Configures the ACL to apply to the Amazon S3 putObject request.withPayloadSizeThreshold(int payloadSizeThreshold) Sets the payload size threshold for storing payloads in Amazon S3.Disables support for payload.withPayloadSupportEnabled(software.amazon.awssdk.services.s3.S3AsyncClient s3Async, String s3BucketName) Enables support for payload.withServerSideEncryption(ServerSideEncryptionStrategy serverSideEncryptionStrategy) Sets which method of server side encryption should be used, if required.Methods inherited from class software.amazon.payloadoffloading.PayloadStorageConfigurationBase
getObjectCannedACL, getPayloadSizeThreshold, getS3BucketName, getServerSideEncryptionStrategy, isAlwaysThroughS3, isObjectCannedACLDefined, isPayloadSupportEnabled, setAlwaysThroughS3, setObjectCannedACL, setPayloadSizeThreshold, setPayloadSupportEnabled, setServerSideEncryptionStrategy
-
Constructor Details
-
PayloadStorageAsyncConfiguration
public PayloadStorageAsyncConfiguration() -
PayloadStorageAsyncConfiguration
-
-
Method Details
-
setPayloadSupportEnabled
public void setPayloadSupportEnabled(software.amazon.awssdk.services.s3.S3AsyncClient s3Async, String s3BucketName) Enables support for payloads using asynchronous storage.- Parameters:
s3Async- Amazon S3 client which is going to be used for storing payload.s3BucketName- Name of the bucket which is going to be used for storing payload. The bucket must be already created and configured in s3.
-
withPayloadSupportEnabled
public PayloadStorageAsyncConfiguration withPayloadSupportEnabled(software.amazon.awssdk.services.s3.S3AsyncClient s3Async, String s3BucketName) Enables support for payload.- Parameters:
s3Async- Amazon S3 client which is going to be used for storing payload.s3BucketName- Name of the bucket which is going to be used for storing payloads. The bucket must be already created and configured in s3.- Returns:
- the updated PayloadStorageAsyncConfiguration object.
-
setPayloadSupportDisabled
public void setPayloadSupportDisabled()Disables support for payloads.- Overrides:
setPayloadSupportDisabledin classPayloadStorageConfigurationBase
-
withPayloadSupportDisabled
Disables support for payload.- Returns:
- the updated PayloadStorageAsyncConfiguration object.
-
getS3AsyncClient
public software.amazon.awssdk.services.s3.S3AsyncClient getS3AsyncClient()Gets the Amazon S3 async client which is being used for storing payloads.- Returns:
- Reference to the Amazon S3 async client which is being used.
-
withPayloadSizeThreshold
Sets the payload size threshold for storing payloads in Amazon S3.- Parameters:
payloadSizeThreshold- Payload size threshold to be used for storing in Amazon S3. Default: 256KB.- Returns:
- the updated PayloadStorageAsyncConfiguration object.
-
withAlwaysThroughS3
Sets whether or not all payloads regardless of their size should be stored in Amazon S3.- Parameters:
alwaysThroughS3- Whether or not all payloads regardless of their size should be stored in Amazon S3. Default: false- Returns:
- the updated PayloadStorageAsyncConfiguration object.
-
withServerSideEncryption
public PayloadStorageAsyncConfiguration withServerSideEncryption(ServerSideEncryptionStrategy serverSideEncryptionStrategy) Sets which method of server side encryption should be used, if required. This is optional, it is set only when you want to configure S3 server side encryption with KMS.- Parameters:
serverSideEncryptionStrategy- The method of encryption required for S3 server side encryption with KMS.- Returns:
- the updated PayloadStorageAsyncConfiguration object.
-
withObjectCannedACL
public PayloadStorageAsyncConfiguration withObjectCannedACL(software.amazon.awssdk.services.s3.model.ObjectCannedACL objectCannedACL) Configures the ACL to apply to the Amazon S3 putObject request.- Parameters:
objectCannedACL- The ACL to be used when storing objects in Amazon S3
-