Skip to content

Commit c93918a

Browse files
author
Edison Su
committed
rename dataobject to datastream
1 parent af67d87 commit c93918a

25 files changed

Lines changed: 90 additions & 119 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
2424

2525
public interface DataStoreDriver {
26-
public String grantAccess(DataObject data, EndPoint ep);
27-
public boolean revokeAccess(DataObject data, EndPoint ep);
28-
public Set<DataObject> listObjects(DataStore store);
29-
public void createAsync(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback);
30-
public void deleteAsync(DataObject data, AsyncCompletionCallback<CommandResult> callback);
31-
public void copyAsync(DataObject srcdata, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback);
32-
public boolean canCopy(DataObject srcData, DataObject destData);
26+
public String grantAccess(DataStream data, EndPoint ep);
27+
public boolean revokeAccess(DataStream data, EndPoint ep);
28+
public Set<DataStream> listObjects(DataStore store);
29+
public void createAsync(DataStream data, AsyncCompletionCallback<CreateCmdResult> callback);
30+
public void deleteAsync(DataStream data, AsyncCompletionCallback<CommandResult> callback);
31+
public void copyAsync(DataStream srcdata, DataStream destData, AsyncCompletionCallback<CopyCommandResult> callback);
32+
public boolean canCopy(DataStream srcData, DataStream destData);
3333
}

engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObject.java renamed to engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStream.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020

2121
import org.apache.cloudstack.engine.subsystem.api.storage.disktype.DiskFormat;
2222

