public class SetBucketVersioningConfigurationRequest extends AmazonWebServiceRequest implements Serializable, ExpectedBucketOwnerRequest
Contains options for setting the versioning configuration for a bucket.
A bucket's versioning configuration can be in one of three possible states:
BucketVersioningConfiguration.OFF
BucketVersioningConfiguration.ENABLED
BucketVersioningConfiguration.SUSPENDED
By default, new buckets are created in the
BucketVersioningConfiguration.OFF
state. Once versioning is
enabled for a bucket, its status can never be reverted to
off
.
Objects created before versioning is enabled or while versioning is suspended
will be given the default null
version ID (see
Constants.NULL_VERSION_ID
). Note that the
null
version ID is a valid version ID and is not the same
as having no version ID.
The versioning configuration of a bucket has different implications for each
operation performed on that bucket or for objects within that bucket. When
versioning is enabled, a PutObject
operation creates a unique
object version ID for the object being uploaded. The PutObject
operation
guarantees that if versioning is enabled for a bucket at the time of the request, the
new object can only be permanently deleted by calling the DeleteVersion
operation
and can never be overwritten.
Additionally, the PutObject
operation guarantees that if
versioning is enabled for a bucket at the time of the request, no other object will be
overwritten by that request. Refer to the documentation sections for individual APIs
for information on how versioning status affects the semantics of that
particular API.
Amazon S3 is eventually consistent. It may take time for the versioning status of a bucket to be propagated throughout the system.
NOOP
Constructor and Description |
---|
SetBucketVersioningConfigurationRequest(String bucketName,
BucketVersioningConfiguration configuration)
Constructs a new
SetBucketVersioningConfigurationRequest
to set the bucket versioning configuration of
the specified bucket. |
SetBucketVersioningConfigurationRequest(String bucketName,
BucketVersioningConfiguration configuration,
MultiFactorAuthentication mfa)
Constructs a new
SetBucketVersioningConfigurationRequest
to set the bucket versioning configuration of
the specified bucket, including the specified Multi-Factor Authentication
(MFA) information, which is required when changing the state of the MFA
Delete option. |
Modifier and Type | Method and Description |
---|---|
String |
getBucketName()
Gets the name of the bucket whose versioning configuration is being
set.
|
String |
getExpectedBucketOwner()
Returns he account id of the expected bucket owner.
|
MultiFactorAuthentication |
getMfa()
Gets the optional Multi-Factor Authentication information included
with this request.
|
BucketVersioningConfiguration |
getVersioningConfiguration()
Gets the new versioning configuration for the specified bucket.
|
void |
setBucketName(String bucketName)
Sets the name of the bucket whose versioning configuration is being set.
|
void |
setExpectedBucketOwner(String expectedBucketOwner)
Set the account id of the expected bucket owner.
|
void |
setMfa(MultiFactorAuthentication mfa)
Sets the optional Multi-Factor Authentication information to include with
this request.
|
void |
setVersioningConfiguration(BucketVersioningConfiguration versioningConfiguration)
Sets the new versioning configuration for the specified bucket.
|
SetBucketVersioningConfigurationRequest |
withBucketName(String bucketName)
Sets the name of the bucket whose versioning configuration is being set,
and returns this object so that additional method calls may be chained
together.
|
SetBucketVersioningConfigurationRequest |
withExpectedBucketOwner(String expectedBucketOwner)
Set the account id of the expected bucket owner.
|
SetBucketVersioningConfigurationRequest |
withMfa(MultiFactorAuthentication mfa)
Sets the optional Multi-Factor Authentication information to include with
this request, and returns this object so that additional method calls may
be chained together.
|
SetBucketVersioningConfigurationRequest |
withVersioningConfiguration(BucketVersioningConfiguration versioningConfiguration)
Sets the new versioning configuration for the specified bucket and
returns this object, enabling additional method calls to be chained
together.
|
addHandlerContext, clone, copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getHandlerContext, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestCredentialsProvider, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
public SetBucketVersioningConfigurationRequest(String bucketName, BucketVersioningConfiguration configuration)
SetBucketVersioningConfigurationRequest
to set the bucket versioning configuration of
the specified bucket.bucketName
- The name of the bucket whose versioning configuration is being
set.configuration
- The new versioning configuration for the specified bucket.SetBucketVersioningConfigurationRequest(String, BucketVersioningConfiguration, MultiFactorAuthentication)
public SetBucketVersioningConfigurationRequest(String bucketName, BucketVersioningConfiguration configuration, MultiFactorAuthentication mfa)
SetBucketVersioningConfigurationRequest
to set the bucket versioning configuration of
the specified bucket, including the specified Multi-Factor Authentication
(MFA) information, which is required when changing the state of the MFA
Delete option.bucketName
- The name of the bucket whose versioning configuration is being
set.configuration
- The new versioning configuration for the specified bucket.mfa
- The Multi-Factor Authentication information to include in this
request.SetBucketVersioningConfigurationRequest(String, BucketVersioningConfiguration)
public String getExpectedBucketOwner()
ExpectedBucketOwnerRequest
403 (Access Denied)
error.getExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public SetBucketVersioningConfigurationRequest withExpectedBucketOwner(String expectedBucketOwner)
ExpectedBucketOwnerRequest
403 (Access Denied)
error.withExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public void setExpectedBucketOwner(String expectedBucketOwner)
ExpectedBucketOwnerRequest
403 (Access Denied)
error.setExpectedBucketOwner
in interface ExpectedBucketOwnerRequest
public String getBucketName()
setBucketName(String)
public void setBucketName(String bucketName)
bucketName
- The name of the bucket whose versioning configuration is being
set.getBucketName()
public SetBucketVersioningConfigurationRequest withBucketName(String bucketName)
bucketName
- The name of the bucket whose versioning configuration is being
set.SetBucketVersioningConfigurationRequest
object so that
additional method calls may be chained together.setBucketName(String)
public BucketVersioningConfiguration getVersioningConfiguration()
setVersioningConfiguration(BucketVersioningConfiguration)
,
withVersioningConfiguration(BucketVersioningConfiguration)
public void setVersioningConfiguration(BucketVersioningConfiguration versioningConfiguration)
versioningConfiguration
- The new versioning configuration for the specified bucket.getVersioningConfiguration()
,
withVersioningConfiguration(BucketVersioningConfiguration)
public SetBucketVersioningConfigurationRequest withVersioningConfiguration(BucketVersioningConfiguration versioningConfiguration)
versioningConfiguration
- The new versioning configuration for the specified bucket.SetBucketVersioningConfigurationRequest
object, enabling that
additional method calls may be chained together.getVersioningConfiguration()
,
getVersioningConfiguration()
public MultiFactorAuthentication getMfa()
Gets the optional Multi-Factor Authentication information included with this request.
Multi-Factor Authentication is required when enabling or disabling MFA Delete functionality for a bucket.
See BucketVersioningConfiguration.setMfaDeleteEnabled(Boolean)
for more information on MFADelete.
setMfa(MultiFactorAuthentication)
,
withMfa(MultiFactorAuthentication)
public void setMfa(MultiFactorAuthentication mfa)
Multi-Factor Authentication is required when enabling or disabling MFA delete functionality for a bucket.
See BucketVersioningConfiguration.setMfaDeleteEnabled(Boolean)
for more information on MFADelete.
mfa
- The optional Multi-Factor Authentication information to
include with this request.getMfa()
,
withMfa(MultiFactorAuthentication)
public SetBucketVersioningConfigurationRequest withMfa(MultiFactorAuthentication mfa)
Multi-Factor Authentication is required when enabling or disabling MFA delete functionality for a bucket.
See BucketVersioningConfiguration.setMfaDeleteEnabled(Boolean)
for more information on MFADelete.
mfa
- The optional Multi-Factor Authentication information to
include with this request.getMfa()
,
setMfa(MultiFactorAuthentication)
Copyright © 2023. All rights reserved.