@Override
public String getUri() {
if (this.dataStore == null) {
throw new CloudRuntimeException("datastore must be set before using this object");
}
DataObjectInStore obj = objectInStoreMgr.findObject(this.volumeVO.getId(), DataObjectType.VOLUME,
this.dataStore.getId(), this.dataStore.getRole());
if (obj.getState() != ObjectInDataStoreStateMachine.State.Ready) {
return this.dataStore.getUri() + "&" + EncodingType.OBJTYPE + "=" + DataObjectType.VOLUME + "&"
+ EncodingType.SIZE + "=" + this.volumeVO.getSize() + "&" + EncodingType.NAME + "="
+ this.volumeVO.getName();
} else {
return this.dataStore.getUri() + "&" + EncodingType.OBJTYPE + "=" + DataObjectType.VOLUME + "&"
+ EncodingType.PATH + "=" + obj.getInstallPath();
}
}