Ori Liel has uploaded a new change for review.

Change subject: restapi: Move SchedulingPolicy remove to entity
......................................................................

restapi: Move SchedulingPolicy remove to entity

This patch moves the method that implements the DELETE operation
from the collection interface to the entity interface.
This is needed to avoid issues with newer versions of Resteasy.

Change-Id: I67c6687e3ffa028938ffd455a210a8e7d7fd27c4
Signed-off-by: Ori Liel <[email protected]>
---
M 
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPoliciesResource.java
M 
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyResource.java
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPoliciesResource.java
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyResource.java
4 files changed, 23 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/22/41922/1

diff --git 
a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPoliciesResource.java
 
b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPoliciesResource.java
index 5f31a79..04e688e 100644
--- 
a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPoliciesResource.java
+++ 
b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPoliciesResource.java
@@ -1,7 +1,6 @@
 package org.ovirt.engine.api.resource;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
@@ -22,10 +21,6 @@
     @POST
     @Consumes({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, 
ApiMediaType.APPLICATION_X_YAML})
     public Response add(SchedulingPolicy schedulingPolicy);
-
-    @DELETE
-    @Path("{id}")
-    public Response remove(@PathParam("id") String id);
 
     @Path("{id}")
     public SchedulingPolicyResource 
getSchedulingPolicySubResource(@PathParam("id") String id);
diff --git 
a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyResource.java
 
b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyResource.java
index 883bfa7..51fbbc4 100644
--- 
a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyResource.java
+++ 
b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyResource.java
@@ -1,13 +1,18 @@
 package org.ovirt.engine.api.resource;
 
+import javax.ws.rs.DELETE;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
 
 import org.ovirt.engine.api.model.SchedulingPolicy;
 
 @Produces({ ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, 
ApiMediaType.APPLICATION_X_YAML })
 public interface SchedulingPolicyResource extends 
UpdatableResource<SchedulingPolicy> {
 
+    @DELETE
+    public Response remove();
+
     @Path("filters")
     public FiltersResource getFiltersResource();
 
diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPoliciesResource.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPoliciesResource.java
index 444b36f..47e61b1 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPoliciesResource.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPoliciesResource.java
@@ -50,20 +50,6 @@
     }
 
     @Override
-    protected Response performRemove(String id) {
-        Response performAction = null;
-        try {
-
-            performAction =
-                    performAction(VdcActionType.RemoveClusterPolicy, new 
ClusterPolicyCRUDParameters(asGuid(id),
-                            queryIdResolver.lookupEntity(asGuid(id))));
-        } catch (BackendFailureException e) {
-            e.printStackTrace();
-        }
-        return performAction;
-    }
-
-    @Override
     protected SchedulingPolicy doPopulate(SchedulingPolicy model, 
ClusterPolicy entity) {
         return model;
     }
diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyResource.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyResource.java
index 017bb53..495c51d 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyResource.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyResource.java
@@ -1,5 +1,7 @@
 package org.ovirt.engine.api.restapi.resource;
 
+import javax.ws.rs.core.Response;
+
 import org.ovirt.engine.api.model.SchedulingPolicy;
 import org.ovirt.engine.api.resource.BalancesResource;
 import org.ovirt.engine.api.resource.FiltersResource;
@@ -66,4 +68,20 @@
         return inject(new BackendBalancesResource(guid));
     }
 
+    @Override
+    public Response remove() {
+        get();
+        Response performAction = null;
+        try {
+
+            performAction =
+                    performAction(VdcActionType.RemoveClusterPolicy, new 
ClusterPolicyCRUDParameters(asGuid(id),
+                            new 
QueryIdResolver<Guid>(VdcQueryType.GetClusterPolicyById,
+                                    
IdQueryParameters.class).lookupEntity(asGuid(id))));
+        } catch (BackendFailureException e) {
+            e.printStackTrace();
+        }
+        return performAction;
+    }
+
 }


-- 
To view, visit https://gerrit.ovirt.org/41922
To unsubscribe, visit https://gerrit.ovirt.org/settings

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

Reply via email to