-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathBackup.java
More file actions
206 lines (168 loc) · 5.58 KB
/
Copy pathBackup.java
File metadata and controls
206 lines (168 loc) · 5.58 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
//Licensed to the Apache Software Foundation (ASF) under one
//or more contributor license agreements. See the NOTICE file
//distributed with this work for additional information
//regarding copyright ownership. The ASF licenses this file
//to you under the Apache License, Version 2.0 (the
//"License"); you may not use this file except in compliance
//the License. You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing,
//software distributed under the License 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 org.apache.cloudstack.backup;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import org.apache.commons.lang3.StringUtils;
import com.cloud.storage.Volume;
public interface Backup extends ControlledEntity, InternalIdentity, Identity {
enum Status {
Allocated, Queued, BackingUp, BackedUp, Error, Failed, Restoring, Removed, Expunged,
// Hidden: a chain backup kept as a tombstone after the user deleted it while it still has
// live descendants (incremental chains). Excluded from listBackups and from all backup
// operations (which require BackedUp); swept from the DB once its last descendant is gone.
Hidden
}
class Metric {
private Long backupSize = 0L;
private Long dataSize = 0L;
public Metric(final Long backupSize, final Long dataSize) {
this.backupSize = backupSize;
this.dataSize = dataSize;
}
public Long getBackupSize() {
return backupSize;
}
public Long getDataSize() {
return dataSize;
}
public void setBackupSize(Long backupSize) {
this.backupSize = backupSize;
}
public void setDataSize(Long dataSize) {
this.dataSize = dataSize;
}
}
class RestorePoint {
private String id;
private Date created;
private String type;
private Long backupSize = 0L;
private Long dataSize = 0L;
public RestorePoint(String id, Date created, String type) {
this.id = id;
this.created = created;
this.type = type;
}
public RestorePoint(String id, Date created, String type, Long backupSize, Long dataSize) {
this(id, created, type);
this.backupSize = backupSize;
this.dataSize = dataSize;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Date getCreated() {
return this.created;
}
public void setCreated(Date created) {
this.created = created;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Long getBackupSize() {
return backupSize;
}
public void setBackupSize(Long backupSize) {
this.backupSize = backupSize;
}
public Long getDataSize() {
return dataSize;
}
public void setDataSize(Long dataSize) {
this.dataSize = dataSize;
}
}
class VolumeInfo {
private String uuid;
private Volume.Type type;
private Long size;
private String path;
private Long deviceId;
private String diskOfferingId;
private Long minIops;
private Long maxIops;
public VolumeInfo(String uuid, String path, Volume.Type type, Long size, Long deviceId, String diskOfferingId, Long minIops, Long maxIops) {
this.uuid = uuid;
this.type = type;
this.size = size;
this.path = path;
this.deviceId = deviceId;
this.diskOfferingId = diskOfferingId;
this.minIops = minIops;
this.maxIops = maxIops;
}
public String getUuid() {
return uuid;
}
public Volume.Type getType() {
return type;
}
public void setType(Volume.Type type) {
this.type = type;
}
public String getPath() {
return path;
}
public Long getSize() {
return size;
}
public Long getDeviceId() {
return deviceId;
}
public String getDiskOfferingId() {
return diskOfferingId;
}
public Long getMinIops() {
return minIops;
}
public Long getMaxIops() {
return maxIops;
}
@Override
public String toString() {
return StringUtils.join(":", uuid, path, type, size, deviceId, diskOfferingId, minIops, maxIops);
}
}
Long getVmId();
long getBackupOfferingId();
String getExternalId();
String getType();
Date getDate();
Backup.Status getStatus();
Long getSize();
Long getProtectedSize();
void setName(String name);
String getDescription();
void setDescription(String description);
List<VolumeInfo> getBackedUpVolumes();
long getZoneId();
Map<String, String> getDetails();
String getDetail(String name);
Long getBackupScheduleId();
}