public static class ObjectLifecycleRule.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ObjectLifecycleRule.Builder |
action(String action)
The action of the object lifecycle policy rule.
|
ObjectLifecycleRule |
build() |
ObjectLifecycleRule.Builder |
copy(ObjectLifecycleRule model) |
ObjectLifecycleRule.Builder |
isEnabled(Boolean isEnabled)
A Boolean that determines whether this rule is currently enabled.
|
ObjectLifecycleRule.Builder |
name(String name)
The name of the lifecycle rule to be applied.
|
ObjectLifecycleRule.Builder |
objectNameFilter(ObjectNameFilter objectNameFilter) |
ObjectLifecycleRule.Builder |
target(String target)
The target of the object lifecycle policy rule.
|
ObjectLifecycleRule.Builder |
timeAmount(Long timeAmount)
Specifies the age of objects to apply the rule to.
|
ObjectLifecycleRule.Builder |
timeUnit(ObjectLifecycleRule.TimeUnit timeUnit)
The unit that should be used to interpret timeAmount.
|
public ObjectLifecycleRule.Builder name(String name)
The name of the lifecycle rule to be applied.
name
- the value to setpublic ObjectLifecycleRule.Builder target(String target)
The target of the object lifecycle policy rule. The values of target can be either “objects”, “multipart-uploads” or “previous-object-versions”. This field when declared as “objects” is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for objects. This field when declared as “previous-object-versions” is used to specify ARCHIVE, INFREQUENT_ACCESS or DELETE rule for previous versions of existing objects. This field when declared as “multipart-uploads” is used to specify the ABORT (only) rule for uncommitted multipart-uploads.
target
- the value to setpublic ObjectLifecycleRule.Builder action(String action)
The action of the object lifecycle policy rule. Rules using the action ‘ARCHIVE’ move objects from Standard and InfrequentAccess storage tiers into the Archive storage tier. Rules using the action ‘INFREQUENT_ACCESS’ move objects from Standard storage tier into the Infrequent Access Storage tier. Objects that are already in InfrequentAccess tier or in Archive tier are left untouched. Rules using the action ‘DELETE’ permanently delete objects from buckets. Rules using ‘ABORT’ abort the uncommitted multipart-uploads and permanently delete their parts from buckets.
action
- the value to setpublic ObjectLifecycleRule.Builder timeAmount(Long timeAmount)
Specifies the age of objects to apply the rule to. The timeAmount is interpreted in units defined by the timeUnit parameter, and is calculated in relation to each object’s Last-Modified time.
timeAmount
- the value to setpublic ObjectLifecycleRule.Builder timeUnit(ObjectLifecycleRule.TimeUnit timeUnit)
The unit that should be used to interpret timeAmount. Days are defined as starting and ending at midnight UTC. Years are defined as 365.2425 days long and likewise round up to the next midnight UTC.
timeUnit
- the value to setpublic ObjectLifecycleRule.Builder isEnabled(Boolean isEnabled)
A Boolean that determines whether this rule is currently enabled.
isEnabled
- the value to setpublic ObjectLifecycleRule.Builder objectNameFilter(ObjectNameFilter objectNameFilter)
public ObjectLifecycleRule build()
public ObjectLifecycleRule.Builder copy(ObjectLifecycleRule model)
Copyright © 2016–2024. All rights reserved.