public class RestoreObjectRequest extends AmazonWebServiceRequest implements java.io.Serializable
Request object containing all the options for restoring an object, which was transitioned to the Amazon Glacier from S3 when it was expired.
All RestoreObjectRequest
must specify a bucket name and key,
along with expiration time.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
bucketName
The name of the bucket containing the reference to the object to restore
which is now stored in Amazon Glacier.
|
private int |
expirationInDays
The time, in days, between when an object is restored to the bucket and
when it expires.
|
private boolean |
isRequesterPays
If enabled, the requester is charged for conducting this operation from
Requester Pays Buckets.
|
private java.lang.String |
key
The key, the name of the reference to the object to restore, which is now
stored in Amazon Glacier.
|
private java.lang.String |
versionId
Optional version ID specifying which version of the object to restore.
|
NOOP
Constructor and Description |
---|
RestoreObjectRequest(java.lang.String bucketName,
java.lang.String key)
Constructs a new RestoreObjectRequest.
|
RestoreObjectRequest(java.lang.String bucketName,
java.lang.String key,
int expirationInDays)
Constructs a new RestoreObjectRequest.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getBucketName()
Returns the name of the bucket containing the reference to the object to
restore which is now stored in Amazon Glacier.
|
int |
getExpirationInDays()
Returns the time in days from an object's creation to its expiration.
|
java.lang.String |
getKey()
Gets the key, the name of the reference to the object to restore, which is
now stored in Amazon Glacier.
|
java.lang.String |
getVersionId()
Returns the id of the version to be restored.
|
boolean |
isRequesterPays()
Returns true if the user has enabled Requester Pays option when
conducting this operation from Requester Pays Bucket; else false.
|
void |
setBucketName(java.lang.String bucketName)
Sets the name of the bucket containing the reference to the object to
restore which is now stored in Amazon Glacier.
|
void |
setExpirationInDays(int expirationInDays)
Sets the time, in days, between when an object is uploaded to the bucket
and when it expires.
|
void |
setKey(java.lang.String key)
Sets the key, the name of the reference to the object to restore, which
is now stored in Amazon Glacier.
|
void |
setRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.
|
void |
setVersionId(java.lang.String versionId)
Sets the id of the version to be restored.
|
RestoreObjectRequest |
withBucketName(java.lang.String bucketName)
Sets the name of the bucket containing the reference to the object to
restore which is now stored in Amazon Glacier, and returns a reference
to this object(RestoreObjectRequest) for method chaining.
|
RestoreObjectRequest |
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(RestoreObjectRequest) for method
chaining.
|
RestoreObjectRequest |
withKey(java.lang.String key)
Sets the key, the name of the reference to the object to restore, which
is now stored in Amazon Glacier.
|
RestoreObjectRequest |
withRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket.
|
RestoreObjectRequest |
withVersionId(java.lang.String versionId)
Sets the id of the version to be restored and returns a reference to
this object for method chaining.
|
clone, copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
private int expirationInDays
private java.lang.String bucketName
private java.lang.String key
private java.lang.String versionId
For more information about enabling versioning for a bucket, see
AmazonS3#setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest)
.
For more information about enabling lifecycle versioning for a bucket,
see AmazonS3#setBucketLifecycleConfiguration(SetBucketLifecycleConfigurationRequest)
.
private boolean isRequesterPays
public RestoreObjectRequest(java.lang.String bucketName, java.lang.String key)
Constructs a new RestoreObjectRequest.
bucketName
- The name of the bucket containing the reference to the object
to restore which is now stored in Amazon Glacier.key
- The key, the name of the reference to the object to restore, which
is now stored in Amazon Glacier.RestoreObjectRequest(String, String, int)
public RestoreObjectRequest(java.lang.String bucketName, java.lang.String key, int expirationInDays)
Constructs a new RestoreObjectRequest.
bucketName
- The name of the bucket containing the reference to the object
to restore which is now stored in Amazon Glacier.key
- The key, the name of the reference to the object to restore, which
is now stored in Amazon Glacier.expirationInDays
- The time, in days, between when an object is restored to the
bucket and when it expiresRestoreObjectRequest(String, String)
public java.lang.String getBucketName()
setBucketName(String)
,
withBucketName(String)
public RestoreObjectRequest withBucketName(java.lang.String bucketName)
setBucketName(String)
,
getBucketName()
public void setBucketName(java.lang.String bucketName)
getBucketName()
,
withBucketName(String)
public java.lang.String getKey()
setKey(String)
,
withKey(String)
public void setKey(java.lang.String key)
getKey()
,
withKey(String)
public RestoreObjectRequest withKey(java.lang.String key)
getKey()
,
setKey(String)
public java.lang.String getVersionId()
public void setVersionId(java.lang.String versionId)
public RestoreObjectRequest withVersionId(java.lang.String versionId)
public void setExpirationInDays(int expirationInDays)
public int getExpirationInDays()
public RestoreObjectRequest withExpirationInDays(int expirationInDays)
public boolean isRequesterPays()
If a bucket is enabled for Requester Pays, then any attempt to upload or download an object from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.
Enabling Requester Pays disables the ability to have anonymous access to this bucket
public void setRequesterPays(boolean isRequesterPays)
If a bucket is enabled for Requester Pays, then any attempt to upload or download an object from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.
Enabling Requester Pays disables the ability to have anonymous access to this bucket.
isRequesterPays
- Enable Requester Pays option for the operation.public RestoreObjectRequest withRequesterPays(boolean isRequesterPays)
If a bucket is enabled for Requester Pays, then any attempt to upload or download an object from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.
Enabling Requester Pays disables the ability to have anonymous access to this bucket.
isRequesterPays
- Enable Requester Pays option for the operation.