use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters in project ovirt-engine by oVirt.
the class VolumeBrickListModel method onStopRemoveBricks.
private void onStopRemoveBricks() {
if (getConfirmWindow() == null) {
return;
}
ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
GlusterVolumeEntity volumeEntity = getVolumeEntity();
ArrayList<GlusterBrickEntity> list = new ArrayList<>();
for (Object brickName : model.getItems()) {
GlusterBrickEntity brick = volumeEntity.getBrickWithQualifiedName((String) brickName);
if (brick != null) {
list.add(brick);
}
}
GlusterVolumeRemoveBricksParameters parameter = new GlusterVolumeRemoveBricksParameters(volumeEntity.getId(), list);
model.startProgress();
Frontend.getInstance().runAction(ActionType.StopRemoveGlusterVolumeBricks, parameter, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
setConfirmWindow(null);
if (result.getReturnValue().getSucceeded()) {
showRemoveBricksStatus();
}
}, model);
}
use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters in project ovirt-engine by oVirt.
the class BackendGlusterBricksResource method toParameters.
private GlusterVolumeRemoveBricksParameters toParameters(GlusterBricks bricks) {
GlusterVolumeRemoveBricksParameters params = new GlusterVolumeRemoveBricksParameters();
List<GlusterBrickEntity> entityBricks = new ArrayList<>();
for (GlusterBrick brick : bricks.getGlusterBricks()) {
GlusterBrickEntity entity = new GlusterBrickEntity();
entity.setBrickDirectory(brick.getBrickDir());
entity.setVolumeId(asGuid(getVolumeId()));
if (brick.getName() != null) {
String[] arr = brick.getName().split("\\:");
if (arr.length > 1) {
entity.setServerName(arr[0]);
entity.setBrickDirectory(arr[1]);
} else {
continue;
}
}
if (brick.getId() != null) {
entity.setId(asGuid(brick.getId()));
}
entityBricks.add(entity);
}
params.setVolumeId(asGuid(getVolumeId()));
params.setBricks(entityBricks);
params.setCommandType(ActionType.StartRemoveGlusterVolumeBricks);
return params;
}
use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters in project ovirt-engine by oVirt.
the class VolumeBrickListModel method onRetainBricks.
private void onRetainBricks() {
if (getConfirmWindow() == null) {
return;
}
ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
GlusterVolumeEntity volumeEntity = getVolumeEntity();
ArrayList<GlusterBrickEntity> list = new ArrayList<>();
for (Object brickName : model.getItems()) {
GlusterBrickEntity brick = volumeEntity.getBrickWithQualifiedName((String) brickName);
if (brick != null) {
list.add(brick);
}
}
GlusterVolumeRemoveBricksParameters parameter = new GlusterVolumeRemoveBricksParameters(volumeEntity.getId(), list);
model.startProgress();
Frontend.getInstance().runAction(ActionType.StopRemoveGlusterVolumeBricks, parameter, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
setConfirmWindow(null);
if (result.getReturnValue().getSucceeded()) {
showRemoveBricksStatus();
disableRemoveBrickStatusPopUpActions();
}
}, model);
}
Aggregations