use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeReplaceBrickActionParameters in project ovirt-engine by oVirt.
the class VolumeBrickListModel method onReplaceConfirmation.
private void onReplaceConfirmation() {
cancelConfirmation();
ReplaceBrickModel replaceBrickModel = (ReplaceBrickModel) getWindow();
GlusterVolumeEntity volumeEntity = getEntity();
GlusterBrickEntity existingBrick = getSelectedItem();
if (replaceBrickModel == null || volumeEntity == null || existingBrick == null) {
return;
}
if (!replaceBrickModel.validate()) {
return;
}
VDS server = replaceBrickModel.getServers().getSelectedItem();
if (server == null) {
return;
}
GlusterBrickEntity newBrick = new GlusterBrickEntity();
newBrick.setVolumeId(volumeEntity.getId());
newBrick.setServerId(server.getId());
newBrick.setServerName(server.getHostName());
newBrick.setBrickDirectory(replaceBrickModel.getBrickDirectory().getEntity());
replaceBrickModel.startProgress();
GlusterVolumeReplaceBrickActionParameters parameter = new GlusterVolumeReplaceBrickActionParameters(volumeEntity.getId(), existingBrick, newBrick);
Frontend.getInstance().runAction(ActionType.ReplaceGlusterVolumeBrick, parameter, result -> {
ReplaceBrickModel localModel = (ReplaceBrickModel) result.getState();
localModel.stopProgress();
setWindow(null);
}, replaceBrickModel);
}
Aggregations