use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeActionParameters 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.gluster.GlusterVolumeActionParameters 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);
}
use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeActionParameters in project ovirt-engine by oVirt.
the class RestoreGlusterVolumeSnapshotCommand method stopVolume.
private boolean stopVolume(GlusterVolumeEntity volume) {
if (volume != null && volume.getStatus() == GlusterStatus.UP) {
ActionReturnValue retVal = runInternalAction(ActionType.StopGlusterVolume, new GlusterVolumeActionParameters(volume.getId(), true));
if (!retVal.getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_VOLUME_STOP_FAILED, retVal.getExecuteFailedMessages().toString());
setSucceeded(false);
return false;
}
}
return true;
}
use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeActionParameters in project ovirt-engine by oVirt.
the class VolumeListModel method prepareForStartVolume.
private void prepareForStartVolume(boolean noForceStart) {
boolean force = false;
ConfirmationModel cModel;
if (getConfirmWindow() != null) {
cModel = (ConfirmationModel) getConfirmWindow();
closeConfirmationWindow();
force = cModel.getForce().getEntity();
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
GlusterVolumeEntity volume = (GlusterVolumeEntity) item;
VolumeStatus status = GlusterVolumeUtils.getVolumeStatus(volume);
if (!noForceStart && (status == VolumeStatus.ALL_BRICKS_DOWN || status == VolumeStatus.SOME_BRICKS_DOWN)) {
list.add(new GlusterVolumeActionParameters(volume.getId(), force));
} else if (noForceStart && status == VolumeStatus.DOWN) {
list.add(new GlusterVolumeActionParameters(volume.getId(), false));
}
}
onStartVolume(list);
}
use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeActionParameters in project ovirt-engine by oVirt.
the class RestoreGlusterVolumeSnapshotCommand method startVolume.
private boolean startVolume(Guid volumeId) {
ActionReturnValue retVal = runInternalAction(ActionType.StartGlusterVolume, new GlusterVolumeActionParameters(volumeId, true));
if (!retVal.getSucceeded()) {
handleVdsError(AuditLogType.GLUSTER_VOLUME_START_FAILED, retVal.getExecuteFailedMessages().toString());
setSucceeded(false);
return false;
}
return true;
}
Aggregations