1- package com .amazonaws .largepayloadoffloading ;
1+ package com .amazonaws .payloadoffloading ;
22
33import com .amazonaws .AmazonClientException ;
44import com .amazonaws .annotation .NotThreadSafe ;
88import org .apache .commons .logging .LogFactory ;
99
1010/**
11- * Amazon large payload storage configuration options such as Amazon S3 client,
12- * bucket name, and payload size threshold for large payloads.
11+ * Amazon payload storage configuration options such as Amazon S3 client,
12+ * bucket name, and payload size threshold for payloads.
1313 */
1414@ NotThreadSafe
15- public class LargePayloadStorageConfiguration {
16- private static final Log LOG = LogFactory .getLog (LargePayloadStorageConfiguration .class );
15+ public class PayloadStorageConfiguration {
16+ private static final Log LOG = LogFactory .getLog (PayloadStorageConfiguration .class );
1717
1818 private AmazonS3 s3 ;
1919 private String s3BucketName ;
2020 private int payloadSizeThreshold = 0 ;
2121 private boolean alwaysThroughS3 = false ;
22- private boolean largePayloadSupport = false ;
22+ private boolean payloadSupport = false ;
2323 /**
2424 * This field is optional, it is set only when we want to configure S3 Server Side Encryption with KMS.
2525 */
2626 private SSEAwsKeyManagementParams sseAwsKeyManagementParams ;
2727
28- public LargePayloadStorageConfiguration () {
28+ public PayloadStorageConfiguration () {
2929 s3 = null ;
3030 s3BucketName = null ;
3131 sseAwsKeyManagementParams = null ;
3232 }
3333
34- public LargePayloadStorageConfiguration ( LargePayloadStorageConfiguration other ) {
34+ public PayloadStorageConfiguration ( PayloadStorageConfiguration other ) {
3535 this .s3 = other .getAmazonS3Client ();
3636 this .s3BucketName = other .getS3BucketName ();
3737 this .sseAwsKeyManagementParams = other .getSSEAwsKeyManagementParams ();
38- this .largePayloadSupport = other .isLargePayloadSupportEnabled ();
38+ this .payloadSupport = other .isPayloadSupportEnabled ();
3939 this .alwaysThroughS3 = other .isAlwaysThroughS3 ();
4040 this .payloadSizeThreshold = other .getPayloadSizeThreshold ();
4141 }
4242
4343 /**
44- * Enables support for large payloads .
44+ * Enables support for payloads .
4545 *
46- * @param s3 Amazon S3 client which is going to be used for storing large payload.
47- * @param s3BucketName Name of the bucket which is going to be used for storing large payload.
46+ * @param s3 Amazon S3 client which is going to be used for storing payload.
47+ * @param s3BucketName Name of the bucket which is going to be used for storing payload.
4848 * The bucket must be already created and configured in s3.
4949 */
50- public void setLargePayloadSupportEnabled (AmazonS3 s3 , String s3BucketName ) {
50+ public void setPayloadSupportEnabled (AmazonS3 s3 , String s3BucketName ) {
5151 if (s3 == null || s3BucketName == null ) {
5252 String errorMessage = "S3 client and/or S3 bucket name cannot be null." ;
5353 LOG .error (errorMessage );
5454 throw new AmazonClientException (errorMessage );
5555 }
56- if (isLargePayloadSupportEnabled ()) {
57- LOG .warn ("Large-payload support is already enabled. Overwriting AmazonS3Client and S3BucketName." );
56+ if (isPayloadSupportEnabled ()) {
57+ LOG .warn ("Payload support is already enabled. Overwriting AmazonS3Client and S3BucketName." );
5858 }
5959 this .s3 = s3 ;
6060 this .s3BucketName = s3BucketName ;
61- this .largePayloadSupport = true ;
62- LOG .info ("Large-payload support enabled." );
61+ this .payloadSupport = true ;
62+ LOG .info ("Payload support enabled." );
6363 }
6464
6565 /**
66- * Enables support for large payload.
66+ * Enables support for payload.
6767 *
68- * @param s3 Amazon S3 client which is going to be used for storing large payloads.
69- * @param s3BucketName Name of the bucket which is going to be used for storing large payloads.
68+ * @param s3 Amazon S3 client which is going to be used for storing payloads.
69+ * @param s3BucketName Name of the bucket which is going to be used for storing payloads.
7070 * The bucket must be already created and configured in s3.
71- * @return the updated LargePayloadStorageConfiguration object.
71+ * @return the updated PayloadStorageConfiguration object.
7272 */
73- public LargePayloadStorageConfiguration withLargePayloadSupportEnabled (AmazonS3 s3 , String s3BucketName ) {
74- setLargePayloadSupportEnabled (s3 , s3BucketName );
73+ public PayloadStorageConfiguration withPayloadSupportEnabled (AmazonS3 s3 , String s3BucketName ) {
74+ setPayloadSupportEnabled (s3 , s3BucketName );
7575 return this ;
7676 }
7777
7878 /**
79- * Disables support for large payloads.
79+ * Disables support for payloads.
8080 */
81- public void setLargePayloadSupportDisabled () {
81+ public void setPayloadSupportDisabled () {
8282 s3 = null ;
8383 s3BucketName = null ;
84- largePayloadSupport = false ;
85- LOG .info ("Large-payload support disabled." );
84+ payloadSupport = false ;
85+ LOG .info ("Payload support disabled." );
8686 }
8787
8888 /**
89- * Disables support for large payload.
89+ * Disables support for payload.
9090 *
91- * @return the updated LargePayloadStorageConfiguration object.
91+ * @return the updated PayloadStorageConfiguration object.
9292 */
93- public LargePayloadStorageConfiguration withLargePayloadSupportDisabled () {
94- setLargePayloadSupportDisabled ();
93+ public PayloadStorageConfiguration withPayloadSupportDisabled () {
94+ setPayloadSupportDisabled ();
9595 return this ;
9696 }
9797
9898 /**
99- * Check if the support for large payloads if enabled.
99+ * Check if the support for payloads if enabled.
100100 *
101- * @return true if support for large payloads is enabled.
101+ * @return true if support for payloads is enabled.
102102 */
103- public boolean isLargePayloadSupportEnabled () {
104- return largePayloadSupport ;
103+ public boolean isPayloadSupportEnabled () {
104+ return payloadSupport ;
105105 }
106106
107107 /**
108- * Gets the Amazon S3 client which is being used for storing large payloads.
108+ * Gets the Amazon S3 client which is being used for storing payloads.
109109 *
110110 * @return Reference to the Amazon S3 client which is being used.
111111 */
@@ -114,7 +114,7 @@ public AmazonS3 getAmazonS3Client() {
114114 }
115115
116116 /**
117- * Gets the name of the S3 bucket which is being used for storing large payload.
117+ * Gets the name of the S3 bucket which is being used for storing payload.
118118 *
119119 * @return The name of the bucket which is being used.
120120 */
@@ -144,9 +144,9 @@ public void setSSEAwsKeyManagementParams(SSEAwsKeyManagementParams sseAwsKeyMana
144144 * Sets the the S3 SSE-KMS encryption params of S3 objects under configured S3 bucket name.
145145 *
146146 * @param sseAwsKeyManagementParams The S3 SSE-KMS params used for encryption.
147- * @return the updated LargePayloadStorageConfiguration object
147+ * @return the updated PayloadStorageConfiguration object
148148 */
149- public LargePayloadStorageConfiguration withSSEAwsKeyManagementParams (SSEAwsKeyManagementParams sseAwsKeyManagementParams ) {
149+ public PayloadStorageConfiguration withSSEAwsKeyManagementParams (SSEAwsKeyManagementParams sseAwsKeyManagementParams ) {
150150 setSSEAwsKeyManagementParams (sseAwsKeyManagementParams );
151151 return this ;
152152 }
@@ -156,9 +156,9 @@ public LargePayloadStorageConfiguration withSSEAwsKeyManagementParams(SSEAwsKeyM
156156 *
157157 * @param payloadSizeThreshold Payload size threshold to be used for storing in Amazon S3.
158158 * Default: 256KB.
159- * @return the updated LargePayloadStorageConfiguration object.
159+ * @return the updated PayloadStorageConfiguration object.
160160 */
161- public LargePayloadStorageConfiguration withPayloadSizeThreshold (int payloadSizeThreshold ) {
161+ public PayloadStorageConfiguration withPayloadSizeThreshold (int payloadSizeThreshold ) {
162162 setPayloadSizeThreshold (payloadSizeThreshold );
163163 return this ;
164164 }
@@ -187,9 +187,9 @@ public void setPayloadSizeThreshold(int payloadSizeThreshold) {
187187 *
188188 * @param alwaysThroughS3 Whether or not all payloads regardless of their size
189189 * should be stored in Amazon S3. Default: false
190- * @return the updated LargePayloadStorageConfiguration object.
190+ * @return the updated PayloadStorageConfiguration object.
191191 */
192- public LargePayloadStorageConfiguration withAlwaysThroughS3 (boolean alwaysThroughS3 ) {
192+ public PayloadStorageConfiguration withAlwaysThroughS3 (boolean alwaysThroughS3 ) {
193193 setAlwaysThroughS3 (alwaysThroughS3 );
194194 return this ;
195195 }
0 commit comments