use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo in project ovirt-engine by oVirt.
the class GlusterVolumeOptionsInfoReturn method prepareOptionHelpEntity.
private GlusterVolumeOptionInfo prepareOptionHelpEntity(Map<String, Object> map) {
GlusterVolumeOptionInfo entity = new GlusterVolumeOptionInfo();
entity.setKey(map.get("name").toString());
entity.setDefaultValue(map.get("defaultValue").toString());
entity.setDescription(map.get("description").toString());
return entity;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo in project ovirt-engine by oVirt.
the class VolumeParameterModel method selectedKeyChanged.
private void selectedKeyChanged() {
String key = getKeyList().getSelectedItem();
GlusterVolumeOptionInfo selectedOption = optionsMap.get(key);
if (selectedOption != null) {
if (selectedOption.getDescription() == null || selectedOption.getDescription().equals(NULL_CONST)) {
getDescription().setEntity(null);
} else {
getDescription().setEntity(selectedOption.getDescription());
}
if (getIsNew()) {
if (selectedOption.getDefaultValue() == null || selectedOption.getDefaultValue().equals(NULL_CONST)) {
getValue().setEntity(null);
} else {
getValue().setEntity(selectedOption.getDefaultValue());
}
}
} else if (getIsNew()) {
getDescription().setEntity(null);
getValue().setEntity(null);
}
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo in project ovirt-engine by oVirt.
the class GetGlusterVolumeOptionsInfoQueryTest method setupExpectedGlusterVolumeOptionInfo.
private void setupExpectedGlusterVolumeOptionInfo() {
parameters = new GlusterParameters(CLUSTER_ID);
expected = new ArrayList<>();
GlusterVolumeOptionInfo option = new GlusterVolumeOptionInfo();
option.setKey("cluster.self-heal-window-size");
option.setDefaultValue("1");
option.setDescription("Maximum number blocks per file for which self-heal process would be applied simultaneously.");
expected.add(option);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo in project ovirt-engine by oVirt.
the class VolumeParameterListModel method getCifsVolumeOption.
private GlusterVolumeOptionInfo getCifsVolumeOption() {
GlusterVolumeOptionInfo cifsOption = new GlusterVolumeOptionInfo();
// $NON-NLS-1$
cifsOption.setKey("user.cifs");
return cifsOption;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo in project ovirt-engine by oVirt.
the class VolumeParameterListModel method editParameter.
private void editParameter() {
if (getWindow() != null) {
return;
}
GlusterVolumeEntity volume = getEntity();
if (volume == null) {
return;
}
VolumeParameterModel volumeParameterModel = new VolumeParameterModel();
volumeParameterModel.setTitle(ConstantsManager.getInstance().getConstants().editOptionVolume());
volumeParameterModel.setHelpTag(HelpTag.edit_option);
// $NON-NLS-1$
volumeParameterModel.setHashName("edit_option");
volumeParameterModel.setIsNew(false);
setWindow(volumeParameterModel);
volumeParameterModel.getKeyList().setIsChangeable(false);
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()));
}
GlusterVolumeOptionEntity selectedOption = getSelectedItem();
// $NON-NLS-1$
innerParameterModel.getDescription().setEntity("");
innerParameterModel.getKeyList().setSelectedItem(selectedOption.getKey());
innerParameterModel.getValue().setEntity(selectedOption.getValue());
innerParameterModel.stopProgress();
// $NON-NLS-1$
UICommand command = UICommand.createDefaultOkUiCommand("OnSetParameter", VolumeParameterListModel.this);
innerParameterModel.getCommands().add(command);
// $NON-NLS-1$
command = UICommand.createCancelUiCommand("OnCancel", VolumeParameterListModel.this);
innerParameterModel.getCommands().add(command);
});
asyncQuery.setHandleFailure(true);
AsyncDataProvider.getInstance().getGlusterVolumeOptionInfoList(asyncQuery, volume.getClusterId());
}
Aggregations