1
- package com .amazonaws .largepayloadoffloading ;
1
+ package com .amazonaws .payloadoffloading ;
2
2
3
3
import com .amazonaws .AmazonClientException ;
4
4
import com .amazonaws .annotation .NotThreadSafe ;
8
8
import org .apache .commons .logging .LogFactory ;
9
9
10
10
/**
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.
13
13
*/
14
14
@ 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 );
17
17
18
18
private AmazonS3 s3 ;
19
19
private String s3BucketName ;
20
20
private int payloadSizeThreshold = 0 ;
21
21
private boolean alwaysThroughS3 = false ;
22
- private boolean largePayloadSupport = false ;
22
+ private boolean payloadSupport = false ;
23
23
/**
24
24
* This field is optional, it is set only when we want to configure S3 Server Side Encryption with KMS.
25
25
*/
26
26
private SSEAwsKeyManagementParams sseAwsKeyManagementParams ;
27
27
28
- public LargePayloadStorageConfiguration () {
28
+ public PayloadStorageConfiguration () {
29
29
s3 = null ;
30
30
s3BucketName = null ;
31
31
sseAwsKeyManagementParams = null ;
32
32
}
33
33
34
- public LargePayloadStorageConfiguration ( LargePayloadStorageConfiguration other ) {
34
+ public PayloadStorageConfiguration ( PayloadStorageConfiguration other ) {
35
35
this .s3 = other .getAmazonS3Client ();
36
36
this .s3BucketName = other .getS3BucketName ();
37
37
this .sseAwsKeyManagementParams = other .getSSEAwsKeyManagementParams ();
38
- this .largePayloadSupport = other .isLargePayloadSupportEnabled ();
38
+ this .payloadSupport = other .isPayloadSupportEnabled ();
39
39
this .alwaysThroughS3 = other .isAlwaysThroughS3 ();
40
40
this .payloadSizeThreshold = other .getPayloadSizeThreshold ();
41
41
}
42
42
43
43
/**
44
- * Enables support for large payloads .
44
+ * Enables support for payloads .
45
45
*
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.
48
48
* The bucket must be already created and configured in s3.
49
49
*/
50
- public void setLargePayloadSupportEnabled (AmazonS3 s3 , String s3BucketName ) {
50
+ public void setPayloadSupportEnabled (AmazonS3 s3 , String s3BucketName ) {
51
51
if (s3 == null || s3BucketName == null ) {
52
52
String errorMessage = "S3 client and/or S3 bucket name cannot be null." ;
53
53
LOG .error (errorMessage );
54
54
throw new AmazonClientException (errorMessage );
55
55
}
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." );
58
58
}
59
59
this .s3 = s3 ;
60
60
this .s3BucketName = s3BucketName ;
61
- this .largePayloadSupport = true ;
62
- LOG .info ("Large-payload support enabled." );
61
+ this .payloadSupport = true ;
62
+ LOG .info ("Payload support enabled." );
63
63
}
64
64
65
65
/**
66
- * Enables support for large payload.
66
+ * Enables support for payload.
67
67
*
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.
70
70
* The bucket must be already created and configured in s3.
71
- * @return the updated LargePayloadStorageConfiguration object.
71
+ * @return the updated PayloadStorageConfiguration object.
72
72
*/
73
- public LargePayloadStorageConfiguration withLargePayloadSupportEnabled (AmazonS3 s3 , String s3BucketName ) {
74
- setLargePayloadSupportEnabled (s3 , s3BucketName );
73
+ public PayloadStorageConfiguration withPayloadSupportEnabled (AmazonS3 s3 , String s3BucketName ) {
74
+ setPayloadSupportEnabled (s3 , s3BucketName );
75
75
return this ;
76
76
}
77
77
78
78
/**
79
- * Disables support for large payloads.
79
+ * Disables support for payloads.
80
80
*/
81
- public void setLargePayloadSupportDisabled () {
81
+ public void setPayloadSupportDisabled () {
82
82
s3 = null ;
83
83
s3BucketName = null ;
84
- largePayloadSupport = false ;
85
- LOG .info ("Large-payload support disabled." );
84
+ payloadSupport = false ;
85
+ LOG .info ("Payload support disabled." );
86
86
}
87
87
88
88
/**
89
- * Disables support for large payload.
89
+ * Disables support for payload.
90
90
*
91
- * @return the updated LargePayloadStorageConfiguration object.
91
+ * @return the updated PayloadStorageConfiguration object.
92
92
*/
93
- public LargePayloadStorageConfiguration withLargePayloadSupportDisabled () {
94
- setLargePayloadSupportDisabled ();
93
+ public PayloadStorageConfiguration withPayloadSupportDisabled () {
94
+ setPayloadSupportDisabled ();
95
95
return this ;
96
96
}
97
97
98
98
/**
99
- * Check if the support for large payloads if enabled.
99
+ * Check if the support for payloads if enabled.
100
100
*
101
- * @return true if support for large payloads is enabled.
101
+ * @return true if support for payloads is enabled.
102
102
*/
103
- public boolean isLargePayloadSupportEnabled () {
104
- return largePayloadSupport ;
103
+ public boolean isPayloadSupportEnabled () {
104
+ return payloadSupport ;
105
105
}
106
106
107
107
/**
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.
109
109
*
110
110
* @return Reference to the Amazon S3 client which is being used.
111
111
*/
@@ -114,7 +114,7 @@ public AmazonS3 getAmazonS3Client() {
114
114
}
115
115
116
116
/**
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.
118
118
*
119
119
* @return The name of the bucket which is being used.
120
120
*/
@@ -144,9 +144,9 @@ public void setSSEAwsKeyManagementParams(SSEAwsKeyManagementParams sseAwsKeyMana
144
144
* Sets the the S3 SSE-KMS encryption params of S3 objects under configured S3 bucket name.
145
145
*
146
146
* @param sseAwsKeyManagementParams The S3 SSE-KMS params used for encryption.
147
- * @return the updated LargePayloadStorageConfiguration object
147
+ * @return the updated PayloadStorageConfiguration object
148
148
*/
149
- public LargePayloadStorageConfiguration withSSEAwsKeyManagementParams (SSEAwsKeyManagementParams sseAwsKeyManagementParams ) {
149
+ public PayloadStorageConfiguration withSSEAwsKeyManagementParams (SSEAwsKeyManagementParams sseAwsKeyManagementParams ) {
150
150
setSSEAwsKeyManagementParams (sseAwsKeyManagementParams );
151
151
return this ;
152
152
}
@@ -156,9 +156,9 @@ public LargePayloadStorageConfiguration withSSEAwsKeyManagementParams(SSEAwsKeyM
156
156
*
157
157
* @param payloadSizeThreshold Payload size threshold to be used for storing in Amazon S3.
158
158
* Default: 256KB.
159
- * @return the updated LargePayloadStorageConfiguration object.
159
+ * @return the updated PayloadStorageConfiguration object.
160
160
*/
161
- public LargePayloadStorageConfiguration withPayloadSizeThreshold (int payloadSizeThreshold ) {
161
+ public PayloadStorageConfiguration withPayloadSizeThreshold (int payloadSizeThreshold ) {
162
162
setPayloadSizeThreshold (payloadSizeThreshold );
163
163
return this ;
164
164
}
@@ -187,9 +187,9 @@ public void setPayloadSizeThreshold(int payloadSizeThreshold) {
187
187
*
188
188
* @param alwaysThroughS3 Whether or not all payloads regardless of their size
189
189
* should be stored in Amazon S3. Default: false
190
- * @return the updated LargePayloadStorageConfiguration object.
190
+ * @return the updated PayloadStorageConfiguration object.
191
191
*/
192
- public LargePayloadStorageConfiguration withAlwaysThroughS3 (boolean alwaysThroughS3 ) {
192
+ public PayloadStorageConfiguration withAlwaysThroughS3 (boolean alwaysThroughS3 ) {
193
193
setAlwaysThroughS3 (alwaysThroughS3 );
194
194
return this ;
195
195
}
0 commit comments