Daniel Erez has uploaded a new change for review. Change subject: webadmin: get HotPlugEnabled config value synchronously ......................................................................
webadmin: get HotPlugEnabled config value synchronously Replacing the asynchronous fetch of HotPlugEnabled configuration value with a synchronous one. Change-Id: I9f10f10bffbf79f7e282221e93de5be95385ba78 Signed-off-by: Daniel Erez <de...@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java 2 files changed, 3 insertions(+), 22 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/10/12510/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java index 5284e6b..f7dbd5d 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java @@ -2043,20 +2043,6 @@ aQuery); } - public static void IsHotPlugAvailable(AsyncQuery aQuery, String version) { - aQuery.converterCallback = new IAsyncConverter() { - @Override - public Object Convert(Object source, AsyncQuery _asyncQuery) - { - return source != null ? ((Boolean) source).booleanValue() : true; - } - }; - GetConfigurationValueParameters tempVar = - new GetConfigurationValueParameters(ConfigurationValues.HotPlugEnabled); - tempVar.setVersion(version); - GetConfigFromCache(tempVar, aQuery); - } - public static void GetAllAttachableDisks(AsyncQuery aQuery, Guid storagePoolId, Guid vmId) { aQuery.converterCallback = new IAsyncConverter() { @Override diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java index 9a2809f..9f69fea 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java @@ -18,6 +18,7 @@ import org.ovirt.engine.core.common.businessentities.VM; import org.ovirt.engine.core.common.businessentities.VMStatus; import org.ovirt.engine.core.common.businessentities.storage_pool; +import org.ovirt.engine.core.common.queries.ConfigurationValues; import org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters; import org.ovirt.engine.core.common.queries.VdcQueryType; import org.ovirt.engine.core.compat.StringHelper; @@ -698,14 +699,8 @@ if (clusterCompatibilityVersion == null) { setIsDiskHotPlugSupported(false); } else { - AsyncDataProvider.IsHotPlugAvailable(new AsyncQuery(this, - new INewAsyncCallback() { - @Override - public void OnSuccess(Object target, Object returnValue) { - VmDiskListModel model = (VmDiskListModel) target; - model.setIsDiskHotPlugSupported((Boolean) returnValue); - } - }), clusterCompatibilityVersion.toString()); + setIsDiskHotPlugSupported((Boolean) AsyncDataProvider.GetConfigValuePreConverted( + ConfigurationValues.HotPlugEnabled, clusterCompatibilityVersion.toString())); } } -- To view, visit http://gerrit.ovirt.org/12510 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f10f10bffbf79f7e282221e93de5be95385ba78 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Daniel Erez <de...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches