Package com.amazonaws.services.s3.model
Class BucketLifecycleConfiguration.Rule
java.lang.Object
com.amazonaws.services.s3.model.BucketLifecycleConfiguration.Rule
- All Implemented Interfaces:
Serializable
- Enclosing class:
BucketLifecycleConfiguration
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddNoncurrentVersionTransition
(BucketLifecycleConfiguration.NoncurrentVersionTransition noncurrentVersionTransition) Adds a new Non current transition to the rule.addTransition
(BucketLifecycleConfiguration.Transition transition) Adds a new transition to the rule.Returns the expiration date of the object.int
Returns the time in days from an object's creation to its expiration.getId()
Returns the ID of this rule.int
Returns the time, in days, between when a new version of the object is uploaded to the bucket and when older versions of the object expire.Deprecated.Returns the Amazon S3 non current object transition rules associated with the given rule.Returns the key prefix for which this rule will apply.Returns the status of this rule.Deprecated.Returns the Amazon S3 object transition rules associated with the given rule.boolean
Returns whether the current expiration policy for the object is set to remove objects when only a delete marker is leftvoid
setAbortIncompleteMultipartUpload
(AbortIncompleteMultipartUpload abortIncompleteMultipartUpload) void
setExpirationDate
(Date expirationDate) Sets the expiration date of the object.void
setExpirationInDays
(int expirationInDays) Sets the time, in days, between when an object is uploaded to the bucket and when it expires.void
setExpiredObjectDeleteMarker
(boolean expiredObjectDeleteMarker) Sets the value of the ExpiredObjectDeleteMarkers attribute.void
Sets the ID of this rule.void
setNoncurrentVersionExpirationInDays
(int value) Sets the time, in days, between when a new version of the object is uploaded to the bucket and when older versions of the object expire.void
setNoncurrentVersionTransition
(BucketLifecycleConfiguration.NoncurrentVersionTransition nonCurrentVersionTransition) Deprecated.void
setNoncurrentVersionTransitions
(List<BucketLifecycleConfiguration.NoncurrentVersionTransition> noncurrentVersionTransitions) Sets the Amazon S3 non current object transition rules for the given bucket.void
Sets the key prefix for which this rule will apply.void
Sets the status of this rule.void
setTransition
(BucketLifecycleConfiguration.Transition transition) Deprecated.void
setTransitions
(List<BucketLifecycleConfiguration.Transition> transitions) Sets the Amazon S3 object transition rules for the given bucket.withAbortIncompleteMultipartUpload
(AbortIncompleteMultipartUpload abortIncompleteMultipartUpload) withExpirationDate
(Date expirationDate) Sets the expiration date of the object and returns a reference to this object(Rule) for method chaining.withExpirationInDays
(int expirationInDays) Sets the time, in days, between when an object is uploaded to the bucket and when it expires, and returns a reference to this object for method chaining.withExpiredObjectDeleteMarker
(boolean expiredObjectDeleteMarker) Fluent method for setting the value of the ExpiredObjectDeleteMarkers attributes.Sets the ID of this rule and returns a reference to this object for method chaining.withNoncurrentVersionExpirationInDays
(int value) Sets the time, in days, between when a new version of the object is uploaded to the bucket and when older versions of the object expire, and returns a reference to this object for method chaining.withNoncurrentVersionTransition
(BucketLifecycleConfiguration.NoncurrentVersionTransition nonCurrentVersionTransition) Deprecated.withNoncurrentVersionTransitions
(List<BucketLifecycleConfiguration.NoncurrentVersionTransition> noncurrentVersionTransitions) Sets the Amazon S3 non current object transition rules for the given bucket.withPrefix
(String prefix) Sets the key prefix for this rule and returns a reference to this object for method chaining.withStatus
(String status) Sets the status of this rule and returns a reference to this object for method chaining.Deprecated.withTransitions
(List<BucketLifecycleConfiguration.Transition> transitions) Sets the Amazon S3 object transition rules for the given bucket.
-
Constructor Details
-
Rule
public Rule()
-
-
Method Details
-
setId
Sets the ID of this rule. Rules must be less than 255 alphanumeric characters, and must be unique for a bucket. If you do not assign an ID, one will be generated. -
setPrefix
Sets the key prefix for which this rule will apply. -
setExpirationInDays
public void setExpirationInDays(int expirationInDays) Sets the time, in days, between when an object is uploaded to the bucket and when it expires. -
setNoncurrentVersionExpirationInDays
public void setNoncurrentVersionExpirationInDays(int value) Sets the time, in days, between when a new version of the object is uploaded to the bucket and when older versions of the object expire. -
getId
Returns the ID of this rule. -
withId
Sets the ID of this rule and returns a reference to this object for method chaining.- See Also:
-
getPrefix
Returns the key prefix for which this rule will apply. -
withPrefix
Sets the key prefix for this rule and returns a reference to this object for method chaining.- See Also:
-
getExpirationInDays
public int getExpirationInDays()Returns the time in days from an object's creation to its expiration. -
withExpirationInDays
Sets the time, in days, between when an object is uploaded to the bucket and when it expires, and returns a reference to this object for method chaining.- See Also:
-
getNoncurrentVersionExpirationInDays
public int getNoncurrentVersionExpirationInDays()Returns the time, in days, between when a new version of the object is uploaded to the bucket and when older versions of the object expire. -
withNoncurrentVersionExpirationInDays
Sets the time, in days, between when a new version of the object is uploaded to the bucket and when older versions of the object expire, and returns a reference to this object for method chaining. -
getStatus
Returns the status of this rule.- See Also:
-
setStatus
Sets the status of this rule.- See Also:
-
withStatus
Sets the status of this rule and returns a reference to this object for method chaining.- See Also:
-
setExpirationDate
Sets the expiration date of the object. -
getExpirationDate
Returns the expiration date of the object. -
withExpirationDate
Sets the expiration date of the object and returns a reference to this object(Rule) for method chaining. -
setTransition
Deprecated.Sets the transition describing how this object will move between different storage classes in Amazon S3. Bucket Life cycle configuration can now accept multiple transitions in a rule. Note : This method overwrites all the existing transitions with given transition. @Deprecated in favor ofsetTransitions(List)
-
getTransition
Deprecated.Returns the transition associated with the rule. If there are more than one transition associated with a given rule, this method returns the last transition rule. -
withTransition
@Deprecated public BucketLifecycleConfiguration.Rule withTransition(BucketLifecycleConfiguration.Transition transition) Deprecated.Sets the transition describing how this object will move between different storage classes in Amazon S3. Bucket Life cycle configuration can now accept multiple transitions in a rule. -
setNoncurrentVersionTransition
@Deprecated public void setNoncurrentVersionTransition(BucketLifecycleConfiguration.NoncurrentVersionTransition nonCurrentVersionTransition) Deprecated.Sets the transition describing how non-current versions of objects will move between different storage classes in Amazon S3. Bucket Life cycle configuration can now accept multiple non current transitions in a rule. Note: This method overwrites all the existing transitions with given transition. @Deprecated in favor ofsetNoncurrentVersionTransitions(List)
-
getNoncurrentVersionTransition
@Deprecated public BucketLifecycleConfiguration.NoncurrentVersionTransition getNoncurrentVersionTransition()Deprecated.Returns the non-current transition associated with the life cycle configuration rule. If there are more than one transitions associated with a rule, this method returns the last transition in the rule. @Deprecated in favor ofgetNoncurrentVersionTransitions()
-
withNoncurrentVersionTransition
@Deprecated public BucketLifecycleConfiguration.Rule withNoncurrentVersionTransition(BucketLifecycleConfiguration.NoncurrentVersionTransition nonCurrentVersionTransition) Deprecated.Sets the transition describing how non-current versions of objects will move between different storage classes in Amazon S3. Bucket Life cycle configuration can now accept multiple non current transitions in a rule. @Deprecated in favor ofwithNoncurrentVersionTransitions(List)
Returns a updated reference of this object. -
getTransitions
Returns the Amazon S3 object transition rules associated with the given rule. -
setTransitions
Sets the Amazon S3 object transition rules for the given bucket. -
withTransitions
public BucketLifecycleConfiguration.Rule withTransitions(List<BucketLifecycleConfiguration.Transition> transitions) Sets the Amazon S3 object transition rules for the given bucket. Returns an updated version of this object. -
addTransition
public BucketLifecycleConfiguration.Rule addTransition(BucketLifecycleConfiguration.Transition transition) Adds a new transition to the rule. -
getNoncurrentVersionTransitions
public List<BucketLifecycleConfiguration.NoncurrentVersionTransition> getNoncurrentVersionTransitions()Returns the Amazon S3 non current object transition rules associated with the given rule. -
setNoncurrentVersionTransitions
public void setNoncurrentVersionTransitions(List<BucketLifecycleConfiguration.NoncurrentVersionTransition> noncurrentVersionTransitions) Sets the Amazon S3 non current object transition rules for the given bucket. -
withNoncurrentVersionTransitions
public BucketLifecycleConfiguration.Rule withNoncurrentVersionTransitions(List<BucketLifecycleConfiguration.NoncurrentVersionTransition> noncurrentVersionTransitions) Sets the Amazon S3 non current object transition rules for the given bucket. Returns an updated version of this object. -
addNoncurrentVersionTransition
public BucketLifecycleConfiguration.Rule addNoncurrentVersionTransition(BucketLifecycleConfiguration.NoncurrentVersionTransition noncurrentVersionTransition) Adds a new Non current transition to the rule. -
getAbortIncompleteMultipartUpload
-
setAbortIncompleteMultipartUpload
public void setAbortIncompleteMultipartUpload(AbortIncompleteMultipartUpload abortIncompleteMultipartUpload) -
withAbortIncompleteMultipartUpload
public BucketLifecycleConfiguration.Rule withAbortIncompleteMultipartUpload(AbortIncompleteMultipartUpload abortIncompleteMultipartUpload) -
isExpiredObjectDeleteMarker
public boolean isExpiredObjectDeleteMarker()Returns whether the current expiration policy for the object is set to remove objects when only a delete marker is leftIf set to true the lifecycle policy will delete the current version of an object if and only if the current version is a expired object delete marker. This option only makes sense to use for versioned buckets and cannot be used in conjunction with expirationInDays or expirationDate. Note that the current version can only be removed if all non-current versions have been removed (either through a non-current version expiration policy or being explicitly deleted)
- Returns:
- True if this lifecycle's configuration is configured to delete the current version of an object if it's the only version left and it's a delete marker. False otherwise
-
setExpiredObjectDeleteMarker
public void setExpiredObjectDeleteMarker(boolean expiredObjectDeleteMarker) Sets the value of the ExpiredObjectDeleteMarkers attribute.- Parameters:
expiredObjectDeleteMarker
- True to allow the current expiration policy to remove the current version of the object if it's the only version left and it's a delete marker. False has no effect on the current expiration policy
-
withExpiredObjectDeleteMarker
public BucketLifecycleConfiguration.Rule withExpiredObjectDeleteMarker(boolean expiredObjectDeleteMarker) Fluent method for setting the value of the ExpiredObjectDeleteMarkers attributes. SeesetExpiredObjectDeleteMarker(boolean)
- Parameters:
expiredObjectDeleteMarker
-- Returns:
- This object for method chaining
-