X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dashboard%2Fwebapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fcontroller%2FA1MediatorController.java;h=c31fc0be80b5acad5c9f36139e6f3b410833d7bf;hb=ea0bb57b5c50ec5a60901c7227bf269009120968;hp=30f4092d70330f3c17ffbd9ed242011555f93f32;hpb=64a5e9470799236f0af4ce2df98f77c94eb1bed3;p=portal%2Fric-dashboard.git diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/A1MediatorController.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/A1MediatorController.java index 30f4092d..c31fc0be 100644 --- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/A1MediatorController.java +++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/A1MediatorController.java @@ -22,18 +22,17 @@ package org.oransc.ric.portal.dashboard.controller; import java.lang.invoke.MethodHandles; import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import org.oransc.ric.a1med.client.api.A1MediatorApi; -import org.oransc.ric.a1med.client.model.PolicyTypeSchema; import org.oransc.ric.portal.dashboard.DashboardApplication; import org.oransc.ric.portal.dashboard.DashboardConstants; import org.oransc.ric.portal.dashboard.config.A1MediatorApiBuilder; import org.oransc.ric.portal.dashboard.model.SuccessTransport; +import org.oransc.ricplt.a1.client.api.A1MediatorApi; +import org.oransc.ricplt.a1.client.model.PolicyTypeSchema; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.security.access.annotation.Secured; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.GetMapping; @@ -124,16 +123,16 @@ public class A1MediatorController { @ApiOperation(value = "Creates or replaces the specified policy instance at the A1 Mediator") @PutMapping(POLICY_INSTANCE_METHOD_PATH) @Secured({ DashboardConstants.ROLE_ADMIN }) - public void createPolicyInstance(@PathVariable(DashboardConstants.RIC_INSTANCE_KEY) String instanceKey, + public ResponseEntity createPolicyInstance( + @PathVariable(DashboardConstants.RIC_INSTANCE_KEY) String instanceKey, @PathVariable(PP_TYPE_ID) Integer policyTypeId, // @PathVariable(PP_INST_ID) String policyInstanceId, - @ApiParam(value = "Policy body") @RequestBody String policyBody, // - HttpServletResponse response) { + @ApiParam(value = "Policy body") @RequestBody String policyBody) { logger.debug("createPolicyInstance: instance {} typeId {} instanceId {}", instanceKey, policyTypeId, policyInstanceId); A1MediatorApi api = a1MediatorClientBuilder.getA1MediatorApi(instanceKey); api.a1ControllerCreateOrReplacePolicyInstance(policyTypeId, policyInstanceId, policyBody); - response.setStatus(api.getApiClient().getStatusCode().value()); + return ResponseEntity.status(api.getApiClient().getStatusCode().value()).body(null); } }