forked from aws/aws-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRestoreObjectRequest.java
More file actions
188 lines (171 loc) · 5.96 KB
/
RestoreObjectRequest.java
File metadata and controls
188 lines (171 loc) · 5.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/*
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.s3.model;
import com.amazonaws.AmazonWebServiceRequest;
/**
* <p>
* Request object containing all the options for restoring an object, which was transitioned to the Amazon Glacier
* from S3 when it was expired.
* </p>
* <p>
* All <code>RestoreObjectRequest</code> must specify a bucket name and key,
* along with expiration time.
* </p>
*
* @see RestoreObjectRequest#RestoreObjectRequest(String, String, int)
* @see RestoreObjectRequest#RestoreObjectRequest(String, String)
*/
public class RestoreObjectRequest extends AmazonWebServiceRequest {
/**
* The time, in days, between when an object is restored to the bucket and
* when it expires.
*/
private int expirationInDays;
/**
* The name of the bucket containing the reference to the object to restore
* which is now stored in Amazon Glacier.
*/
private String bucketName;
/**
* The key, the name of the reference to the object to restore, which is now
* stored in Amazon Glacier.
*/
private String key;
/**
* <p>
* Constructs a new RestoreObjectRequest.
* </p>
*
* @param bucketName
* The name of the bucket containing the reference to the object
* to restore which is now stored in Amazon Glacier.
* @param key
* The key, the name of the reference to the object to restore, which
* is now stored in Amazon Glacier.
*
* @see RestoreObjectRequest#RestoreObjectRequest(String, String, int)
*/
public RestoreObjectRequest(String bucketName, String key) {
this(bucketName, key, -1);
}
/**
* <p>
* Constructs a new RestoreObjectRequest.
* </p>
*
* @param bucketName
* The name of the bucket containing the reference to the object
* to restore which is now stored in Amazon Glacier.
* @param key
* The key, the name of the reference to the object to restore, which
* is now stored in Amazon Glacier.
* @param expirationInDays
* The time, in days, between when an object is restored to the
* bucket and when it expires
*
* @see RestoreObjectRequest#RestoreObjectRequest(String, String)
*/
public RestoreObjectRequest(String bucketName, String key, int expirationInDays) {
this.bucketName = bucketName;
this.key = key;
this.expirationInDays = expirationInDays;
}
/**
* Returns the name of the bucket containing the reference to the object to
* restore which is now stored in Amazon Glacier.
*
* @see RestoreObjectRequest#setBucketName(String)
* @see RestoreObjectRequest#withBucketName(String)
*/
public String getBucketName() {
return 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 RestoreObjectRequest#setBucketName(String)
* @see RestoreObjectRequest#getBucketName()
*/
public RestoreObjectRequest withBucketName(String bucketName) {
this.bucketName = bucketName;
return this;
}
/**
* Sets the name of the bucket containing the reference to the object to
* restore which is now stored in Amazon Glacier.
*
* @see RestoreObjectRequest#getBucketName()
* @see RestoreObjectRequest#withBucketName(String)
*/
public void setBucketName(String bucketName) {
this.bucketName = bucketName;
}
/**
* Gets the key, the name of the reference to the object to restore, which is
* now stored in Amazon Glacier.
*
* @see RestoreObjectRequest#setKey(String)
* @see RestoreObjectRequest#withKey(String)
*/
public String getKey() {
return key;
}
/**
* Sets the key, the name of the reference to the object to restore, which
* is now stored in Amazon Glacier.
*
* @see RestoreObjectRequest#getKey()
* @see RestoreObjectRequest#withKey(String)
*/
public void setKey(String key) {
this.key = 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 RestoreObjectRequest#getKey()
* @see RestoreObjectRequest#setKey(String)
*/
public RestoreObjectRequest withKey(String key) {
this.key = key;
return this;
}
/**
* Sets the time, in days, between when an object is uploaded to the bucket
* and when it expires.
*/
public void setExpirationInDays(int expirationInDays) {
this.expirationInDays = expirationInDays;
}
/**
* Returns the time in days from an object's creation to its expiration.
*/
public int getExpirationInDays() {
return 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.
*/
public RestoreObjectRequest withExpirationInDays(int expirationInDays) {
this.expirationInDays = expirationInDays;
return this;
}
}