Skip to content

Commit 7d92c1d

Browse files
committed
continue addding new files
1 parent 83e2b7a commit 7d92c1d

22 files changed

Lines changed: 521 additions & 89 deletions

api/src/com/cloud/vm/DiskProfile.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class DiskProfile {
3434
private long diskOfferingId;
3535
private Long templateId;
3636
private long volumeId;
37+
private String path;
3738

3839
private HypervisorType hyperType;
3940

@@ -56,6 +57,10 @@ public DiskProfile(Volume vol, DiskOffering offering, HypervisorType hyperType)
5657
this(vol.getId(), vol.getVolumeType(), vol.getName(), offering.getId(), vol.getSize(), offering.getTagsArray(), offering.getUseLocalStorage(), offering.isCustomized(), null);
5758
this.hyperType = hyperType;
5859
}
60+
61+
public DiskProfile(DiskProfile dp) {
62+
63+
}
5964

6065
/**
6166
* @return size of the disk requested in bytes.
@@ -137,4 +142,16 @@ public void setHyperType(HypervisorType hyperType) {
137142
public HypervisorType getHypersorType() {
138143
return this.hyperType;
139144
}
145+
146+
public void setPath(String path) {
147+
this.path = path;
148+
}
149+
150+
public String getPath() {
151+
return this.path;
152+
}
153+
154+
public void setSize(long size) {
155+
this.size = size;
156+
}
140157
}

platform/api/src/org/apache/cloudstack/platform/subsystem/api/storage/DataStore.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
*/
1919
package org.apache.cloudstack.platform.subsystem.api.storage;
2020

21+
import com.cloud.agent.api.to.StorageFilerTO;
2122
import com.cloud.storage.Snapshot;
23+
import com.cloud.storage.Storage.StoragePoolType;
2224
import com.cloud.storage.Volume;
2325
import com.cloud.template.VirtualMachineTemplate;
2426

