Gilad Chaplik has uploaded a new change for review.

Change subject: core: NPE in add quota via rest
......................................................................

core: NPE in add quota via rest

2 problems:
- No id return value when creating a quota (ActionReturnValue(quotaId)).
- No c'tor with id, for fetching quota by id (using reflection).

Change-Id: I83a3712b15ee96de2a0fb6a3da77e41bcbd2387f
Bug-Url: https://bugzilla.redhat.com/950464
Signed-off-by: Gilad Chaplik <gchap...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddQuotaCommand.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetQuotaByQuotaIdQueryParameters.java
2 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/28/14028/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddQuotaCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddQuotaCommand.java
index de6fcd2..d91b027 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddQuotaCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddQuotaCommand.java
@@ -3,8 +3,8 @@
 import java.util.Collections;
 import java.util.List;
 
-import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.bll.utils.PermissionSubject;
+import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.QuotaCRUDParameters;
 import org.ovirt.engine.core.common.businessentities.Quota;
@@ -43,6 +43,7 @@
     protected void executeCommand() {
         setQuotaParameter();
         getQuotaDAO().save(getQuota());
+        getReturnValue().setActionReturnValue(getQuota().getId());
         getReturnValue().setSucceeded(true);
     }
 
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetQuotaByQuotaIdQueryParameters.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetQuotaByQuotaIdQueryParameters.java
index 526ad94..101705e 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetQuotaByQuotaIdQueryParameters.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetQuotaByQuotaIdQueryParameters.java
@@ -10,6 +10,14 @@
     private static final long serialVersionUID = 6780385841336933228L;
     private Guid quotaId;
 
+    public GetQuotaByQuotaIdQueryParameters() {
+    }
+
+    public GetQuotaByQuotaIdQueryParameters(Guid quotaId) {
+        this();
+        this.quotaId = quotaId;
+    }
+
     public void setQuotaId(Guid quotaId) {
         this.quotaId = quotaId;
     }


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

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

Reply via email to