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
public static class BucketLifecycleConfiguration.Rule extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Rule()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BucketLifecycleConfiguration.Rule
addNoncurrentVersionTransition(BucketLifecycleConfiguration.NoncurrentVersionTransition noncurrentVersionTransition)
Adds a new Non current transition to the rule.BucketLifecycleConfiguration.Rule
addTransition(BucketLifecycleConfiguration.Transition transition)
Adds a new transition to the rule.AbortIncompleteMultipartUpload
getAbortIncompleteMultipartUpload()
Date
getExpirationDate()
Returns the expiration date of the object.int
getExpirationInDays()
Returns the time in days from an object's creation to its expiration.String
getId()
Returns the ID of this rule.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.BucketLifecycleConfiguration.NoncurrentVersionTransition
getNoncurrentVersionTransition()
Deprecated.List<BucketLifecycleConfiguration.NoncurrentVersionTransition>
getNoncurrentVersionTransitions()
Returns the Amazon S3 non current object transition rules associated with the given rule.String
getPrefix()
Returns the key prefix for which this rule will apply.String
getStatus()
Returns the status of this rule.BucketLifecycleConfiguration.Transition
getTransition()
Deprecated.List<BucketLifecycleConfiguration.Transition>
getTransitions()
Returns the Amazon S3 object transition rules associated with the given rule.boolean
isExpiredObjectDeleteMarker()
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
setId(String id)
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
setPrefix(String prefix)
Sets the key prefix for which this rule will apply.void
setStatus(String status)
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.BucketLifecycleConfiguration.Rule
withAbortIncompleteMultipartUpload(AbortIncompleteMultipartUpload abortIncompleteMultipartUpload)
BucketLifecycleConfiguration.Rule
withExpirationDate(Date expirationDate)
Sets the expiration date of the object and returns a reference to this object(Rule) for method chaining.BucketLifecycleConfiguration.Rule
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.BucketLifecycleConfiguration.Rule
withExpiredObjectDeleteMarker(boolean expiredObjectDeleteMarker)
Fluent method for setting the value of the ExpiredObjectDeleteMarkers attributes.BucketLifecycleConfiguration.Rule
withId(String id)
Sets the ID of this rule and returns a reference to this object for method chaining.BucketLifecycleConfiguration.Rule
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.BucketLifecycleConfiguration.Rule
withNoncurrentVersionTransition(BucketLifecycleConfiguration.NoncurrentVersionTransition nonCurrentVersionTransition)
Deprecated.BucketLifecycleConfiguration.Rule
withNoncurrentVersionTransitions(List<BucketLifecycleConfiguration.NoncurrentVersionTransition> noncurrentVersionTransitions)
Sets the Amazon S3 non current object transition rules for the given bucket.BucketLifecycleConfiguration.Rule
withPrefix(String prefix)
Sets the key prefix for this rule and returns a reference to this object for method chaining.BucketLifecycleConfiguration.Rule
withStatus(String status)
Sets the status of this rule and returns a reference to this object for method chaining.BucketLifecycleConfiguration.Rule
withTransition(BucketLifecycleConfiguration.Transition transition)
Deprecated.BucketLifecycleConfiguration.Rule
withTransitions(List<BucketLifecycleConfiguration.Transition> transitions)
Sets the Amazon S3 object transition rules for the given bucket.
-
-
-
Method Detail
-
setId
public void setId(String id)
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
public void setPrefix(String prefix)
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
public String getId()
Returns the ID of this rule.
-
withId
public BucketLifecycleConfiguration.Rule withId(String id)
Sets the ID of this rule and returns a reference to this object for method chaining.- See Also:
setId(String)
-
getPrefix
public String getPrefix()
Returns the key prefix for which this rule will apply.
-
withPrefix
public BucketLifecycleConfiguration.Rule withPrefix(String prefix)
Sets the key prefix for this rule and returns a reference to this object for method chaining.- See Also:
setPrefix(String)
-
getExpirationInDays
public int getExpirationInDays()
Returns the time in days from an object's creation to its expiration.
-
withExpirationInDays
public BucketLifecycleConfiguration.Rule 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.- See Also:
setExpirationInDays(int)
-
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
public BucketLifecycleConfiguration.Rule 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.
-
getStatus
public String getStatus()
Returns the status of this rule.
-
setStatus
public void setStatus(String status)
Sets the status of this rule.
-
withStatus
public BucketLifecycleConfiguration.Rule withStatus(String status)
Sets the status of this rule and returns a reference to this object for method chaining.
-
setExpirationDate
public void setExpirationDate(Date expirationDate)
Sets the expiration date of the object.
-
getExpirationDate
public Date getExpirationDate()
Returns the expiration date of the object.
-
withExpirationDate
public BucketLifecycleConfiguration.Rule withExpirationDate(Date expirationDate)
Sets the expiration date of the object and returns a reference to this object(Rule) for method chaining.
-
setTransition
@Deprecated public void setTransition(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. Note : This method overwrites all the existing transitions with given transition. @Deprecated in favor ofsetTransitions(List)
-
getTransition
@Deprecated public BucketLifecycleConfiguration.Transition 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
public List<BucketLifecycleConfiguration.Transition> getTransitions()
Returns the Amazon S3 object transition rules associated with the given rule.
-
setTransitions
public void setTransitions(List<BucketLifecycleConfiguration.Transition> transitions)
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
public AbortIncompleteMultipartUpload 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
-
-