rename datastream to dataobject

This commit is contained in:
Edison Su 2013-01-16 17:56:38 -08:00
parent 4ca828c1d6
commit c4a11b9979
21 changed files with 82 additions and 76 deletions

View File

@ -20,7 +20,7 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
import org.apache.cloudstack.engine.subsystem.api.storage.disktype.DiskFormat; import org.apache.cloudstack.engine.subsystem.api.storage.disktype.DiskFormat;
public interface DataStream { public interface DataObject {
public long getId(); public long getId();
public String getUri(); public String getUri();
public DataStore getDataStore(); public DataStore getDataStore();

View File

@ -23,11 +23,11 @@ import java.util.Set;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback; import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
public interface DataStoreDriver { public interface DataStoreDriver {
public String grantAccess(DataStream data, EndPoint ep); public String grantAccess(DataObject data, EndPoint ep);
public boolean revokeAccess(DataStream data, EndPoint ep); public boolean revokeAccess(DataObject data, EndPoint ep);
public Set<DataStream> listObjects(DataStore store); public Set<DataObject> listObjects(DataStore store);
public void createAsync(DataStream data, AsyncCompletionCallback<CreateCmdResult> callback); public void createAsync(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback);
public void deleteAsync(DataStream data, AsyncCompletionCallback<CommandResult> callback); public void deleteAsync(DataObject data, AsyncCompletionCallback<CommandResult> callback);
public void copyAsync(DataStream srcdata, DataStream destData, AsyncCompletionCallback<CopyCommandResult> callback); public void copyAsync(DataObject srcdata, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback);
public boolean canCopy(DataStream srcData, DataStream destData); public boolean canCopy(DataObject srcData, DataObject destData);
} }

View File

@ -18,6 +18,6 @@
*/ */
package org.apache.cloudstack.engine.subsystem.api.storage; package org.apache.cloudstack.engine.subsystem.api.storage;
public interface VolumeInfo extends DataStream { public interface VolumeInfo extends DataObject {
public boolean isAttachedVM(); public boolean isAttachedVM();
} }

View File

@ -23,57 +23,64 @@ import java.util.Set;
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult; import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult; import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint; import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback; import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
import org.apache.cloudstack.storage.image.ImageDataStoreDriver; import org.apache.cloudstack.storage.image.ImageDataStoreDriver;
//http-read-only based image store
public class DefaultImageDataStoreDriverImpl implements ImageDataStoreDriver { public class DefaultImageDataStoreDriverImpl implements ImageDataStoreDriver {
public DefaultImageDataStoreDriverImpl() { public DefaultImageDataStoreDriverImpl() {
} }
@Override @Override
public String grantAccess(DataStream data, EndPoint ep) { public String grantAccess(DataObject data, EndPoint ep) {
return data.getUri();
}
@Override
public boolean revokeAccess(DataObject data, EndPoint ep) {
// TODO Auto-generated method stub
return true;
}
@Override
public Set<DataObject> listObjects(DataStore store) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null; return null;
} }
@Override @Override
public boolean revokeAccess(DataStream data, EndPoint ep) { public void createAsync(DataObject data,
// TODO Auto-generated method stub
return false;
}
@Override
public Set<DataStream> listObjects(DataStore store) {
// TODO Auto-generated method stub
return null;
}
@Override
public void createAsync(DataStream data,
AsyncCompletionCallback<CreateCmdResult> callback) { AsyncCompletionCallback<CreateCmdResult> callback) {
// TODO Auto-generated method stub //for default http data store, can create http based template/iso
CreateCmdResult result = new CreateCmdResult("");
if (!data.getUri().startsWith("http")) {
result.setResult("can't register an image which is not a http link");
callback.complete(result);
}
callback.complete(result);
} }
@Override @Override
public void deleteAsync(DataStream data, public void deleteAsync(DataObject data,
AsyncCompletionCallback<CommandResult> callback) { AsyncCompletionCallback<CommandResult> callback) {
// TODO Auto-generated method stub CommandResult result = new CommandResult();
callback.complete(result);
} }
@Override @Override
public boolean canCopy(DataStream srcData, DataStream destData) { public boolean canCopy(DataObject srcData, DataObject destData) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }
@Override @Override
public void copyAsync(DataStream srcdata, DataStream destData, public void copyAsync(DataObject srcdata, DataObject destData,
AsyncCompletionCallback<CopyCommandResult> callback) { AsyncCompletionCallback<CopyCommandResult> callback) {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View File

@ -22,7 +22,7 @@ import java.util.Set;
import javax.inject.Inject; import javax.inject.Inject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint; import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
@ -125,7 +125,7 @@ public class ImageDataStoreImpl implements ImageDataStore {
@Override @Override
public boolean exists(DataStream object) { public boolean exists(DataObject object) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }

View File

@ -21,7 +21,7 @@ package org.apache.cloudstack.storage.image.motion;
import javax.inject.Inject; import javax.inject.Inject;
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint; import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
@ -85,7 +85,7 @@ public class DefaultImageMotionStrategy implements ImageMotionStrategy {
}*/ }*/
@Override @Override
public boolean canHandle(DataStream srcData, DataStream destData) { public boolean canHandle(DataObject srcData, DataObject destData) {
DataStore destStore = destData.getDataStore(); DataStore destStore = destData.getDataStore();
DataStore srcStore = srcData.getDataStore(); DataStore srcStore = srcData.getDataStore();
if (destStore.getRole() == DataStoreRole.Image || destStore.getRole() == DataStoreRole.ImageCache if (destStore.getRole() == DataStoreRole.Image || destStore.getRole() == DataStoreRole.ImageCache
@ -97,7 +97,7 @@ public class DefaultImageMotionStrategy implements ImageMotionStrategy {
} }
@Override @Override
public Void copyAsync(DataStream srcData, DataStream destData, public Void copyAsync(DataObject srcData, DataObject destData,
AsyncCompletionCallback<CopyCommandResult> callback) { AsyncCompletionCallback<CopyCommandResult> callback) {
DataStore destStore = destData.getDataStore(); DataStore destStore = destData.getDataStore();
DataStore srcStore = srcData.getDataStore(); DataStore srcStore = srcData.getDataStore();

View File

@ -16,7 +16,7 @@
// under the License. // under the License.
package org.apache.cloudstack.storage.datastore; package org.apache.cloudstack.storage.datastore;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType; import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
@ -35,5 +35,5 @@ public interface ObjectInDataStoreManager {
public SnapshotInfo create(SnapshotInfo snapshot, DataStore dataStore); public SnapshotInfo create(SnapshotInfo snapshot, DataStore dataStore);
public ObjectInDataStoreVO findObject(long objectId, DataObjectType type, public ObjectInDataStoreVO findObject(long objectId, DataObjectType type,
long dataStoreId, DataStoreRole role); long dataStoreId, DataStoreRole role);
public boolean update(DataStream vo, Event event) throws NoTransitionException; public boolean update(DataObject vo, Event event) throws NoTransitionException;
} }

View File

@ -18,7 +18,7 @@ package org.apache.cloudstack.storage.datastore;
import javax.inject.Inject; import javax.inject.Inject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType; import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
@ -132,7 +132,7 @@ public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager {
} }
@Override @Override
public boolean update(DataStream data, Event event) public boolean update(DataObject data, Event event)
throws NoTransitionException { throws NoTransitionException {
ObjectInDataStoreVO obj = this.findObject(data.getId(), data.getType(), ObjectInDataStoreVO obj = this.findObject(data.getId(), data.getType(),
data.getDataStore().getId(), data.getDataStore().getRole()); data.getDataStore().getId(), data.getDataStore().getRole());

View File

@ -21,7 +21,7 @@ package org.apache.cloudstack.storage.datastore;
import java.util.List; import java.util.List;
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult; import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint; import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo; import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
@ -45,7 +45,7 @@ public interface PrimaryDataStore extends DataStore, PrimaryDataStoreInfo {
void createVoluemFromBaseImageAsync(VolumeInfo volume, TemplateInfo templateStore, AsyncCompletionCallback<CommandResult> callback); void createVoluemFromBaseImageAsync(VolumeInfo volume, TemplateInfo templateStore, AsyncCompletionCallback<CommandResult> callback);
*/ */
boolean exists(DataStream data); boolean exists(DataObject data);
TemplateInfo getTemplate(long templateId); TemplateInfo getTemplate(long templateId);

View File

@ -24,7 +24,7 @@ import java.sql.SQLException;
import javax.inject.Inject; import javax.inject.Inject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint; import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
@ -133,7 +133,7 @@ public class DefaultEndPointSelector implements EndPointSelector {
} }
@Override @Override
public EndPoint select(DataStream srcData, DataStream destData) { public EndPoint select(DataObject srcData, DataObject destData) {
DataStore srcStore = srcData.getDataStore(); DataStore srcStore = srcData.getDataStore();
DataStore destStore = destData.getDataStore(); DataStore destStore = destData.getDataStore();
if (srcData.getFormat() == DiskFormat.VMDK if (srcData.getFormat() == DiskFormat.VMDK

View File

@ -18,9 +18,9 @@
*/ */
package org.apache.cloudstack.storage.endpoint; package org.apache.cloudstack.storage.endpoint;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint; import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
public interface EndPointSelector { public interface EndPointSelector {
public EndPoint select(DataStream srcData, DataStream destData); public EndPoint select(DataObject srcData, DataObject destData);
} }

View File

@ -18,10 +18,10 @@
*/ */
package org.apache.cloudstack.storage.image; package org.apache.cloudstack.storage.image;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import com.cloud.utils.fsm.NoTransitionException; import com.cloud.utils.fsm.NoTransitionException;
public interface TemplateInfo extends DataStream { public interface TemplateInfo extends DataObject {
} }

View File

@ -20,7 +20,7 @@ package org.apache.cloudstack.storage.image.datastore;
import java.util.Set; import java.util.Set;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
import org.apache.cloudstack.storage.image.TemplateInfo; import org.apache.cloudstack.storage.image.TemplateInfo;
@ -30,6 +30,6 @@ public interface ImageDataStore extends DataStore {
TemplateInfo getTemplate(long templateId); TemplateInfo getTemplate(long templateId);
VolumeInfo getVolume(long volumeId); VolumeInfo getVolume(long volumeId);
SnapshotInfo getSnapshot(long snapshotId); SnapshotInfo getSnapshot(long snapshotId);
boolean exists(DataStream object); boolean exists(DataObject object);
Set<TemplateInfo> listTemplates(); Set<TemplateInfo> listTemplates();
} }

View File

@ -18,8 +18,8 @@
*/ */
package org.apache.cloudstack.storage.motion; package org.apache.cloudstack.storage.motion;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
public interface DataMotionDriver { public interface DataMotionDriver {
public void copy(DataStream srcObj, DataStream destObj); public void copy(DataObject srcObj, DataObject destObj);
} }

View File

@ -19,10 +19,10 @@
package org.apache.cloudstack.storage.motion; package org.apache.cloudstack.storage.motion;
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback; import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
public interface DataMotionService { public interface DataMotionService {
public void copyAsync(DataStream srcData, DataStream destData, public void copyAsync(DataObject srcData, DataObject destData,
AsyncCompletionCallback<CopyCommandResult> callback); AsyncCompletionCallback<CopyCommandResult> callback);
} }

View File

@ -23,7 +23,7 @@ import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback; import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -35,7 +35,7 @@ public class DataMotionServiceImpl implements DataMotionService {
List<DataMotionStrategy> strategies; List<DataMotionStrategy> strategies;
@Override @Override
public void copyAsync(DataStream srcData, DataStream destData, public void copyAsync(DataObject srcData, DataObject destData,
AsyncCompletionCallback<CopyCommandResult> callback) { AsyncCompletionCallback<CopyCommandResult> callback) {
if (srcData.getDataStore().getDriver().canCopy(srcData, destData)) { if (srcData.getDataStore().getDriver().canCopy(srcData, destData)) {

View File

@ -19,12 +19,12 @@
package org.apache.cloudstack.storage.motion; package org.apache.cloudstack.storage.motion;
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback; import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
public interface DataMotionStrategy { public interface DataMotionStrategy {
public boolean canHandle(DataStream srcData, DataStream destData); public boolean canHandle(DataObject srcData, DataObject destData);
public Void copyAsync(DataStream srcData, DataStream destData, public Void copyAsync(DataObject srcData, DataObject destData,
AsyncCompletionCallback<CopyCommandResult> callback); AsyncCompletionCallback<CopyCommandResult> callback);
} }

View File

@ -16,10 +16,10 @@
// under the License. // under the License.
package org.apache.cloudstack.storage.snapshot; package org.apache.cloudstack.storage.snapshot;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
public interface SnapshotInfo extends DataStream { public interface SnapshotInfo extends DataObject {
public SnapshotInfo getParent(); public SnapshotInfo getParent();
public SnapshotInfo getChild(); public SnapshotInfo getChild();
public VolumeInfo getBaseVolume(); public VolumeInfo getBaseVolume();

View File

@ -24,7 +24,7 @@ import javax.inject.Inject;
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State; import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope; import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreLifeCycle; import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreLifeCycle;
@ -193,7 +193,7 @@ public class DefaultPrimaryDataStore implements PrimaryDataStore {
} }
@Override @Override
public boolean exists(DataStream data) { public boolean exists(DataObject data) {
return (objectInStoreMgr.findObject(data.getId(), data.getType(), return (objectInStoreMgr.findObject(data.getId(), data.getType(),
this.getId(), this.getRole()) != null) ? true : false; this.getId(), this.getRole()) != null) ? true : false;
} }

View File

@ -22,7 +22,7 @@ import java.util.Set;
import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult; import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult; import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStream; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint; import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher; import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
@ -51,16 +51,16 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
} }
private class CreateVolumeContext<T> extends AsyncRpcConext<T> { private class CreateVolumeContext<T> extends AsyncRpcConext<T> {
private final DataStream volume; private final DataObject volume;
/** /**
* @param callback * @param callback
*/ */
public CreateVolumeContext(AsyncCompletionCallback<T> callback, DataStream volume) { public CreateVolumeContext(AsyncCompletionCallback<T> callback, DataObject volume) {
super(callback); super(callback);
this.volume = volume; this.volume = volume;
} }
public DataStream getVolume() { public DataObject getVolume() {
return this.volume; return this.volume;
} }
@ -70,7 +70,7 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
CommandResult result = new CommandResult(); CommandResult result = new CommandResult();
CreateVolumeAnswer volAnswer = (CreateVolumeAnswer) callback.getResult(); CreateVolumeAnswer volAnswer = (CreateVolumeAnswer) callback.getResult();
if (volAnswer.getResult()) { if (volAnswer.getResult()) {
DataStream volume = context.getVolume(); DataObject volume = context.getVolume();
//volume.setPath(volAnswer.getVolumeUuid()); //volume.setPath(volAnswer.getVolumeUuid());
} else { } else {
result.setResult(volAnswer.getDetails()); result.setResult(volAnswer.getDetails());
@ -81,7 +81,7 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
} }
@Override @Override
public void deleteAsync(DataStream vo, AsyncCompletionCallback<CommandResult> callback) { public void deleteAsync(DataObject vo, AsyncCompletionCallback<CommandResult> callback) {
DeleteCommand cmd = new DeleteCommand(vo.getUri()); DeleteCommand cmd = new DeleteCommand(vo.getUri());
List<EndPoint> endPoints = null; List<EndPoint> endPoints = null;
EndPoint ep = endPoints.get(0); EndPoint ep = endPoints.get(0);
@ -151,7 +151,7 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
}*/ }*/
@Override @Override
public void createAsync(DataStream vol, public void createAsync(DataObject vol,
AsyncCompletionCallback<CreateCmdResult> callback) { AsyncCompletionCallback<CreateCmdResult> callback) {
List<EndPoint> endPoints = null; List<EndPoint> endPoints = null;
EndPoint ep = endPoints.get(0); EndPoint ep = endPoints.get(0);
@ -167,19 +167,19 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
} }
@Override @Override
public String grantAccess(DataStream vol, EndPoint ep) { public String grantAccess(DataObject vol, EndPoint ep) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null; return null;
} }
@Override @Override
public boolean revokeAccess(DataStream vol, EndPoint ep) { public boolean revokeAccess(DataObject vol, EndPoint ep) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }
@Override @Override
public Set<DataStream> listObjects(DataStore store) { public Set<DataObject> listObjects(DataStore store) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null; return null;
} }
@ -201,13 +201,13 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
@Override @Override
public boolean canCopy(DataStream srcData, DataStream destData) { public boolean canCopy(DataObject srcData, DataObject destData) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }
@Override @Override
public void copyAsync(DataStream srcdata, DataStream destData, public void copyAsync(DataObject srcdata, DataObject destData,
AsyncCompletionCallback<CopyCommandResult> callback) { AsyncCompletionCallback<CopyCommandResult> callback) {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View File

@ -105,8 +105,7 @@ public class VolumeObject implements VolumeInfo {
@Override @Override
public long getId() { public long getId() {
// TODO Auto-generated method stub return this.volumeVO.getId();
return 0;
} }
@Override @Override