Kanagaraj M has uploaded a new change for review.

Change subject: webadmin: gluster hooks - sync with servers action
......................................................................

webadmin: gluster hooks - sync with servers action

Added a new action "Sync" to gluster hooks sub-tab.
This will invoke the GlusterHooksSyncJob internally
to sync the hooks across the servers of the cluster.

Change-Id: I3e825620ec15e41a2093b0f84b53a926974d66cb
Signed-off-by: Kanagaraj M <kmayi...@redhat.com>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterGlusterHookListModel.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/tab/cluster/SubTabClusterGlusterHookView.java
3 files changed, 29 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/74/15574/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterGlusterHookListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterGlusterHookListModel.java
index d94378e..9dc84f1 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterGlusterHookListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterGlusterHookListModel.java
@@ -5,6 +5,7 @@
 
 import org.ovirt.engine.core.common.action.VdcActionParametersBase;
 import org.ovirt.engine.core.common.action.VdcActionType;
+import org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters;
 import org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters;
 import org.ovirt.engine.core.common.action.gluster.GlusterHookParameters;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
@@ -38,6 +39,8 @@
 
     private UICommand resolveConflictsCommand;
 
+    private UICommand syncWithServersCommand;
+
     public UICommand getEnableHookCommand() {
         return enableHookCommand;
     }
@@ -70,6 +73,14 @@
         this.resolveConflictsCommand = resolveConflictsCommand;
     }
 
+    public UICommand getSyncWithServersCommand() {
+        return syncWithServersCommand;
+    }
+
+    public void setSyncWithServersCommand(UICommand syncWithServersCommand) {
+        this.syncWithServersCommand = syncWithServersCommand;
+    }
+
     @Override
     public VDSGroup getEntity() {
         return (VDSGroup) super.getEntity();
@@ -91,6 +102,8 @@
 
         setResolveConflictsCommand(new UICommand("ResolveConflicts", this)); 
//$NON-NLS-1$
         getResolveConflictsCommand().setIsExecutionAllowed(false);
+
+        setSyncWithServersCommand(new UICommand("SyncWithServers", this)); 
//$NON-NLS-1$
     }
 
     private void enableHook() {
@@ -394,6 +407,10 @@
         }
     }
 
+    private void syncWithServers() {
+        Frontend.RunAction(VdcActionType.RefreshGlusterHooks, new 
GlusterClusterParameters(getEntity().getId()));
+    }
+
     @Override
     protected void onSelectedItemChanged() {
         super.onSelectedItemChanged();
@@ -499,6 +516,9 @@
         else if (command.getName().equals("OnResolveConflicts")) { 
//$NON-NLS-1$
             onResolveConflicts();
         }
+        else if (command.equals(getSyncWithServersCommand())) {
+            syncWithServers();
+        }
         else if (command.getName().equals("Cancel")) { //$NON-NLS-1$
             cancel();
         }
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 902f5791..817f5b5 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
@@ -1743,6 +1743,9 @@
     @DefaultStringValue("Resolve Conflicts")
     String resolveConflictsGlusterHook();
 
+    @DefaultStringValue("Sync")
+    String syncWithServersGlusterHook();
+
     @DefaultStringValue("Conflicts Reasons")
     String conflictReasonsGlusterHook();
 
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterGlusterHookView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterGlusterHookView.java
index de915dd..bcfbde2 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterGlusterHookView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterGlusterHookView.java
@@ -104,5 +104,11 @@
                 return getDetailModel().getResolveConflictsCommand();
             }
         });
+        getTable().addActionButton(new 
WebAdminButtonDefinition<GlusterHookEntity>(constants.syncWithServersGlusterHook())
 {
+            @Override
+            protected UICommand resolveCommand() {
+                return getDetailModel().getSyncWithServersCommand();
+            }
+        });
     }
 }


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

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

Reply via email to