Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.s3.model;
 

Contains options for setting the versioning configuration for a bucket.

A bucket's versioning configuration can be in one of three possible states:

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 com.amazonaws.services.s3.internal.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.

 
 public class SetBucketVersioningConfigurationRequest extends AmazonWebServiceRequest {
    
    
The bucket whose versioning configuration is being set.
 
     private String bucketName;

    
The new versioning configuration for the specified bucket.
 
     private BucketVersioningConfiguration versioningConfiguration;
    
    
The optional Multi-Factor Authentication information to include with this request. Multi-Factor Authentication is required when enabling or disabling the MFA Delete option. See BucketVersioningConfiguration for more details on MFA Delete.
 
     private MultiFactorAuthentication mfa;
    
    
Constructs a new SetBucketVersioningConfigurationRequest 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.SetBucketVersioningConfigurationRequest(java.lang.String,com.amazonaws.services.s3.model.BucketVersioningConfiguration,com.amazonaws.services.s3.model.MultiFactorAuthentication)
            String bucketNameBucketVersioningConfiguration configuration) {
        this. = bucketName;
        this. = configuration;
    }

    
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.

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.SetBucketVersioningConfigurationRequest(java.lang.String,com.amazonaws.services.s3.model.BucketVersioningConfiguration)
            String bucketNameBucketVersioningConfiguration configuration
            MultiFactorAuthentication mfa) {
        this(bucketNameconfiguration);
        this. = mfa;
    }

    
    
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(java.lang.String)
    public String getBucketName() {
        return ;
    }

    
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()
    public void setBucketName(String bucketName) {
        this. = 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(java.lang.String)
        setBucketName(bucketName);
        return this;
    }

    
Gets the new versioning configuration for the specified bucket.

        return ;
    }

    
Sets the new versioning configuration for the specified bucket.

Parameters:
versioningConfiguration The new versioning configuration for the specified bucket.
See also:
getVersioningConfiguration()
withVersioningConfiguration(com.amazonaws.services.s3.model.BucketVersioningConfiguration)
    public void setVersioningConfiguration(
            BucketVersioningConfiguration versioningConfiguration) {
        this. = 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()
            BucketVersioningConfiguration versioningConfiguration) {
        setVersioningConfiguration(versioningConfiguration);
        return this;
    }

    

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(java.lang.Boolean) for more information on MFADelete.

Returns:
The optional Multi-Factor Authentication information included with this request.
See also:
setMfa(com.amazonaws.services.s3.model.MultiFactorAuthentication)
withMfa(com.amazonaws.services.s3.model.MultiFactorAuthentication)
    public MultiFactorAuthentication getMfa() {
        return ;
    }

    
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(java.lang.Boolean) for more information on MFADelete.

Parameters:
mfa The optional Multi-Factor Authentication information to include with this request.
See also:
getMfa()
withMfa(com.amazonaws.services.s3.model.MultiFactorAuthentication)
    public void setMfa(MultiFactorAuthentication mfa) {
        this. = 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(java.lang.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(com.amazonaws.services.s3.model.MultiFactorAuthentication)
        setMfa(mfa);
        return this;
    }
New to GrepCode? Check out our FAQ X