Martin Peřina has uploaded a new change for review.

Change subject: webadmin: Replace usage of *PmProxyPreferences() with 
*FenceProxySources()
......................................................................

webadmin: Replace usage of *PmProxyPreferences() with *FenceProxySources()

Replaces usage of get/setPmProxyPreferences() with
get/setFenceProxySources(). Conversion from comma separated string will
be removed as a part of power management tab refactoring.

Change-Id: Ia31972d3ac3d1364be92517059cacbed8768bdfb
Bug-Url: https://bugzilla.redhat.com/1182510
Signed-off-by: Martin Perina <mper...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetFenceAgentStatusQuery.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetFenceAgentStatusParameters.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
5 files changed, 16 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/61/39761/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetFenceAgentStatusQuery.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetFenceAgentStatusQuery.java
index 67d0feb..89ad04a 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetFenceAgentStatusQuery.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetFenceAgentStatusQuery.java
@@ -28,7 +28,7 @@
         vds.setHostName(getParameters().getHostName());
         vds.setVdsGroupId(getParameters().getVdsGroupId());
         vds.setStoragePoolId(getParameters().getStoragePoolId());
-        vds.setPmProxyPreferences(getParameters().getPmProxyPreferences());
+        vds.setFenceProxySources(getParameters().getFenceProxySources());
         return vds;
     }
 }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
index 2e9a73b..f0cf883 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
@@ -936,11 +936,6 @@
         return FenceProxySourceTypeHelper.saveAsString(getFenceProxySources());
     }
 
-    // TODO: Remove method when all callers use List<FenceProxySourceType>
-    public void setPmProxyPreferences(String pmProxyPreferences) {
-        
setFenceProxySources(FenceProxySourceTypeHelper.parseFromString(pmProxyPreferences));
-    }
-
     public List<FenceProxySourceType> getFenceProxySources() {
         return vdsStatic.getFenceProxySources();
     }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetFenceAgentStatusParameters.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetFenceAgentStatusParameters.java
index 3f61585..12a75c3 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetFenceAgentStatusParameters.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetFenceAgentStatusParameters.java
@@ -1,6 +1,9 @@
 package org.ovirt.engine.core.common.queries;
 
+import java.util.List;
+
 import org.ovirt.engine.core.common.businessentities.FenceAgent;
+import org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType;
 import org.ovirt.engine.core.compat.Guid;
 
 public class GetFenceAgentStatusParameters extends VdcQueryParametersBase {
@@ -10,7 +13,7 @@
     private String vdsName;
     private String hostName;
     private FenceAgent agent;
-    private String pmProxyPreferences;
+    private List<FenceProxySourceType> fenceProxySources;
     private Guid storagePoolId;
     private Guid vdsGroupId;
 
@@ -66,12 +69,11 @@
         this.vdsGroupId = vdsGroupId;
     }
 
-    public String getPmProxyPreferences() {
-        return pmProxyPreferences;
+    public List<FenceProxySourceType> getFenceProxySources() {
+        return fenceProxySources;
     }
 
-    public void setPmProxyPreferences(String pmProxyPreferences) {
-        this.pmProxyPreferences = pmProxyPreferences;
+    public void setFenceProxySources(List<FenceProxySourceType> 
fenceProxySources) {
+        this.fenceProxySources = fenceProxySources;
     }
-
 }
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java
index ca5cf85..0d84f5b 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java
@@ -55,6 +55,7 @@
 import org.ovirt.engine.core.common.queries.VdcQueryReturnValue;
 import org.ovirt.engine.core.common.queries.VdcQueryType;
 import org.ovirt.engine.core.common.utils.RpmVersionUtils;
+import org.ovirt.engine.core.common.utils.pm.FenceProxySourceTypeHelper;
 import org.ovirt.engine.core.compat.Guid;
 import org.ovirt.engine.core.compat.RpmVersion;
 import org.ovirt.engine.core.compat.StringHelper;
@@ -841,8 +842,9 @@
                 hostModel.setHelpTag(HelpTag.edit_host);
                 hostModel.setHashName("edit_host"); //$NON-NLS-1$
 
-                if (host.getPmProxyPreferences() != null) {
-                    
hostModel.setPmProxyPreferences(host.getPmProxyPreferences());
+                if (host.getFenceProxySources() != null && 
!host.getFenceProxySources().isEmpty()) {
+                    hostModel.setPmProxyPreferences(
+                            
FenceProxySourceTypeHelper.saveAsString(host.getFenceProxySources()));
                 } else {
                     
AsyncDataProvider.getInstance().getDefaultPmProxyPreferences(new 
AsyncQuery(null, new INewAsyncCallback() {
                         @Override
@@ -971,7 +973,7 @@
         Guid newClusterId = model.getCluster().getSelectedItem().getId();
         host.setVdsGroupId(newClusterId);
         host.setVdsSpmPriority(model.getSpmPriorityValue());
-        host.setPmProxyPreferences(model.getPmProxyPreferences());
+        
host.setFenceProxySources(FenceProxySourceTypeHelper.parseFromString(model.getPmProxyPreferences()));
 
 
         // Save other PM parameters.
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
index 5810bea..2c83dba 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
@@ -24,6 +24,7 @@
 import org.ovirt.engine.core.common.queries.GetFenceAgentStatusParameters;
 import org.ovirt.engine.core.common.queries.VdcQueryReturnValue;
 import org.ovirt.engine.core.common.queries.VdcQueryType;
+import org.ovirt.engine.core.common.utils.pm.FenceProxySourceTypeHelper;
 import org.ovirt.engine.core.compat.Guid;
 import org.ovirt.engine.core.compat.StringHelper;
 import org.ovirt.engine.ui.frontend.AsyncQuery;
@@ -1622,7 +1623,7 @@
         agent.setOptionsMap(isPrimary ? getPmOptionsMap() : 
getPmSecondaryOptionsMap());
         param.setAgent(agent);
         param.setStoragePoolId(cluster.getStoragePoolId() != null ? 
cluster.getStoragePoolId() : Guid.Empty);
-        param.setPmProxyPreferences(getPmProxyPreferences());
+        
param.setFenceProxySources(FenceProxySourceTypeHelper.parseFromString(getPmProxyPreferences()));
         param.setVdsName(getName().getEntity());
         param.setHostName(getHost().getEntity());
         param.setVdsGroupId(cluster.getId());


-- 
To view, visit https://gerrit.ovirt.org/39761
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia31972d3ac3d1364be92517059cacbed8768bdfb
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <mper...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to