Ori Liel has uploaded a new change for review. Change subject: restapi: Move SchedulingPolicyUnit remove to entity ......................................................................
restapi: Move SchedulingPolicyUnit 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: Ib3131d035499596c863f606afb07ae179974b516 Signed-off-by: Ori Liel <[email protected]> --- M backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyUnitResource.java M backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyUnitsResource.java M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyUnitResource.java M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyUnitsResource.java 4 files changed, 15 insertions(+), 15 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/21/41921/1 diff --git a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyUnitResource.java b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyUnitResource.java index d0dea73..40893e0 100644 --- a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyUnitResource.java +++ b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyUnitResource.java @@ -1,7 +1,9 @@ package org.ovirt.engine.api.resource; +import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.Produces; +import javax.ws.rs.core.Response; import org.ovirt.engine.api.model.SchedulingPolicyUnit; @@ -9,4 +11,7 @@ public interface SchedulingPolicyUnitResource { @GET public SchedulingPolicyUnit get(); + + @DELETE + public Response remove(); } diff --git a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyUnitsResource.java b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyUnitsResource.java index cda9ec7..f54948c 100644 --- a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyUnitsResource.java +++ b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SchedulingPolicyUnitsResource.java @@ -1,11 +1,9 @@ package org.ovirt.engine.api.resource; -import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; -import javax.ws.rs.core.Response; import org.ovirt.engine.api.model.SchedulingPolicyUnits; @@ -15,10 +13,6 @@ @GET public SchedulingPolicyUnits list(); - - @DELETE - @Path("{id}") - public Response remove(@PathParam("id") String id); @Path("{id}") public SchedulingPolicyUnitResource getSchedulingPolicyUnitSubResource(@PathParam("id") String id); diff --git a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyUnitResource.java b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyUnitResource.java index cbbabb0..794b8c47 100644 --- a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyUnitResource.java +++ b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyUnitResource.java @@ -1,10 +1,14 @@ package org.ovirt.engine.api.restapi.resource; +import javax.ws.rs.core.Response; + import org.ovirt.engine.api.model.SchedulingPolicyUnit; import org.ovirt.engine.api.resource.SchedulingPolicyUnitResource; +import org.ovirt.engine.core.common.action.VdcActionType; import org.ovirt.engine.core.common.queries.IdQueryParameters; import org.ovirt.engine.core.common.queries.VdcQueryType; import org.ovirt.engine.core.common.scheduling.PolicyUnit; +import org.ovirt.engine.core.common.scheduling.parameters.RemoveExternalPolicyUnitParameters; public class BackendSchedulingPolicyUnitResource extends AbstractBackendSubResource<SchedulingPolicyUnit, PolicyUnit> implements SchedulingPolicyUnitResource { @@ -25,4 +29,10 @@ return performGet(VdcQueryType.GetPolicyUnitById, new IdQueryParameters(guid)); } + @Override + public Response remove() { + get(); + return performAction(VdcActionType.RemoveExternalPolicyUnit, new RemoveExternalPolicyUnitParameters(guid)); + } + } diff --git a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyUnitsResource.java b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyUnitsResource.java index 1db527d..5dc8903 100644 --- a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyUnitsResource.java +++ b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSchedulingPolicyUnitsResource.java @@ -2,17 +2,13 @@ import java.util.List; -import javax.ws.rs.core.Response; - import org.ovirt.engine.api.model.SchedulingPolicyUnit; import org.ovirt.engine.api.model.SchedulingPolicyUnits; import org.ovirt.engine.api.resource.SchedulingPolicyUnitResource; import org.ovirt.engine.api.resource.SchedulingPolicyUnitsResource; -import org.ovirt.engine.core.common.action.VdcActionType; import org.ovirt.engine.core.common.queries.VdcQueryParametersBase; import org.ovirt.engine.core.common.queries.VdcQueryType; import org.ovirt.engine.core.common.scheduling.PolicyUnit; -import org.ovirt.engine.core.common.scheduling.parameters.RemoveExternalPolicyUnitParameters; public class BackendSchedulingPolicyUnitsResource extends AbstractBackendCollectionResource<SchedulingPolicyUnit, PolicyUnit> implements SchedulingPolicyUnitsResource { @@ -33,11 +29,6 @@ public List<PolicyUnit> getCollection() { return getBackendCollection(VdcQueryType.GetAllPolicyUnits, new VdcQueryParametersBase()); - } - - @Override - protected Response performRemove(String id) { - return performAction(VdcActionType.RemoveExternalPolicyUnit, new RemoveExternalPolicyUnitParameters(asGuid(id))); } @Override -- To view, visit https://gerrit.ovirt.org/41921 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3131d035499596c863f606afb07ae179974b516 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
