Class SetBucketVersioningConfigurationRequest
- java.lang.Object
-
- com.amazonaws.AmazonWebServiceRequest
-
- com.amazonaws.services.s3.model.SetBucketVersioningConfigurationRequest
-
- All Implemented Interfaces:
ReadLimitInfo
,Serializable
,Cloneable
public class SetBucketVersioningConfigurationRequest extends AmazonWebServiceRequest implements Serializable
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 tooff
.Objects created before versioning is enabled or while versioning is suspended will be given the default
null
version ID (seeConstants.NULL_VERSION_ID
). Note that thenull
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. ThePutObject
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 theDeleteVersion
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.
-
-
Field Summary
-
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
-
Constructor Summary
Constructors Constructor Description SetBucketVersioningConfigurationRequest(String bucketName, BucketVersioningConfiguration configuration)
Constructs a newSetBucketVersioningConfigurationRequest
to set the bucket versioning configuration of the specified bucket.SetBucketVersioningConfigurationRequest(String bucketName, BucketVersioningConfiguration configuration, MultiFactorAuthentication mfa)
Constructs a newSetBucketVersioningConfigurationRequest
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBucketName()
Gets the name of the bucket whose versioning configuration is being set.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
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
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.-
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
clone, copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
-
-
-
-
Constructor Detail
-
SetBucketVersioningConfigurationRequest
public SetBucketVersioningConfigurationRequest(String bucketName, BucketVersioningConfiguration configuration)
Constructs a newSetBucketVersioningConfigurationRequest
to set the bucket versioning configuration of the specified bucket.- Parameters:
bucketName
- The name of the bucket whose versioning configuration is being set.configuration
- The new versioning configuration for the specified bucket.- See Also:
SetBucketVersioningConfigurationRequest(String, BucketVersioningConfiguration, MultiFactorAuthentication)
-
SetBucketVersioningConfigurationRequest
public SetBucketVersioningConfigurationRequest(String bucketName, BucketVersioningConfiguration configuration, MultiFactorAuthentication mfa)
Constructs a newSetBucketVersioningConfigurationRequest
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.- Parameters:
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.- See Also:
SetBucketVersioningConfigurationRequest(String, BucketVersioningConfiguration)
-
-
Method Detail
-
getBucketName
public String getBucketName()
Gets the name of the bucket whose versioning configuration is being set.- Returns:
- The name of the bucket whose versioning configuration is being set.
- See Also:
setBucketName(String)
-
setBucketName
public void setBucketName(String bucketName)
Sets the name of the bucket whose versioning configuration is being set.- Parameters:
bucketName
- The name of the bucket whose versioning configuration is being set.- See Also:
getBucketName()
-
withBucketName
public 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.- Parameters:
bucketName
- The name of the bucket whose versioning configuration is being set.- Returns:
- This
SetBucketVersioningConfigurationRequest
object so that additional method calls may be chained together. - See Also:
setBucketName(String)
-
getVersioningConfiguration
public BucketVersioningConfiguration getVersioningConfiguration()
Gets the new versioning configuration for the specified bucket.- Returns:
- The new versioning configuration for the specified bucket.
- See Also:
setVersioningConfiguration(BucketVersioningConfiguration)
,withVersioningConfiguration(BucketVersioningConfiguration)
-
setVersioningConfiguration
public void setVersioningConfiguration(BucketVersioningConfiguration versioningConfiguration)
Sets the new versioning configuration for the specified bucket.- Parameters:
versioningConfiguration
- The new versioning configuration for the specified bucket.- See Also:
getVersioningConfiguration()
,withVersioningConfiguration(BucketVersioningConfiguration)
-
withVersioningConfiguration
public 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.- Parameters:
versioningConfiguration
- The new versioning configuration for the specified bucket.- Returns:
- This
SetBucketVersioningConfigurationRequest
object, enabling that additional method calls may be chained together. - See Also:
getVersioningConfiguration()
,getVersioningConfiguration()
-
getMfa
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.- Returns:
- The optional Multi-Factor Authentication information included with this request.
- See Also:
setMfa(MultiFactorAuthentication)
,withMfa(MultiFactorAuthentication)
-
setMfa
public void setMfa(MultiFactorAuthentication mfa)
Sets the optional Multi-Factor Authentication information to include 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.- Parameters:
mfa
- The optional Multi-Factor Authentication information to include with this request.- See Also:
getMfa()
,withMfa(MultiFactorAuthentication)
-
withMfa
public 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.Multi-Factor Authentication is required when enabling or disabling MFA delete functionality for a bucket.
See
BucketVersioningConfiguration.setMfaDeleteEnabled(Boolean)
for more information on MFADelete.- Parameters:
mfa
- The optional Multi-Factor Authentication information to include with this request.- Returns:
- The updated SetBucketVersioningConfigurationRequest object so that additional method calls may be chained together.
- See Also:
getMfa()
,setMfa(MultiFactorAuthentication)
-
-