anmolbabu has uploaded a new change for review.

Change subject: engine : Rebalance status to show Started and Stopped At fields
......................................................................

engine : Rebalance status to show Started and Stopped At fields

Stopped At field is dispalyed in the rebalance status dialog once rebalance is 
stopped.

Change-Id: I2957ba2c4bd1f6deb1ef444e28e8afdd8896f0b4
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1022937
Signed-off-by: Anmol Babu <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeRebalanceStatusQuery.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeTaskStatusEntity.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeRebalanceStatusModel.java
M 
frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/VolumeRebalanceStatusPopupView.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/VolumeRebalanceStatusPopupView.ui.xml
7 files changed, 41 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/00/20800/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeRebalanceStatusQuery.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeRebalanceStatusQuery.java
index 9452285..27a84c2 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeRebalanceStatusQuery.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeRebalanceStatusQuery.java
@@ -59,6 +59,7 @@
                 List<Step> stepsList = 
getStepDao().getStepsByExternalId(taskId);
                 if (stepsList != null && !stepsList.isEmpty()) {
                     entity.setStartTime(stepsList.get(0).getStartTime());
+                    entity.setStopTime(stepsList.get(0).getEndTime());
                 }
             }
         }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeTaskStatusEntity.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeTaskStatusEntity.java
index 77ba498..8e0396d 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeTaskStatusEntity.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeTaskStatusEntity.java
@@ -11,6 +11,7 @@
 
     private Date startTime;
     private Date statusTime;
+    private Date stopTime;
     private List<GlusterVolumeTaskStatusForHost> hostwiseStatusDetails;
     private GlusterVolumeTaskStatusDetail statusSummary;
 
@@ -55,4 +56,12 @@
         Collections.sort(this.getHostwiseStatusDetails(), new 
GlusterVolumeTaskStatusForHost());
         return this;
     }
+
+    public Date getStopTime() {
+        return stopTime;
+    }
+
+    public void setStopTime(Date stopTime) {
+        this.stopTime = stopTime;
+    }
 }
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 64ad064..27c17ea 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
@@ -25,7 +25,7 @@
 
     private EntityModel cluster;
 
-    private EntityModel startedTime;
+    private EntityModel startStopTime;
 
     private EntityModel statusTime;
 
@@ -45,7 +45,7 @@
         setStatus(new EntityModel());
         setVolume(new EntityModel());
         setCluster(new EntityModel());
-        setStartedTime(new EntityModel());
+        setStartStopTime(new EntityModel());
         setStatusTime(new EntityModel());
         setRebalanceSessions(new ListModel());
         setEntity(volumeEntity);
@@ -76,12 +76,12 @@
         this.volume = volume;
     }
 
