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.

See Also:
  • Constructor Details

    • 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

      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:
  • Method Details

    • 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:
    • 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

      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:
    • 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

      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:
    • 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:
    • 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.