@NotThreadSafe public abstract class AmazonS3Builder<Subclass extends AmazonS3Builder,TypeToBuild extends AmazonS3> extends AwsSyncClientBuilder<Subclass,TypeToBuild>
AwsClientBuilder.EndpointConfiguration, AwsClientBuilder.SyncBuilderParams
Modifier and Type | Field and Description |
---|---|
protected SdkFunction<com.ibm.cloud.objectstorage.services.s3.AmazonS3ClientParamsWrapper,AmazonS3> |
clientFactory |
Modifier | Constructor and Description |
---|---|
protected |
AmazonS3Builder() |
Modifier and Type | Method and Description |
---|---|
Subclass |
disableChunkedEncoding()
Disables chunked encoding on clients built via the builder.
|
Subclass |
enableAccelerateMode()
Enables accelerate mode on clients built with the builder.
|
Subclass |
enableDualstack()
Enables dualstack mode on clients built with the builder.
|
Subclass |
enableForceGlobalBucketAccess()
Enable global bucket access for clients generated by this builder.
|
Subclass |
enablePathStyleAccess()
Enables path style access for clients built via this builder.
|
Subclass |
enablePayloadSigning()
Enables payload signing for all situations on clients built via this builder.
|
Boolean |
isAccelerateModeEnabled() |
Boolean |
isChunkedEncodingDisabled() |
Boolean |
isDualstackEnabled() |
Boolean |
isForceGlobalBucketAccessEnabled() |
Boolean |
isPathStyleAccessEnabled() |
Boolean |
isPayloadSigningEnabled() |
protected S3ClientOptions |
resolveS3ClientOptions()
Enables us-east-1 regional mode on clients built with the builder.
|
void |
setAccelerateModeEnabled(Boolean accelerateModeEnabled)
Configures the client to use S3 accelerate endpoint for all requests.
|
void |
setChunkedEncodingDisabled(Boolean chunkedEncodingDisabled)
Configures the client to disable chunked encoding for all requests.
|
void |
setDualstackEnabled(Boolean dualstackEnabled)
Configures the client to use Amazon S3 dualstack mode for all requests.
|
void |
setForceGlobalBucketAccessEnabled(Boolean forceGlobalBucketAccessEnabled)
Configure whether global bucket access is enabled for clients generated by this builder.
|
void |
setPathStyleAccessEnabled(Boolean pathStyleAccessEnabled)
Configures the client to use path-style access for all requests.
|
void |
setPayloadSigningEnabled(Boolean payloadSigningEnabled)
Configures the client to sign payloads in all situations.
|
Subclass |
withAccelerateModeEnabled(Boolean accelerateModeEnabled)
Configures the client to use S3 accelerate endpoint for all requests.
|
Subclass |
withChunkedEncodingDisabled(Boolean chunkedEncodingDisabled)
Configures the client to disable chunked encoding for all requests.
|
Subclass |
withDualstackEnabled(Boolean dualstackEnabled)
Configures the client to use Amazon S3 dualstack mode for all requests.
|
Subclass |
withForceGlobalBucketAccessEnabled(Boolean forceGlobalBucketAccessEnabled)
Configure whether global bucket access is enabled for clients generated by this builder.
|
Subclass |
withPathStyleAccessEnabled(Boolean pathStyleAccessEnabled)
Configures the client to use path-style access for all requests.
|
Subclass |
withPayloadSigningEnabled(Boolean payloadSigningEnabled)
Configures the client to sign payloads in all situations.
|
build, build
getClientConfiguration, getCredentials, getEndpoint, getMetricsCollector, getRegion, getRequestHandlers, getSubclass, getSyncClientParams, setClientConfiguration, setCredentials, setEndpointConfiguration, setMetricsCollector, setRegion, setRequestHandlers, withClientConfiguration, withCredentials, withEndpointConfiguration, withIAMEndpoint, withIAMMaxRetry, withIAMTokenRefresh, withMetricsCollector, withRegion, withRegion, withRequestHandlers
protected final SdkFunction<com.ibm.cloud.objectstorage.services.s3.AmazonS3ClientParamsWrapper,AmazonS3> clientFactory
public Boolean isPathStyleAccessEnabled()
public void setPathStyleAccessEnabled(Boolean pathStyleAccessEnabled)
Configures the client to use path-style access for all requests.
Amazon S3 supports virtual-hosted-style and path-style access in all Regions. The path-style syntax, however, requires that you use the region-specific endpoint when attempting to access a bucket.
The default behaviour is to detect which access style to use based on the configured endpoint (an IP will result in path-style access) and the bucket being accessed (some buckets are not valid DNS names). Setting this flag will result in path-style access being used for all requests.
pathStyleAccessEnabled
- True to always use path-style access.public Subclass withPathStyleAccessEnabled(Boolean pathStyleAccessEnabled)
Configures the client to use path-style access for all requests.
Amazon S3 supports virtual-hosted-style and path-style access in all Regions. The path-style syntax, however, requires that you use the region-specific endpoint when attempting to access a bucket.
The default behaviour is to detect which access style to use based on the configured endpoint (an IP will result in path-style access) and the bucket being accessed (some buckets are not valid DNS names). Setting this flag will result in path-style access being used for all requests.
pathStyleAccessEnabled
- True to always use path-style access.public Subclass enablePathStyleAccess()
Enables path style access for clients built via this builder.
Amazon S3 supports virtual-hosted-style and path-style access in all Regions. The path-style syntax, however, requires that you use the region-specific endpoint when attempting to access a bucket.
The default behaviour is to detect which access style to use based on the configured endpoint (an IP will result in path-style access) and the bucket being accessed (some buckets are not valid DNS names). Setting this flag will result in path-style access being used for all requests.
public Boolean isChunkedEncodingDisabled()
public void setChunkedEncodingDisabled(Boolean chunkedEncodingDisabled)
Configures the client to disable chunked encoding for all requests.
The default behavior is to enable chunked encoding automatically for PutObjectRequest and UploadPartRequest. Setting this flag will result in disabling chunked encoding for all requests.
Note: Enabling this option has performance implications since the checksum for the payload will have to be pre-calculated before sending the data. If your payload is large this will affect the overall time required to upload an object. Using this option is recommended only if your endpoint does not implement chunked uploading.
chunkedEncodingDisabled
- True to disable chunked encoding.public Subclass withChunkedEncodingDisabled(Boolean chunkedEncodingDisabled)
Configures the client to disable chunked encoding for all requests.
The default behavior is to enable chunked encoding automatically for PutObjectRequest and UploadPartRequest. Setting this flag will result in disabling chunked encoding for all requests.
Note: Enabling this option has performance implications since the checksum for the payload will have to be pre-calculated before sending the data. If your payload is large this will affect the overall time required to upload an object. Using this option is recommended only if your endpoint does not implement chunked uploading.
chunkedEncodingDisabled
- True to disable chunked encoding.public Subclass disableChunkedEncoding()
Disables chunked encoding on clients built via the builder.
The default behavior is to enable chunked encoding automatically for PutObjectRequest and UploadPartRequest. Setting this flag will result in disabling chunked encoding for all requests.
Note: Enabling this option has performance implications since the checksum for the payload will have to be pre-calculated before sending the data. If your payload is large this will affect the overall time required to upload an object. Using this option is recommended only if your endpoint does not implement chunked uploading.
public Boolean isAccelerateModeEnabled()
public void setAccelerateModeEnabled(Boolean accelerateModeEnabled)
Configures the client to use S3 accelerate endpoint for all requests.
A bucket by default cannot be accessed in accelerate mode. If you wish to do so, you need
to enable the accelerate configuration for the bucket in advance. To enable accelerate mode
see com.ibm.cloud.objectstorage.services.s3.AmazonS3Client#setBucketAccelerateConfiguration(com.ibm.cloud.objectstorage.services.s3.model.SetBucketAccelerateConfigurationRequest)
.
accelerateModeEnabled
- True to enable accelerate mode.public Subclass withAccelerateModeEnabled(Boolean accelerateModeEnabled)
Configures the client to use S3 accelerate endpoint for all requests.
A bucket by default cannot be accessed in accelerate mode. If you wish to do so, you need
to enable the accelerate configuration for the bucket in advance. To enable accelerate mode
see com.ibm.cloud.objectstorage.services.s3.AmazonS3Client#setBucketAccelerateConfiguration(com.ibm.cloud.objectstorage.services.s3.model.SetBucketAccelerateConfigurationRequest)
.
accelerateModeEnabled
- True to enable accelerate mode.public Subclass enableAccelerateMode()
Enables accelerate mode on clients built with the builder.
A bucket by default cannot be accessed in accelerate mode. If you wish to do so, you need
to enable the accelerate configuration for the bucket in advance. To enable accelerate mode
see com.ibm.cloud.objectstorage.services.s3.AmazonS3Client#setBucketAccelerateConfiguration(com.ibm.cloud.objectstorage.services.s3.model.SetBucketAccelerateConfigurationRequest)
.
public Boolean isPayloadSigningEnabled()
public void setPayloadSigningEnabled(Boolean payloadSigningEnabled)
Configures the client to sign payloads in all situations.
Payload signing is optional when chunked encoding is not used and requests are made against an HTTPS endpoint. Under these conditions the client will by default opt to not sign payloads to optimize performance. If this flag is set to true the client will instead always sign payloads.
Note: Payload signing can be expensive, particularly if transferring large payloads in a single chunk. Enabling this option will result in a performance penalty.
payloadSigningEnabled
- True to explicitly enable payload signing in all situationspublic Subclass withPayloadSigningEnabled(Boolean payloadSigningEnabled)
Configures the client to sign payloads in all situations.
Payload signing is optional when chunked encoding is not used and requests are made against an HTTPS endpoint. Under these conditions the client will by default opt to not sign payloads to optimize performance. If this flag is set to true the client will instead always sign payloads.
Note: Payload signing can be expensive, particularly if transferring large payloads in a single chunk. Enabling this option will result in a performance penalty.
payloadSigningEnabled
- True to explicitly enable payload signing in all situationspublic Subclass enablePayloadSigning()
Enables payload signing for all situations on clients built via this builder.
Payload signing is optional when chunked encoding is not used and requests are made against an HTTPS endpoint. Under these conditions the client will by default opt to not sign payloads to optimize performance. If this flag is set to true the client will instead always sign payloads.
Note: Payload signing can be expensive, particularly if transferring large payloads in a single chunk. Enabling this option will result in a performance penalty.
public Boolean isDualstackEnabled()
public void setDualstackEnabled(Boolean dualstackEnabled)
Configures the client to use Amazon S3 dualstack mode for all requests.
dualstackEnabled
- True to enable dualstack mode.public Subclass withDualstackEnabled(Boolean dualstackEnabled)
Configures the client to use Amazon S3 dualstack mode for all requests.
dualstackEnabled
- True to enable dualstack mode.public Subclass enableDualstack()
Enables dualstack mode on clients built with the builder.
public Boolean isForceGlobalBucketAccessEnabled()
AmazonS3Builder.setForceGlobalBucketAccessEnabled(Boolean)
public void setForceGlobalBucketAccessEnabled(Boolean forceGlobalBucketAccessEnabled)
Configure whether global bucket access is enabled for clients generated by this builder.
When global bucket access is enabled, the region to which a request is routed may differ from the region that
is configured in AwsClientBuilder.setRegion(String)
in order to make the request succeed.
The following behavior is currently used when this mode is enabled:
AmazonS3Client.createBucket(String)
)
will be routed to the region configured by AwsClientBuilder.setRegion(String)
, unless the region is manually overridden
with CreateBucketRequest.setRegion(String)
, in which case the request will be routed to the region
configured in the request.AmazonS3Client.putObject(PutObjectRequest)
) a request will be made to the region configured by
AwsClientBuilder.setRegion(String)
to determine the region in which the bucket was created. This location may be
cached in the client for subsequent requests acting on that same bucket.Enabling this mode has several drawbacks, because it has the potential to increase latency in the event that the location of the bucket is physically far from the location from which the request was invoked. For this reason, it is strongly advised when possible to know the location of your buckets and create a region-specific client to access that bucket.
forceGlobalBucketAccessEnabled
- Whether global bucket access should be enabled.public Subclass withForceGlobalBucketAccessEnabled(Boolean forceGlobalBucketAccessEnabled)
Configure whether global bucket access is enabled for clients generated by this builder.
forceGlobalBucketAccessEnabled
- Whether global bucket access should be enabled.AmazonS3Builder.setForceGlobalBucketAccessEnabled(Boolean)
public Subclass enableForceGlobalBucketAccess()
Enable global bucket access for clients generated by this builder.
AmazonS3Builder.setForceGlobalBucketAccessEnabled(Boolean)
protected S3ClientOptions resolveS3ClientOptions()
Enables us-east-1 regional mode on clients built with the builder.
Copyright © 2024. All rights reserved.