use of org.ovirt.engine.core.common.businessentities.gluster.StorageDevice in project ovirt-engine by oVirt.
the class HostGlusterStorageDevicesListModel method onCreateBrick.
private void onCreateBrick() {
CreateBrickModel lvModel = (CreateBrickModel) getWindow();
if (lvModel == null) {
return;
}
if (!lvModel.validate()) {
return;
}
VDS host = getEntity();
if (host == null) {
return;
}
lvModel.startProgress();
List<StorageDevice> selectedDevices = new ArrayList<>();
for (StorageDevice device : lvModel.getStorageDevices().getSelectedItems()) {
selectedDevices.add(device);
}
CreateBrickParameters parameters = new CreateBrickParameters(host.getId(), lvModel.getLvName().getEntity(), lvModel.getMountPoint().getEntity(), lvModel.getRaidTypeList().getSelectedItem(), lvModel.getNoOfPhysicalDisksInRaidVolume().getEntity(), lvModel.getStripeSize().getEntity(), selectedDevices, lvModel.getCacheDevicePathTypeList().getSelectedItem(), lvModel.getCacheModeTypeList().getSelectedItem(), lvModel.getCacheSize().getEntity());
Frontend.getInstance().runAction(ActionType.CreateBrick, parameters, result -> postCreateBrick(result.getReturnValue()), this);
}
use of org.ovirt.engine.core.common.businessentities.gluster.StorageDevice in project ovirt-engine by oVirt.
the class HostGlusterStorageDevicesListModel method canCreateBrick.
private boolean canCreateBrick() {
boolean canCreateBrick = false;
List<StorageDevice> selectedDevices = getSelectedItems();
if (selectedDevices != null) {
for (StorageDevice device : selectedDevices) {
if (device.getCanCreateBrick()) {
canCreateBrick = true;
} else {
canCreateBrick = false;
break;
}
}
}
return canCreateBrick;
}
use of org.ovirt.engine.core.common.businessentities.gluster.StorageDevice in project ovirt-engine by oVirt.
the class CreateBrickModel method updateBrickSize.
private void updateBrickSize() {
long totalSize = 0;
// capacity.
if (getStorageDevices().getSelectedItems() != null) {
for (StorageDevice storageDevice : getStorageDevices().getSelectedItems()) {
totalSize += storageDevice.getSize();
}
}
Pair<SizeUnit, Double> convertedSize = SizeConverter.autoConvert(totalSize, SizeUnit.MiB);
setBrickSize(convertedSize);
}
Aggregations