23-
public interface DataObject {
23+
public interface DataStream {
2424
public long getId();
2525
public String getUri();
2626
public DataStore getDataStore();
2727
public long getSize();
2828
public DataObjectType getType();
2929
public DiskFormat getFormat();
30+
public String getUuid();
3031
}

engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeInfo.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@
1818
*/
1919
package org.apache.cloudstack.engine.subsystem.api.storage;
2020

21-
22-
import org.apache.cloudstack.engine.subsystem.api.storage.disktype.DiskFormat;
23-
24-
public interface VolumeInfo extends DataObject {
25-
public String getUuid();
26-
public long getId();
27-
21+
public interface VolumeInfo extends DataStream {
2822
public boolean isAttachedVM();
29-
public String getPath();
3023
}

engine/storage/image/src/org/apache/cloudstack/storage/image/driver/DefaultImageDataStoreDriverImpl.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
2424
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
2525
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
26-
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
26+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream;
2727
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
2828
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
2929
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
@@ -35,45 +35,45 @@ public DefaultImageDataStoreDriverImpl() {
3535
}
3636

3737
@Override
38-
public String grantAccess(DataObject data, EndPoint ep) {
38+
public String grantAccess(DataStream data, EndPoint ep) {
3939
// TODO Auto-generated method stub
4040
return null;
4141
}
4242

4343
@Override
44-
public boolean revokeAccess(DataObject data, EndPoint ep) {
44+
public boolean revokeAccess(DataStream data, EndPoint ep) {
4545
// TODO Auto-generated method stub
4646
return false;
4747
}
4848

4949
@Override
50-
public Set<DataObject> listObjects(DataStore store) {
50+
public Set<DataStream> listObjects(DataStore store) {
5151
// TODO Auto-generated method stub
5252
return null;
5353
}
5454

5555
@Override
56-
public void createAsync(DataObject data,
56+
public void createAsync(DataStream data,
5757
AsyncCompletionCallback<CreateCmdResult> callback) {
5858
// TODO Auto-generated method stub
5959

6060
}
6161

6262
@Override
63-
public void deleteAsync(DataObject data,
63+
public void deleteAsync(DataStream data,
6464
AsyncCompletionCallback<CommandResult> callback) {
6565
// TODO Auto-generated method stub
6666

6767
}
6868

6969
@Override
70-
public boolean canCopy(DataObject srcData, DataObject destData) {
70+
public boolean canCopy(DataStream srcData, DataStream destData) {
7171
// TODO Auto-generated method stub
7272
return false;
7373
}
7474

7575
@Override
76-
public void copyAsync(DataObject srcdata, DataObject destData,
76+
public void copyAsync(DataStream srcdata, DataStream destData,
7777
AsyncCompletionCallback<CopyCommandResult> callback) {
7878
// TODO Auto-generated method stub
7979

engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStoreImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import javax.inject.Inject;
2424

25-
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
25+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream;
2626
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
2727
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
2828
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
@@ -125,7 +125,7 @@ public SnapshotInfo getSnapshot(long snapshotId) {
125125

126126

127127
@Override
128-
public boolean exists(DataObject object) {
128+
public boolean exists(DataStream object) {
129129
// TODO Auto-generated method stub
130130
return false;
131131
}

engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ public long getId() {
7070
return this.imageVO.getId();
7171
}
7272

73-
@Override
74-
public String getPath() {
75-
//TODO: add installation path if it's downloaded to cache storage already
76-
return this.imageVO.getUrl();
77-
}
78-
7973
@Override
8074
public String getUuid() {
8175
// TODO Auto-generated method stub
@@ -84,7 +78,7 @@ public String getUuid() {
8478

8579
@Override
8680
public String getUri() {
87-
return this.dataStore.getUri() + "template/" + this.getPath();
81+
return this.dataStore.getUri() + "template/" + this.imageVO.getUrl();
8882
}
8983

9084
@Override
@@ -103,7 +97,6 @@ public DiskFormat getFormat() {
10397
return DiskFormat.getFormat(this.imageVO.getFormat());
10498
}
10599

106-
@Override
107100
public boolean stateTransit(TemplateEvent e) throws NoTransitionException {
108101
return imageMgr.getStateMachine().transitTo(this.imageVO, e, null, imageDao);
109102
}

engine/storage/imagemotion/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import javax.inject.Inject;
2222

2323
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
24-
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
24+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream;
2525
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
2626
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
2727
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
@@ -85,7 +85,7 @@ public Object copyTemplateCallBack(AsyncCallbackDispatcher<DefaultImageMotionStr
8585
}*/
8686

8787
@Override
88-
public boolean canHandle(DataObject srcData, DataObject destData) {
88+
public boolean canHandle(DataStream srcData, DataStream destData) {
8989
DataStore destStore = destData.getDataStore();
9090
DataStore srcStore = srcData.getDataStore();
9191
if (destStore.getRole() == DataStoreRole.Image || destStore.getRole() == DataStoreRole.ImageCache
@@ -97,7 +97,7 @@ public boolean canHandle(DataObject srcData, DataObject destData) {
9797
}
9898

9999
@Override
100-
public Void copyAsync(DataObject srcData, DataObject destData,
100+
public Void copyAsync(DataStream srcData, DataStream destData,
101101
AsyncCompletionCallback<CopyCommandResult> callback) {
102102
DataStore destStore = destData.getDataStore();
103103
DataStore srcStore = srcData.getDataStore();

engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,15 @@
2727
public class SnapshotObject implements SnapshotInfo {
2828
private SnapshotVO snapshot;
2929
private DataStore store;
30-
30+
3131
public SnapshotObject(SnapshotVO snapshot, DataStore store) {
3232
this.snapshot = snapshot;
3333
this.store = store;
3434
}
35-
35+
3636
public DataStore getStore() {
3737
return this.store;
3838
}
39-
@Override
40-
public String getName() {
41-
return this.snapshot.getName();
42-
}
4339

4440
@Override
4541
public SnapshotInfo getParent() {
@@ -95,4 +91,10 @@ public DiskFormat getFormat() {
9591
return null;
9692
}
9793

94+
@Override
95+
public String getUuid() {
96+
// TODO Auto-generated method stub
97+
return null;
98+
}
99+
98100
}

engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717
package org.apache.cloudstack.storage.datastore;
1818

19-
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
19+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream;
2020
import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType;
2121
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
2222
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
@@ -35,5 +35,5 @@ public interface ObjectInDataStoreManager {
3535
public SnapshotInfo create(SnapshotInfo snapshot, DataStore dataStore);
3636
public ObjectInDataStoreVO findObject(long objectId, DataObjectType type,
3737
long dataStoreId, DataStoreRole role);
38-
public boolean update(DataObject vo, Event event) throws NoTransitionException;
38+
public boolean update(DataStream vo, Event event) throws NoTransitionException;
3939
}

engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import javax.inject.Inject;
2020

21-
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
21+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream;
2222
import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType;
2323
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
2424
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
@@ -132,7 +132,7 @@ public ObjectInDataStoreVO findObject(long objectId, DataObjectType type,
132132
}
133133

134134
@Override
135-
public boolean update(DataObject data, Event event)
135+
public boolean update(DataStream data, Event event)
136136
throws NoTransitionException {
137137
ObjectInDataStoreVO obj = this.findObject(data.getId(), data.getType(),
138138
data.getDataStore().getId(), data.getDataStore().getRole());

0 commit comments

Comments
 (0)