use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class VmListModel method onExportNoTemplates.
private void onExportNoTemplates() {
ExportVmModel model = (ExportVmModel) getWindow();
Guid storageDomainId = model.getStorage().getSelectedItem().getId();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
VM a = (VM) item;
MoveOrCopyParameters parameters = new MoveOrCopyParameters(a.getId(), storageDomainId);
parameters.setForceOverride(model.getForceOverride().getEntity());
parameters.setCopyCollapse(model.getCollapseSnapshots().getEntity());
parameters.setTemplateMustExists(false);
list.add(parameters);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.ExportVm, list, result -> {
ExportVmModel localModel = (ExportVmModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class VmListModel method onPowerAction.
private void onPowerAction(ActionType actionType, PowerActionParametersFactory<?> parametersFactory) {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
VM vm = (VM) item;
list.add(parametersFactory.createActionParameters(vm));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(actionType, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class VolumeListModel method onRemoveVolume.
private void onRemoveVolume() {
if (getWindow() == null) {
return;
}
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
if (getSelectedItems() == null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
GlusterVolumeEntity volume = (GlusterVolumeEntity) item;
list.add(new GlusterVolumeActionParameters(volume.getId(), false));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.DeleteGlusterVolume, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class VolumeListModel method startVolumeProfiling.
private void startVolumeProfiling() {
if (getSelectedItems() == null) {
return;
}
List<GlusterVolumeEntity> selectedVolumesList = getSelectedItems();
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (GlusterVolumeEntity currentSelectedVolume : selectedVolumesList) {
GlusterVolumeParameters parameter = new GlusterVolumeParameters(currentSelectedVolume.getId());
parameters.add(parameter);
}
Frontend.getInstance().runMultipleAction(ActionType.StartGlusterVolumeProfile, parameters);
}
use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class VolumeListModel method onStop.
public void onStop() {
if (getWindow() == null) {
return;
}
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
if (getSelectedItems() == null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
GlusterVolumeEntity volume = (GlusterVolumeEntity) item;
list.add(new GlusterVolumeActionParameters(volume.getId(), false));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.StopGlusterVolume, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
Aggregations