Ramesh N has uploaded a new change for review.

Change subject: engine: BLL command to refresh volume details
......................................................................

engine: BLL command to refresh volume details

   Create a new BLL command to refresh volume details.
It will make use of the GlusterSyncJob to refresh
volume details.

Change-Id: Ie06c6a45e00f35df45e130cdceb592e81b67998e
Signed-off-by: Ramesh Nachimuthu <[email protected]>
---
A 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RefreshGlusterVolumeDetailsCommand.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
M 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
M 
frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java
M 
frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
7 files changed, 70 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/62/23262/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RefreshGlusterVolumeDetailsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RefreshGlusterVolumeDetailsCommand.java
new file mode 100644
index 0000000..55b93e5
--- /dev/null
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RefreshGlusterVolumeDetailsCommand.java
@@ -0,0 +1,56 @@
+package org.ovirt.engine.core.bll.gluster;
+
+import org.ovirt.engine.core.bll.LockIdNameAttribute;
+import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
+import org.ovirt.engine.core.common.AuditLogType;
+import org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters;
+import org.ovirt.engine.core.common.errors.VdcBllMessages;
+
+
+/**
+ * BLL command to refresh gluster hooks in a cluster
+ */
+@NonTransactiveCommandAttribute
+@LockIdNameAttribute(isWait = true)
+public class RefreshGlusterVolumeDetailsCommand<T extends 
GlusterVolumeParameters> extends GlusterVolumeCommandBase<T> {
+
+    public RefreshGlusterVolumeDetailsCommand(T params) {
+        super(params);
+    }
+
+    @Override
+    protected void setActionMessageParameters() {
+        addCanDoActionMessage(VdcBllMessages.VAR__ACTION__REFRESH);
+        addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_VOLUME);
+    }
+
+    @Override
+    protected boolean canDoAction() {
+        if(!super.canDoAction()) {
+            return false;
+        }
+
+        return true;
+    }
+
+    protected GlusterSyncJob getSyncJobInstance() {
+        return GlusterSyncJob.getInstance();
+    }
+
+    @Override
+    protected void executeCommand() {
+
+        getSyncJobInstance().refreshVolumeDetails(upServer, 
getGlusterVolume());
+        setSucceeded(true);
+
+    }
+
+    @Override
+    public AuditLogType getAuditLogTypeValue() {
+        if (getSucceeded()) {
+            return AuditLogType.GLUSTER_VOLUME_DETAILS_REFRESH;
+        } else {
+            return errorType == null ? 
AuditLogType.GLUSTER_VOLUME_DETAILS_REFRESH_FAILED : errorType;
+        }
+    }
+}
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
index 89d5961..ba6f4f5 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
@@ -313,6 +313,8 @@
     START_REMOVING_GLUSTER_VOLUME_BRICKS_DETECTED_FROM_CLI(4090),
     GLUSTER_VOLUME_REBALANCE_NOT_FOUND_FROM_CLI(4091),
     REMOVE_GLUSTER_VOLUME_BRICKS_NOT_FOUND_FROM_CLI(4092),
