Class RestoreObjectRequest
- java.lang.Object
-
- com.amazonaws.AmazonWebServiceRequest
-
- com.amazonaws.services.s3.model.RestoreObjectRequest
-
- All Implemented Interfaces:
ReadLimitInfo
,Serializable
,Cloneable
public class RestoreObjectRequest extends AmazonWebServiceRequest implements 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.
-
-
Field Summary
-
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
-
Constructor Summary
Constructors Constructor Description RestoreObjectRequest(String bucketName, String key)
Constructs a new RestoreObjectRequest.RestoreObjectRequest(String bucketName, String key, int expirationInDays)
Constructs a new RestoreObjectRequest.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.String
getKey()
Gets the key, the name of the reference to the object to restore, which is now stored in Amazon Glacier.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(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(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(String versionId)
Sets the id of the version to be restored.RestoreObjectRequest
withBucketName(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(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(String versionId)
Sets the id of the version to be restored and returns a reference to this object for method chaining.-
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
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
-
-
-
-
Constructor Detail
-
RestoreObjectRequest
public RestoreObjectRequest(String bucketName, String key)
Constructs a new RestoreObjectRequest.
- Parameters:
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.- See Also:
RestoreObjectRequest(String, String, int)
-
RestoreObjectRequest
public RestoreObjectRequest(String bucketName, String key, int expirationInDays)
Constructs a new RestoreObjectRequest.
- Parameters:
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 expires- See Also:
RestoreObjectRequest(String, String)
-
-
Method Detail
-
getBucketName
public String getBucketName()
Returns the name of the bucket containing the reference to the object to restore which is now stored in Amazon Glacier.- See Also:
setBucketName(String)
,withBucketName(String)
-
withBucketName
public RestoreObjectRequest withBucketName(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.- See Also:
setBucketName(String)
,getBucketName()
-
setBucketName
public void setBucketName(String bucketName)
Sets the name of the bucket containing the reference to the object to restore which is now stored in Amazon Glacier.- See Also:
getBucketName()
,withBucketName(String)
-
getKey
public String getKey()
Gets the key, the name of the reference to the object to restore, which is now stored in Amazon Glacier.- See Also:
setKey(String)
,withKey(String)
-
setKey
public void setKey(String key)
Sets the key, the name of the reference to the object to restore, which is now stored in Amazon Glacier.- See Also:
getKey()
,withKey(String)
-
withKey
public RestoreObjectRequest withKey(String key)
Sets the key, the name of the reference to the object to restore, which is now stored in Amazon Glacier. returns a reference to this object(RestoreObjectRequest) for method chaining.- See Also:
getKey()
,setKey(String)
-
getVersionId
public String getVersionId()
Returns the id of the version to be restored.
-
setVersionId
public void setVersionId(String versionId)
Sets the id of the version to be restored.
-
withVersionId
public RestoreObjectRequest withVersionId(String versionId)
Sets the id of the version to be restored and returns a reference to this object for method chaining.
-
setExpirationInDays
public void setExpirationInDays(int expirationInDays)
Sets the time, in days, between when an object is uploaded to the bucket and when it expires.
-
getExpirationInDays
public int getExpirationInDays()
Returns the time in days from an object's creation to its expiration.
-
withExpirationInDays
public 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.
-
isRequesterPays
public boolean isRequesterPays()
Returns true if the user has enabled Requester Pays option when conducting this operation from Requester Pays Bucket; else false.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
- Returns:
- true if the user has enabled Requester Pays option for conducting this operation from Requester Pays Bucket.
-
setRequesterPays
public void setRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket. If set the requester is charged for requests from the bucket.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.
- Parameters:
isRequesterPays
- Enable Requester Pays option for the operation.
-
withRequesterPays
public RestoreObjectRequest withRequesterPays(boolean isRequesterPays)
Used for conducting this operation from a Requester Pays Bucket. If set the requester is charged for requests from the bucket. It returns this updated RestoreObjectRequest object so that additional method calls can be chained together.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.
- Parameters:
isRequesterPays
- Enable Requester Pays option for the operation.- Returns:
- The updated RestoreObjectRequest object.
-
-