return null;
}
@Override
public String getUri() {
ImageDataVO image = imageDao.findById(this.imageVO.getId());
if (this.dataStore == null) {
return image.getUrl();
} else {
ObjectInDataStoreVO obj = objectInStoreMgr.findObject(
this.imageVO.getId(), DataObjectType.TEMPLATE,
this.dataStore.getId(), this.dataStore.getRole());
StringBuilder builder = new StringBuilder();
if (obj.getState() == ObjectInDataStoreStateMachine.State.Ready
|| obj.getState() == ObjectInDataStoreStateMachine.State.Copying) {
builder.append(this.dataStore.getUri());
builder.append("&" + EncodingType.OBJTYPE + "=" + DataObjectType.TEMPLATE);
builder.append("&" + EncodingType.PATH + "=" + obj.getInstallPath());
builder.append("&" + EncodingType.SIZE + "=" + image.getSize());
return builder.toString();
} else {
builder.append(this.dataStore.getUri());
builder.append("&" + EncodingType.OBJTYPE + "=" + DataObjectType.TEMPLATE);
builder.append("&" + EncodingType.SIZE + "=" + image.getSize());
builder.append("&" + EncodingType.PATH + "=" + image.getUrl());
return builder.toString();
}
}
}