+    GLUSTER_VOLUME_DETAILS_REFRESH(4093),
+    GLUSTER_VOLUME_DETAILS_REFRESH_FAILED(4094),
 
     USER_FORCE_SELECTED_SPM(159),
     USER_VDS_RESTART(41),
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
index 5ef0cad..5263496 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
@@ -276,6 +276,8 @@
     StartRemoveGlusterVolumeBricks(1422, 
ActionGroup.MANIPULATE_GLUSTER_VOLUME, QuotaDependency.NONE),
     StopRemoveGlusterVolumeBricks(1423, ActionGroup.MANIPULATE_GLUSTER_VOLUME, 
false, QuotaDependency.NONE),
     CommitRemoveGlusterVolumeBricks(1424, 
ActionGroup.MANIPULATE_GLUSTER_VOLUME, false, QuotaDependency.NONE),
+    RefreshGlusterVolumeDetails(1425, ActionGroup.MANIPULATE_GLUSTER_VOLUME, 
QuotaDependency.NONE),
+
     // Cluster Policy
     AddClusterPolicy(1450, ActionGroup.EDIT_STORAGE_POOL_CONFIGURATION, false, 
QuotaDependency.NONE),
     EditClusterPolicy(1451, ActionGroup.EDIT_STORAGE_POOL_CONFIGURATION, 
false, QuotaDependency.NONE),
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
index 327823e..a78ed42 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
@@ -154,6 +154,8 @@
         severities.put(AuditLogType.GLUSTER_HOOK_REMOVE_FAILED, 
AuditLogSeverity.ERROR);
         severities.put(AuditLogType.GLUSTER_HOOK_REFRESH, 
AuditLogSeverity.NORMAL);
         severities.put(AuditLogType.GLUSTER_HOOK_REFRESH_FAILED, 
AuditLogSeverity.ERROR);
+        severities.put(AuditLogType.GLUSTER_VOLUME_DETAILS_REFRESH, 
AuditLogSeverity.NORMAL);
+        severities.put(AuditLogType.GLUSTER_VOLUME_DETAILS_REFRESH_FAILED, 
AuditLogSeverity.ERROR);
         severities.put(AuditLogType.GLUSTER_SERVICE_STARTED, 
AuditLogSeverity.NORMAL);
         severities.put(AuditLogType.GLUSTER_SERVICE_START_FAILED, 
AuditLogSeverity.ERROR);
         severities.put(AuditLogType.GLUSTER_SERVICE_STOPPED, 
AuditLogSeverity.NORMAL);
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
index ff055d8..18265c3 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
@@ -701,6 +701,8 @@
 GLUSTER_HOOK_REMOVE_FAILED=Failed to remove Gluster Hook ${GlusterHookName} 
from cluster ${VdsGroupName}. ${FailureMessage}
 GLUSTER_HOOK_REFRESH=Refreshed gluster hooks in Cluster ${VdsGroupName}.
 GLUSTER_HOOK_REFRESH_FAILED=Failed to refresh gluster hooks in Cluster 
${VdsGroupName}.
+GLUSTER_VOLUME_DETAILS_REFRESH=Refreshed details of the volume 
${glusterVolumeName}.
+GLUSTER_VOLUME_DETAILS_REFRESH_FAILED=Failed to refresh the details of volume 
${glusterVolumeName}.
 GLUSTER_SERVICE_STARTED=${servicetype} service started on host ${VdsName} on 
cluster ${VdsGroupName}.
 GLUSTER_SERVICE_START_FAILED=Could not start ${servicetype} service on host 
${VdsName} on cluster ${VdsGroupName}.
 GLUSTER_SERVICE_STOPPED=${servicetype} services stopped on host ${VdsName} on 
cluster ${VdsGroupName}.
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java
 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java
index 601c6c3..840fd4b 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java
+++ 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/LocalizedEnums.java
@@ -352,6 +352,10 @@
 
     String AuditLogType___GLUSTER_HOOK_REFRESH_FAILED();
 
+    String AuditLogType___GLUSTER_VOLUME_DETAILS_REFRESH();
+
+    String AuditLogType___GLUSTER_VOLUME_DETAILS_REFRESH_FAILED();
+
     String AuditLogType___GLUSTER_HOOK_CONFLICT_DETECTED();
 
     String AuditLogType___GLUSTER_HOOK_DETECTED_NEW();
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
 
b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
index 4c48068..370541a 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
+++ 
b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
@@ -172,6 +172,8 @@
 AuditLogType___GLUSTER_HOOK_REMOVE_FAILED=Failed to remove Gluster Hook from 
cluster
 AuditLogType___GLUSTER_HOOK_REFRESH=Gluster Hooks refreshed
 AuditLogType___GLUSTER_HOOK_REFRESH_FAILED=Failed to refresh Gluster Hooks
+AuditLogType___GLUSTER_VOLUME_DETAILS_REFRESH=Refreshed details of the volume.
+AuditLogType___GLUSTER_VOLUME_DETAILS_REFRESH_FAILED=Failed to refresh the 
details of volume.
 AuditLogType___GLUSTER_HOOK_CONFLICT_DETECTED=Detected conflict in Gluster Hook
 AuditLogType___GLUSTER_HOOK_DETECTED_NEW=Detected new Gluster Hook
 AuditLogType___GLUSTER_HOOK_DETECTED_DELETE=Detected removal of Gluster Hook


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

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

Reply via email to