use of org.ovirt.engine.core.common.action.RemoveDiskParameters in project ovirt-engine by oVirt.
the class TemplateStorageListModel method onRemove.
private void onRemove() {
ConfirmationModel model = (ConfirmationModel) getWindow();
List<ActionParametersBase> parameters = new ArrayList<>();
List<? extends Object> disks = getSelectedItems() != null ? getSelectedItems() : new ArrayList<DiskModel>();
for (Object o : disks) {
DiskModel diskModel = (DiskModel) o;
RemoveDiskParameters params = new RemoveDiskParameters(diskModel.getDisk().getId(), diskModel.getStorageDomain().getSelectedItem().getId());
parameters.add(params);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveDisk, parameters, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
cancel();
}
use of org.ovirt.engine.core.common.action.RemoveDiskParameters in project ovirt-engine by oVirt.
the class StorageDiskListModel method onRemove.
private void onRemove() {
RemoveDiskModel model = (RemoveDiskModel) getWindow();
List<ActionParametersBase> paramerterList = new ArrayList<>();
for (Object item : getSelectedItems()) {
DiskImage disk = (DiskImage) item;
ActionParametersBase parameters = new RemoveDiskParameters(disk.getId(), getEntity().getId());
paramerterList.add(parameters);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveDisk, paramerterList, result -> {
StorageDiskListModel localModel = (StorageDiskListModel) result.getState();
localModel.stopProgress();
cancel();
}, this);
}
use of org.ovirt.engine.core.common.action.RemoveDiskParameters in project ovirt-engine by oVirt.
the class RemoveDiskModel method onRemove.
public void onRemove(final ICommandTarget target) {
boolean removeDisk = getLatch().getEntity();
ActionType actionType = removeDisk ? ActionType.RemoveDisk : ActionType.DetachDiskFromVm;
List<ActionParametersBase> parameterList = disksToRemove.stream().map(disk -> removeDisk ? new RemoveDiskParameters(disk.getId()) : new AttachDetachVmDiskParameters(new DiskVmElement(disk.getId(), vm.getId()))).collect(Collectors.toList());
startProgress();
Frontend.getInstance().runMultipleAction(actionType, parameterList, result -> {
stopProgress();
target.executeCommand(cancelCommand);
}, this);
}
Aggregations