use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo in project ovirt-engine by oVirt.
the class VolumeParameterListModel method getOptionsMap.
private HashMap<String, GlusterVolumeOptionInfo> getOptionsMap(Set<GlusterVolumeOptionInfo> optionList) {
HashMap<String, GlusterVolumeOptionInfo> optionsMap = new HashMap<>();
for (GlusterVolumeOptionInfo volumeOption : optionList) {
optionsMap.put(volumeOption.getKey(), volumeOption);
}
GlusterVolumeOptionInfo cifsVolumeOption = getCifsVolumeOption();
optionsMap.put(cifsVolumeOption.getKey(), cifsVolumeOption);
return optionsMap;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo in project ovirt-engine by oVirt.
the class VolumeParameterListModel method addParameter.
private void addParameter() {
if (getWindow() != null) {
return;
}
GlusterVolumeEntity volume = getEntity();
if (volume == null) {
return;
}
VolumeParameterModel volumeParameterModel = new VolumeParameterModel();
volumeParameterModel.setTitle(ConstantsManager.getInstance().getConstants().addOptionVolume());
volumeParameterModel.setHelpTag(HelpTag.add_option);
// $NON-NLS-1$
volumeParameterModel.setHashName("add_option");
setWindow(volumeParameterModel);
volumeParameterModel.startProgress();
AsyncQuery<QueryReturnValue> asyncQuery = new AsyncQuery<>(returnValue -> {
VolumeParameterModel innerParameterModel = (VolumeParameterModel) getWindow();
if (!returnValue.getSucceeded()) {
innerParameterModel.setOptionsMap(new HashMap<String, GlusterVolumeOptionInfo>());
innerParameterModel.setMessage(ConstantsManager.getInstance().getConstants().errorInFetchingVolumeOptionList());
} else {
innerParameterModel.setOptionsMap(getOptionsMap((Set<GlusterVolumeOptionInfo>) returnValue.getReturnValue()));
}
innerParameterModel.stopProgress();
// $NON-NLS-1$
UICommand command = UICommand.createDefaultOkUiCommand("OnSetParameter", VolumeParameterListModel.this);
innerParameterModel.getCommands().add(command);
// $NON-NLS-1$
innerParameterModel.getCommands().add(UICommand.createCancelUiCommand("OnCancel", VolumeParameterListModel.this));
});
asyncQuery.setHandleFailure(true);
AsyncDataProvider.getInstance().getGlusterVolumeOptionInfoList(asyncQuery, volume.getClusterId());
}
Aggregations