Vered Volansky has uploaded a new change for review.

Change subject: core: Extract Validator creation and apply usages
......................................................................

core: Extract Validator creation and apply usages

There are several places creating a MultipleStorageDomainsValidator
based on a VM and DisksImage List in the same manner.
Some new code for bellow bzs does the same, as will other patches. This
patch removed future code duplicity by extracting the
duplicated code into VmCommand.

Change-Id: I3a6d04fe1a670c814b44bad5304a894faa8f8510
Relatee-To: https://bugzilla.redhat.com/1054175
Signed-off-by: Vered Volansky <vvola...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/75/30775/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
index 05a5227..01fc9e6 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
@@ -9,6 +9,7 @@
 import org.ovirt.engine.core.bll.snapshots.SnapshotsManager;
 import org.ovirt.engine.core.bll.tasks.TaskManagerUtil;
 import org.ovirt.engine.core.bll.utils.PermissionSubject;
+import org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator;
 import org.ovirt.engine.core.common.FeatureSupported;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.VdcActionParametersBase;
@@ -16,6 +17,7 @@
 import org.ovirt.engine.core.common.action.VmOperationParameterBase;
 import org.ovirt.engine.core.common.asynctasks.AsyncTaskType;
 import org.ovirt.engine.core.common.businessentities.Disk;
+import org.ovirt.engine.core.common.businessentities.DiskImage;
 import org.ovirt.engine.core.common.businessentities.DiskInterface;
 import org.ovirt.engine.core.common.businessentities.TagsVmMap;
 import org.ovirt.engine.core.common.businessentities.VM;
@@ -551,4 +553,9 @@
         }
         return true;
     }
+
+    protected MultipleStorageDomainsValidator 
createMultipleStorageDomainsValidator(List<DiskImage> disksList) {
+        return new MultipleStorageDomainsValidator(getVm().getStoragePoolId(),
+                ImagesHandler.getAllStorageIdsForImageIds(disksList));
+    }
 }


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

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

Reply via email to