Alona Kaplan has posted comments on this change.

Change subject: core,webadmin: GetConfigurationValuesQuery for UI cache
......................................................................


Patch Set 1: (4 inline comments)

....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
Line 2132:     /**
Line 2133:      * Get configuration value from 'cachedConfigValuesPreConvert'
Line 2134:      * (raw values from vdc_options table).
Line 2135:      */
Line 2136:     public static Object GetConfigValue(ConfigurationValues 
configValue, String version) {
1. The method name should reflect the returned value is pre convert.
2. Why don't you create a map between the the configuration value and the 
converter and return a converted value?
3. public static Object GetConfigValue(ConfigurationValues configValue, String 
version, Converter converter) can be useful.
Line 2137:         Map.Entry<ConfigurationValues, String> key =
Line 2138:                 new KeyValuePairCompat<ConfigurationValues, 
String>(configValue, version);
Line 2139: 
Line 2140:         return cachedConfigValuesPreConvert.get(key);


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterNetworkListModel.java
Line 115:     }
Line 116: 
Line 117:     public DataCenterNetworkListModel()
Line 118:     {
Line 119:         // get management network name
Should call getConfigValue
Line 120:         AsyncDataProvider.GetManagementNetworkName(new 
AsyncQuery(this, new INewAsyncCallback() {
Line 121:             @Override
Line 122:             public void OnSuccess(Object model, Object returnValue) {
Line 123:                 ENGINE_NETWORK = (String) returnValue;


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceListModel.java
Line 331: 
Line 332:     public HostInterfaceListModel()
Line 333:     {
Line 334: 
Line 335:         // get management network name
Should call getConfigValue
Line 336:         AsyncDataProvider.GetManagementNetworkName(new 
AsyncQuery(this, new INewAsyncCallback() {
Line 337:             @Override
Line 338:             public void OnSuccess(Object model, Object returnValue) {
Line 339:                 ENGINE_NETWORK_NAME = (String) returnValue;


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/LoginModel.java
Line 321:     }
Line 322: 
Line 323:     protected void raiseLoggedInEvent() {
Line 324:         // Cache all configurations values before logging-in
Line 325:         AsyncDataProvider.CacheConfigValues(new AsyncQuery(this, new 
INewAsyncCallback() {
Why do you get the values after the login. Maybe in the future there would be a 
config value that is needed before the login.
Line 326:             @Override
Line 327:             public void OnSuccess(Object target, Object returnValue) {
Line 328:                 LoginModel loginModel = (LoginModel) target;
Line 329:                 loginModel.getLoggedInEvent().raise(this, 
EventArgs.Empty);


--
To view, visit http://gerrit.ovirt.org/8563
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id51a9f86bceef07de728335643b16c0554b6876c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Einav Cohen <eco...@redhat.com>
Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vsz...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to