anmolbabu has uploaded a new change for review.

Change subject: webadmin : Sorting the rebalance hosts status according to host 
name
......................................................................

webadmin : Sorting the rebalance hosts status according to host name

In the status dialog the node column was not sorted and the rows used
to get flipped every time refresh happened.
Now, Node column is sorted and hence rows do not get flipped.

Change-Id: I1bd43c458d915751002758f38714b96aa0474181
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1020872
Signed-off-by: Anmol Babu <anb...@redhat.com>
---
A 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeTaskStatusForHostComparator.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeRebalanceStatusModel.java
2 files changed, 22 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/11/20311/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeTaskStatusForHostComparator.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeTaskStatusForHostComparator.java
new file mode 100644
index 0000000..0284070
--- /dev/null
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeTaskStatusForHostComparator.java
@@ -0,0 +1,20 @@
+package org.ovirt.engine.ui.uicommonweb.models.gluster;
+
+import java.io.Serializable;
+import java.util.Comparator;
+
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost;
+
+public class GlusterVolumeTaskStatusForHostComparator implements 
Comparator<GlusterVolumeTaskStatusForHost>, Serializable{
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = -4585565684336628868L;
+
+    @Override
+    public int compare(GlusterVolumeTaskStatusForHost status1, 
GlusterVolumeTaskStatusForHost status2) {
+        // TODO Auto-generated method stub
+        return status1.getHostName().compareTo(status2.getHostName());
+    }
+}
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeRebalanceStatusModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeRebalanceStatusModel.java
index 4eac635..0752aae 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeRebalanceStatusModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeRebalanceStatusModel.java
@@ -1,6 +1,7 @@
 package org.ovirt.engine.ui.uicommonweb.models.gluster;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity;
@@ -99,6 +100,7 @@
     public void showStatus(GlusterVolumeTaskStatusEntity 
rebalanceStatusEntity) {
         List<GlusterVolumeTaskStatusForHost> rebalanceSessionsList =
                 rebalanceStatusEntity.getHostwiseStatusDetails();
+        Collections.sort(rebalanceSessionsList, new 
GlusterVolumeTaskStatusForHostComparator());
         List<EntityModel> sessionList = new ArrayList<EntityModel>();
         for (GlusterVolumeTaskStatusForHost hostDetail : 
rebalanceSessionsList) {
             EntityModel sessionModel = new EntityModel(hostDetail);


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bd43c458d915751002758f38714b96aa0474181
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: anmolbabu <anb...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to