public class BucketVersioningConfiguration extends Object implements Serializable
A bucket's versioning configuration can be in one of three possible states:
By default, new buckets are in the
off
state. Once versioning is
enabled for a bucket the status can never be reverted to
off
.
The versioning configuration of a bucket has different implications for each operation performed on that bucket or for objects within that bucket. For instance, when versioning is enabled, a PutObject operation creates a unique object version-id for the object being uploaded. The PutObject API guarantees that, if versioning is enabled for a bucket at the time of the request, the new object can only be permanently deleted using the DeleteVersion operation. It can never be overwritten. Additionally, PutObject guarantees that, if versioning is enabled for a bucket the request, no other object will be overwritten by that request. Refer to the documentation sections for each API for information on how versioning status affects the semantics of that particular API.
OSS is eventually consistent. It may take time for the versioning status of a bucket to be propagated throughout the system.
OSS#getBucketVersioning(String)
,
OSS#setBucketVersioning(SetBucketVersioningRequest)
,
序列化表格限定符和类型 | 字段和说明 |
---|---|
static String |
ENABLED
OSS bucket versioning status indicating that versioning is enabled for a
bucket.
|
static String |
OFF
OSS bucket versioning status indicating that versioning is off for a
bucket.
|
static String |
SUSPENDED
OSS bucket versioning status indicating that versioning is suspended for a
bucket.
|
构造器和说明 |
---|
BucketVersioningConfiguration()
Creates a new bucket versioning configuration object which defaults to
OFF status. |
BucketVersioningConfiguration(String status)
Creates a new bucket versioning configuration object with the specified
status.
|
限定符和类型 | 方法和说明 |
---|---|
String |
getStatus()
Returns the current status of versioning for this bucket versioning
configuration object, indicating if versioning is enabled or not for a
bucket.
|
void |
setStatus(String status)
Sets the desired status of versioning for this bucket versioning
configuration object.
|
BucketVersioningConfiguration |
withStatus(String status)
Sets the desired status of versioning for this bucket versioning
configuration object, and returns this object so that additional method
calls may be chained together.
|
public static final String OFF
public static final String SUSPENDED
public BucketVersioningConfiguration()
OFF
status.public BucketVersioningConfiguration(String status)
public String getStatus()
public void setStatus(String status)
public BucketVersioningConfiguration withStatus(String status)
Copyright © 2019. All Rights Reserved.