@NotThreadSafe public class PayloadStorageConfiguration extends Object
Amazon payload storage configuration options such as 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 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))
ServerSideEncryptionFactory| Constructor and Description |
|---|
PayloadStorageConfiguration() |
PayloadStorageConfiguration(PayloadStorageConfiguration other) |
| Modifier and Type | Method and Description |
|---|---|
software.amazon.awssdk.services.s3.model.ObjectCannedACL |
getObjectCannedACL()
Gets the AWS ACL to apply to the Amazon S3 putObject request.
|
int |
getPayloadSizeThreshold()
Gets the payload size threshold for storing payloads in Amazon S3.
|
String |
getS3BucketName()
Gets the name of the S3 bucket which is being used for storing payload.
|
software.amazon.awssdk.services.s3.S3Client |
getS3Client()
Gets the Amazon S3 client which is being used for storing payloads.
|
ServerSideEncryptionStrategy |
getServerSideEncryptionStrategy()
The method of service side encryption which should be used, if required.
|
boolean |
isAlwaysThroughS3()
Checks whether or not all payloads regardless of their size are being stored in Amazon S3.
|
boolean |
isObjectCannedACLDefined()
Checks whether an ACL have been configured for storing objects in Amazon S3.
|
boolean |
isPayloadSupportEnabled()
Check if the support for payloads if enabled.
|
void |
setAlwaysThroughS3(boolean alwaysThroughS3)
Sets whether or not all payloads regardless of their size should be stored in Amazon S3.
|
void |
setObjectCannedACL(software.amazon.awssdk.services.s3.model.ObjectCannedACL objectCannedACL)
Configures the ACL to apply to the Amazon S3 putObject request.
|
void |
setPayloadSizeThreshold(int payloadSizeThreshold)
Sets the payload size threshold for storing payloads in Amazon S3.
|
void |
setPayloadSupportDisabled()
Disables support for payloads.
|
void |
setPayloadSupportEnabled(software.amazon.awssdk.services.s3.S3Client s3,
String s3BucketName)
Enables support for payloads .
|
void |
setServerSideEncryptionStrategy(ServerSideEncryptionStrategy serverSideEncryptionStrategy)
Sets which method of server side encryption should be use, if required.
|
PayloadStorageConfiguration |
withAlwaysThroughS3(boolean alwaysThroughS3)
Sets whether or not all payloads regardless of their size should be stored in Amazon S3.
|
PayloadStorageConfiguration |
withObjectCannedACL(software.amazon.awssdk.services.s3.model.ObjectCannedACL objectCannedACL)
Configures the ACL to apply to the Amazon S3 putObject request.
|
PayloadStorageConfiguration |
withPayloadSizeThreshold(int payloadSizeThreshold)
Sets the payload size threshold for storing payloads in Amazon S3.
|
PayloadStorageConfiguration |
withPayloadSupportDisabled()
Disables support for payload.
|
PayloadStorageConfiguration |
withPayloadSupportEnabled(software.amazon.awssdk.services.s3.S3Client s3,
String s3BucketName)
Enables support for payload.
|
PayloadStorageConfiguration |
withServerSideEncryption(ServerSideEncryptionStrategy serverSideEncryptionStrategy)
Sets which method of server side encryption should be used, if required.
|
public PayloadStorageConfiguration()
public PayloadStorageConfiguration(PayloadStorageConfiguration other)
public void setPayloadSupportEnabled(software.amazon.awssdk.services.s3.S3Client s3,
String s3BucketName)
s3 - 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.public PayloadStorageConfiguration withPayloadSupportEnabled(software.amazon.awssdk.services.s3.S3Client s3, String s3BucketName)
s3 - Amazon S3 client which is going to be used for storing payloads.s3BucketName - Name of the bucket which is going to be used for storing payloads.
The bucket must be already created and configured in s3.public void setPayloadSupportDisabled()
public PayloadStorageConfiguration withPayloadSupportDisabled()
public boolean isPayloadSupportEnabled()
public software.amazon.awssdk.services.s3.S3Client getS3Client()
public String getS3BucketName()
public PayloadStorageConfiguration withPayloadSizeThreshold(int payloadSizeThreshold)
payloadSizeThreshold - Payload size threshold to be used for storing in Amazon S3.
Default: 256KB.public int getPayloadSizeThreshold()
public void setPayloadSizeThreshold(int payloadSizeThreshold)
payloadSizeThreshold - Payload size threshold to be used for storing in Amazon S3.
Default: 256KB.public PayloadStorageConfiguration withAlwaysThroughS3(boolean alwaysThroughS3)
alwaysThroughS3 - Whether or not all payloads regardless of their size
should be stored in Amazon S3. Default: falsepublic boolean isAlwaysThroughS3()
public void setAlwaysThroughS3(boolean alwaysThroughS3)
alwaysThroughS3 - Whether or not all payloads regardless of their size
should be stored in Amazon S3. Default: falsepublic PayloadStorageConfiguration withServerSideEncryption(ServerSideEncryptionStrategy serverSideEncryptionStrategy)
serverSideEncryptionStrategy - The method of encryption required for S3 server side encryption with KMS.public void setServerSideEncryptionStrategy(ServerSideEncryptionStrategy serverSideEncryptionStrategy)
serverSideEncryptionStrategy - The method of encryption required for S3 server side encryption with KMS.public ServerSideEncryptionStrategy getServerSideEncryptionStrategy()
public void setObjectCannedACL(software.amazon.awssdk.services.s3.model.ObjectCannedACL objectCannedACL)
objectCannedACL - The ACL to be used when storing objects in Amazon S3public PayloadStorageConfiguration withObjectCannedACL(software.amazon.awssdk.services.s3.model.ObjectCannedACL objectCannedACL)
objectCannedACL - The ACL to be used when storing objects in Amazon S3public boolean isObjectCannedACLDefined()
public software.amazon.awssdk.services.s3.model.ObjectCannedACL getObjectCannedACL()
Copyright © 2020. All rights reserved.