@@ -46,7 +48,9 @@ public class StoreScope {
4648
long getCluterId();
4749
long getPodId();
4850
long getZoneId();
51+
String getPath();
4952
StoreType getType();
53+
StoragePoolType getPoolType();
5054
StoreScope getScope();
5155
boolean isSharedStorage();
5256
Long getId();
@@ -56,13 +60,15 @@ public class StoreScope {
5660
VolumeStrategy getVolumeStrategy();
5761
SnapshotStrategy getSnapshotStrategy();
5862
BackupStrategy getBackupStrategy();
63+
TemplateStrategy getTemplateStrategy();
5964
DataStoreLifeCycle getLifeCycle();
6065

6166
VolumeProfile prepareVolume(Volume volume, DataStore destStore);
6267
SnapshotProfile prepareSnapshot(Snapshot snapshot, DataStore destStore);
6368
TemplateProfile prepareTemplate(VirtualMachineTemplate template, DataStore destStore);
6469
boolean contains(Volume volume);
6570
boolean contains(Snapshot snapshot);
66-
boolean contains(VirtualMachineTemplate template);
67-
TemplateProfile get(VirtualMachineTemplate template);
71+
boolean contains(TemplateProfile template);
72+
TemplateProfile get(TemplateProfile template);
73+
StorageFilerTO getTO();
6874
}

platform/api/src/org/apache/cloudstack/platform/subsystem/api/storage/DataStoreDriver.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@
2020

2121
import com.cloud.agent.api.Answer;
2222
import com.cloud.agent.api.Command;
23+
import com.cloud.vm.DiskProfile;
2324

2425
public interface DataStoreDriver {
2526
String getDriverType();
27+
TemplateProfile install(TemplateProfile tp, DataStoreEndPoint ep);
28+
DiskProfile createVolumeFromTemplate(DiskProfile volProfile, TemplateProfile tp, DataStoreEndPoint ep);
2629
DataObject create(DataObject obj);
2730
DataObject copy(DataObject src, DataStore dest);
2831
DataObject copy(DataObject src, DataObject dest);

platform/api/src/org/apache/cloudstack/platform/subsystem/api/storage/DataStoreEndPoint.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package org.apache.cloudstack.platform.subsystem.api.storage;
22

3+
import com.cloud.agent.api.Answer;
4+
import com.cloud.agent.api.Command;
5+
36
public class DataStoreEndPoint {
47
protected long hostId;
58
protected String privIp;
@@ -16,4 +19,8 @@ public long getHostId() {
1619
public String getPrivateIp() {
1720
return privIp;
1821
}
22+
23+
public Answer sendCommand(Command cmd) {
24+
return new Answer(cmd);
25+
}
1926
}

platform/api/src/org/apache/cloudstack/platform/subsystem/api/storage/DataStoreEndPointSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
import java.util.List;
44

55
public interface DataStoreEndPointSelector {
6-
List<DataStoreEndPoint> getEndPoints();
6+
List<DataStoreEndPoint> getEndPoints(StorageEvent event);
77
}

platform/storage/src/org/apache/cloudstack/storage/manager/ImageManagerImpl.java renamed to platform/api/src/org/apache/cloudstack/platform/subsystem/api/storage/StorageEvent.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.cloudstack.storage.manager;
20-
21-
public class ImageManagerImpl implements ImageManager {
19+
package org.apache.cloudstack.platform.subsystem.api.storage;
2220

21+
public enum StorageEvent {
22+
DownloadTemplateToPrimary,
23+
CreateVolumeFromTemplate;
2324
}

platform/api/src/org/apache/cloudstack/platform/subsystem/api/storage/TemplateProfile.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,55 @@
1818
*/
1919
package org.apache.cloudstack.platform.subsystem.api.storage;
2020

21+
import com.cloud.storage.Storage;
22+
2123
public class TemplateProfile {
2224
private String _uri;
25+
private String _imageStorageUri;
26+
private String _localPath;
27+
private long _id;
28+
private long _templatePoolRefId;
2329
public String getURI() {
2430
return _uri;
2531
}
32+
33+
public long getId() {
34+
return _id;
35+
}
36+
37+
public String getLocalPath() {
38+
return _localPath;
39+
}
40+
41+
public void setLocalPath(String path) {
42+
_localPath = path;
43+
}
44+
45+
public void setTemplatePoolRefId(long id) {
46+
this._templatePoolRefId = id;
47+
}
48+
49+
public long getTemplatePoolRefId() {
50+
return this._templatePoolRefId;
51+
}
52+
53+
public String getImageStorageUri() {
54+
return _imageStorageUri;
55+
}
56+
57+
public String getUniqueName() {
58+
return null;
59+
}
60+
61+
public Storage.ImageFormat getFormat() {
62+
return null;
63+
}
64+
65+
public String getInstallPath() {
66+
return null;
67+
}
68+
69+
public long getTemplateSize() {
70+
return 0;
71+
}
2672
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.apache.cloudstack.platform.subsystem.api.storage;
22

33
public interface TemplateStrategy {
4-
4+
TemplateProfile install(TemplateProfile tp);
5+
TemplateProfile get(long templateId);
6+
int getDownloadWait();
57
}

platform/api/src/org/apache/cloudstack/platform/subsystem/api/storage/VolumeProfile.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,12 @@ public class VolumeProfile {
2323
public String getURI() {
2424
return _uri;
2525
}
26+
27+
public String getPath() {
28+
return null;
29+
}
30+
31+
public long getSize() {
32+
return 0;
33+
}
2634
}

platform/api/src/org/apache/cloudstack/platform/subsystem/api/storage/VolumeStrategy.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
public interface VolumeStrategy {
77
Volume createVolume(Volume vol);
8-
Volume createDataVolume(Volume vol, DataStore store);
9-
Volume copyVolumeFromBackup(VolumeProfile srcVol, Volume destVol, DataStore destStore);
10-
Volume createVolumeFromSnapshot(SnapshotProfile snapshot, Volume vol, DataStore destStore);
11-
Volume createVolumeFromTemplate(TemplateProfile template, Volume vol, DataStore destStore);
12-
Volume migrateVolume(Volume srcVol, DataStore srcStore, Volume destVol, DataStore destStore);
13-
TemplateProfile createBaseVolume(TemplateProfile tp, DataStore destStore);
14-
Volume createVolumeFromBaseTemplate(TemplateProfile tp, DataStore destStore);
8+
Volume createDataVolume(Volume vol);
9+
Volume copyVolumeFromBackup(VolumeProfile srcVol, Volume destVol);
10+
Volume createVolumeFromSnapshot(SnapshotProfile snapshot, Volume vol);
11+
Volume createVolumeFromTemplate(TemplateProfile template, Volume vol);
12+
Volume migrateVolume(Volume srcVol, Volume destVol, DataStore destStore);
13+
Volume createVolumeFromBaseTemplate(Volume destVol, TemplateProfile tp);
1514
boolean deleteVolume(Volume vol);
15+
VolumeProfile get(long volumeId);
1616
}

0 commit comments

Comments
 (0)