-    public EntityModel getStartedTime() {
-        return startedTime;
+    public EntityModel getStartStopTime() {
+        return startStopTime;
     }
 
-    public void setStartedTime(EntityModel startedTime) {
-        this.startedTime = startedTime;
+    public void setStartStopTime(EntityModel startedTime) {
+        this.startStopTime = startedTime;
     }
 
     public EntityModel getCluster() {
@@ -101,6 +101,9 @@
     }
 
     public void showStatus(GlusterVolumeTaskStatusEntity 
rebalanceStatusEntity) {
+        if(rebalanceStatusEntity.getStopTime() != null) {
+            setStopTimeAvailable();
+        }
         List<GlusterVolumeTaskStatusForHost> rebalanceSessionsList =
                 rebalanceStatusEntity.getHostwiseStatusDetails();
         List<EntityModel> sessionList = new ArrayList<EntityModel>();
@@ -108,7 +111,7 @@
             EntityModel sessionModel = new EntityModel(hostDetail);
             sessionList.add(sessionModel);
         }
-        getStartedTime().setEntity(rebalanceStatusEntity.getStartTime());
+        getStartStopTime().setEntity((rebalanceStatusEntity.getStopTime() == 
null) ? rebalanceStatusEntity.getStartTime() : 
rebalanceStatusEntity.getStopTime());
         getStatusTime().setEntity(rebalanceStatusEntity.getStatusTime());
         getRebalanceSessions().setItems(sessionList);
         if(rebalanceStatusEntity.getStatusSummary().getStatus() == 
JobExecutionStatus.FINISHED) {
@@ -169,6 +172,10 @@
         }
     }
 
+    private void setStopTimeAvailable() {
+        onPropertyChanged(new 
PropertyChangedEventArgs("IS_STOP_TIME_APPLICABLE"));//$NON-NLS-1$
+    }
+
     public UICommand getStopReblanceFromStatus() {
         return stopReblanceFromStatus;
     }
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
index be54966..e1dcad3 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
+++ 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
@@ -3,6 +3,8 @@
 
 import org.ovirt.engine.core.common.businessentities.VmPool;
 
+import com.google.gwt.i18n.client.Constants.DefaultStringValue;
+
 public interface UIConstants extends com.google.gwt.i18n.client.Constants {
 
     @DefaultStringValue("OK")
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
index 855a064..c314512 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
@@ -2,6 +2,8 @@
 
 import org.ovirt.engine.ui.common.CommonApplicationConstants;
 
+import com.google.gwt.i18n.client.Constants.DefaultStringValue;
+
 public interface ApplicationConstants extends CommonApplicationConstants {
 
     @DefaultStringValue("oVirt Engine Web Administration")
@@ -2558,6 +2560,12 @@
     @DefaultStringValue("Rebalance")
     String rebalanceVolume();
 
+    @DefaultStringValue("Started At :")
+    String rebalanceStartTime();
+
+    @DefaultStringValue("Stopped At :")
+    String rebalanceStopTime();
+
     @DefaultStringValue("Optimize for Virt Store")
     String optimizeForVirtStore();
 
@@ -3282,9 +3290,6 @@
 
     @DefaultStringValue("Rebalance completed")
     String rebalanceCompleted();
-
-    @DefaultStringValue("Started At :")
-    String rebalanceStartTime();
 
     @DefaultStringValue("Status At :")
     String rebalanceStatusTime();
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/VolumeRebalanceStatusPopupView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/VolumeRebalanceStatusPopupView.java
index 856339e..e6a4453 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/VolumeRebalanceStatusPopupView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/VolumeRebalanceStatusPopupView.java
@@ -60,9 +60,9 @@
     EntityModelLabelEditor clusterEditor;
 
     @UiField(provided = true)
-    @Path("startedTime.entity")
+    @Path("startStopTime.entity")
     @WithElementId
-    EntityModelLabelEditor startedTimeEditor;
+    EntityModelLabelEditor startStopTimeEditor;
 
     @UiField(provided = true)
     @Path("statusTime.entity")
@@ -107,7 +107,7 @@
     }
 
     private void localize(final ApplicationConstants constants) {
-        startedTimeEditor.setLabel(constants.rebalanceStartTime());
+        startStopTimeEditor.setLabel(constants.rebalanceStartTime());
         volumeEditor.setLabel(constants.rebalanceVolumeName());
         clusterEditor.setLabel(constants.rebalanceClusterVolume());
         statusTimeEditor.setLabel(constants.rebalanceStatusTime());
@@ -120,7 +120,7 @@
 
         statusTimeEditor = getInstanceOfDateEditor();
 
-        startedTimeEditor = getInstanceOfDateEditor();
+        startStopTimeEditor = getInstanceOfDateEditor();
 
         rebalanceHostsTable.addEntityModelColumn(new 
EntityModelTextColumn<GlusterVolumeTaskStatusForHost>() {
             @Override
@@ -194,6 +194,8 @@
                 PropertyChangedEventArgs e = (PropertyChangedEventArgs) args;
                 if(e.PropertyName.equals("IS_STATUS_APPLICABLE")) 
{//$NON-NLS-1$
                     statusLabel.setVisible(object.isStatusAvailable());
+                } else if(e.PropertyName.equals("IS_STOP_TIME_APPLICABLE")) 
{//$NON-NLS-1$
+                    
startStopTimeEditor.setLabel(constants.rebalanceStopTime());
                 }
             }
         });
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/VolumeRebalanceStatusPopupView.ui.xml
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/VolumeRebalanceStatusPopupView.ui.xml
index 2c4181d..91c2e74 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/VolumeRebalanceStatusPopupView.ui.xml
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/VolumeRebalanceStatusPopupView.ui.xml
@@ -27,7 +27,7 @@
                                <g:HorizontalPanel>
                                        <g:VerticalPanel>
                                                <e:EntityModelLabelEditor 
ui:field="volumeEditor" />
-                                               <e:EntityModelLabelEditor 
ui:field="startedTimeEditor" />
+                                               <e:EntityModelLabelEditor 
ui:field="startStopTimeEditor" />
                                        </g:VerticalPanel>
                                        <g:VerticalPanel>
                                                <e:EntityModelLabelEditor 
ui:field="clusterEditor" />


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2957ba2c4bd1f6deb1ef444e28e8afdd8896f0b4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: anmolbabu <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to