public static class BucketLifecycleConfiguration.Rule
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private AbortIncompleteMultipartUpload |
abortIncompleteMultipartUpload
Specifies the days since the initiation of an Incomplete Multipart Upload that Lifecycle will wait before permanently removing all parts of the upload.
|
private java.util.Date |
expirationDate
The expiration date of the object and should not coexist with expirationInDays within
one lifecycle rule.
|
private int |
expirationInDays
The time, in days, between when the object is uploaded to the bucket
and when it expires.
|
private boolean |
expiredObjectDeleteMarker |
private java.lang.String |
id |
private int |
noncurrentVersionExpirationInDays
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.
|
private java.util.List<BucketLifecycleConfiguration.NoncurrentVersionTransition> |
noncurrentVersionTransitions
Transition rules for the non current objects in the bucket.
|
private java.lang.String |
prefix |
private java.lang.String |
status |
private java.util.List<BucketLifecycleConfiguration.Transition> |
transitions
Transition rules for the objects in the bucket.
|
Constructor and Description |
---|
Rule() |
Modifier and Type | Method and 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() |
java.util.Date |
getExpirationDate()
Returns the expiration date of the object.
|
int |
getExpirationInDays()
Returns the time in days from an object's creation to its expiration.
|
java.lang.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.
|
java.util.List<BucketLifecycleConfiguration.NoncurrentVersionTransition> |
getNoncurrentVersionTransitions()
Returns the Amazon S3 non current object transition rules associated
with the given rule.
|
java.lang.String |
getPrefix()
Returns the key prefix for which this rule will apply.
|
java.lang.String |
getStatus()
Returns the status of this rule.
|
BucketLifecycleConfiguration.Transition |
getTransition()
Deprecated.
|
java.util.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 left
|
void |
setAbortIncompleteMultipartUpload(AbortIncompleteMultipartUpload abortIncompleteMultipartUpload) |
void |
setExpirationDate(java.util.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(java.lang.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(java.util.List<BucketLifecycleConfiguration.NoncurrentVersionTransition> noncurrentVersionTransitions)
Sets the Amazon S3 non current object transition rules for the given bucket.
|
void |
setPrefix(java.lang.String prefix)
Sets the key prefix for which this rule will apply.
|
void |
setStatus(java.lang.String status)
Sets the status of this rule.
|
void |
setTransition(BucketLifecycleConfiguration.Transition transition)
Deprecated.
|
void |
setTransitions(java.util.List<BucketLifecycleConfiguration.Transition> transitions)
Sets the Amazon S3 object transition rules for the given bucket.
|
BucketLifecycleConfiguration.Rule |
withAbortIncompleteMultipartUpload(AbortIncompleteMultipartUpload abortIncompleteMultipartUpload) |
BucketLifecycleConfiguration.Rule |
withExpirationDate(java.util.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(java.lang.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(java.util.List<BucketLifecycleConfiguration.NoncurrentVersionTransition> noncurrentVersionTransitions)
Sets the Amazon S3 non current object transition rules for the given bucket.
|
BucketLifecycleConfiguration.Rule |
withPrefix(java.lang.String prefix)
Sets the key prefix for this rule and returns a reference to this
object for method chaining.
|
BucketLifecycleConfiguration.Rule |
withStatus(java.lang.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(java.util.List<BucketLifecycleConfiguration.Transition> transitions)
Sets the Amazon S3 object transition rules for the given bucket.
|
private java.lang.String id
private java.lang.String prefix
private java.lang.String status
private int expirationInDays
private boolean expiredObjectDeleteMarker
private int noncurrentVersionExpirationInDays
private java.util.Date expirationDate
private java.util.List<BucketLifecycleConfiguration.Transition> transitions
private java.util.List<BucketLifecycleConfiguration.NoncurrentVersionTransition> noncurrentVersionTransitions
private AbortIncompleteMultipartUpload abortIncompleteMultipartUpload
public void setId(java.lang.String id)
public void setPrefix(java.lang.String prefix)
public void setExpirationInDays(int expirationInDays)
public void setNoncurrentVersionExpirationInDays(int value)
public java.lang.String getId()
public BucketLifecycleConfiguration.Rule withId(java.lang.String id)
setId(String)
public java.lang.String getPrefix()
public BucketLifecycleConfiguration.Rule withPrefix(java.lang.String prefix)
setPrefix(String)
public int getExpirationInDays()
public BucketLifecycleConfiguration.Rule withExpirationInDays(int expirationInDays)
setExpirationInDays(int)
public int getNoncurrentVersionExpirationInDays()
public BucketLifecycleConfiguration.Rule withNoncurrentVersionExpirationInDays(int value)
public java.lang.String getStatus()
public void setStatus(java.lang.String status)
public BucketLifecycleConfiguration.Rule withStatus(java.lang.String status)
public void setExpirationDate(java.util.Date expirationDate)
public java.util.Date getExpirationDate()
public BucketLifecycleConfiguration.Rule withExpirationDate(java.util.Date expirationDate)
@Deprecated public void setTransition(BucketLifecycleConfiguration.Transition transition)
setTransitions(List)
@Deprecated public BucketLifecycleConfiguration.Transition getTransition()
@Deprecated public BucketLifecycleConfiguration.Rule withTransition(BucketLifecycleConfiguration.Transition transition)
@Deprecated public void setNoncurrentVersionTransition(BucketLifecycleConfiguration.NoncurrentVersionTransition nonCurrentVersionTransition)
setNoncurrentVersionTransitions(List)
@Deprecated public BucketLifecycleConfiguration.NoncurrentVersionTransition getNoncurrentVersionTransition()
getNoncurrentVersionTransitions()
@Deprecated public BucketLifecycleConfiguration.Rule withNoncurrentVersionTransition(BucketLifecycleConfiguration.NoncurrentVersionTransition nonCurrentVersionTransition)
withNoncurrentVersionTransitions(List)
Returns a updated reference of this object.public java.util.List<BucketLifecycleConfiguration.Transition> getTransitions()
public void setTransitions(java.util.List<BucketLifecycleConfiguration.Transition> transitions)
public BucketLifecycleConfiguration.Rule withTransitions(java.util.List<BucketLifecycleConfiguration.Transition> transitions)
public BucketLifecycleConfiguration.Rule addTransition(BucketLifecycleConfiguration.Transition transition)
public java.util.List<BucketLifecycleConfiguration.NoncurrentVersionTransition> getNoncurrentVersionTransitions()
public void setNoncurrentVersionTransitions(java.util.List<BucketLifecycleConfiguration.NoncurrentVersionTransition> noncurrentVersionTransitions)
public BucketLifecycleConfiguration.Rule withNoncurrentVersionTransitions(java.util.List<BucketLifecycleConfiguration.NoncurrentVersionTransition> noncurrentVersionTransitions)
public BucketLifecycleConfiguration.Rule addNoncurrentVersionTransition(BucketLifecycleConfiguration.NoncurrentVersionTransition noncurrentVersionTransition)
public AbortIncompleteMultipartUpload getAbortIncompleteMultipartUpload()
public void setAbortIncompleteMultipartUpload(AbortIncompleteMultipartUpload abortIncompleteMultipartUpload)
public BucketLifecycleConfiguration.Rule withAbortIncompleteMultipartUpload(AbortIncompleteMultipartUpload abortIncompleteMultipartUpload)
public boolean isExpiredObjectDeleteMarker()
If 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)
public void setExpiredObjectDeleteMarker(boolean expiredObjectDeleteMarker)
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 policypublic BucketLifecycleConfiguration.Rule withExpiredObjectDeleteMarker(boolean expiredObjectDeleteMarker)
setExpiredObjectDeleteMarker(boolean)
expiredObjectDeleteMarker
-