X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Fcontrollers%2FPolicyController.java;h=b5388610caaec61ce538bfa77a0521344271ceee;hb=8d10bf1fee8093ec4c2a3d3530fded002daf83b6;hp=6d3f59456f8349764c6f0de87c5ed16d76d557a6;hpb=fd5e1f38fac7e52c0a975051c9e09a8b2c257bee;p=nonrtric.git diff --git a/policy-agent/src/main/java/org/oransc/policyagent/controllers/PolicyController.java b/policy-agent/src/main/java/org/oransc/policyagent/controllers/PolicyController.java index 6d3f5945..b5388610 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/controllers/PolicyController.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/controllers/PolicyController.java @@ -209,6 +209,7 @@ public class PolicyController { @RequestParam(name = "id", required = true) String instanceId, // @RequestParam(name = "ric", required = true) String ricName, // @RequestParam(name = "service", required = true) String service, // + @RequestParam(name = "transient", required = false, defaultValue = "false") boolean isTransient, // @RequestBody Object jsonBody) { String jsonString = gson.toJson(jsonBody); @@ -225,6 +226,7 @@ public class PolicyController { .ric(ric) // .ownerServiceName(service) // .lastModified(getTimeStampUtc()) // + .isTransient(isTransient) // .build(); final boolean isCreate = this.policies.get(policy.id()) == null; @@ -267,6 +269,7 @@ public class PolicyController { RejectionException e = new RejectionException("Policy cannot change RIC, policyId: " + current.id() + // ", RIC name: " + current.ric().name() + // ", new name: " + policy.ric().name(), HttpStatus.CONFLICT); + logger.debug("Request rejected, {}", e.getMessage()); return Mono.error(e); } return Mono.just("OK"); @@ -274,6 +277,7 @@ public class PolicyController { private Mono checkSupportedType(Ric ric, PolicyType type) { if (!ric.isSupportingType(type.name())) { + logger.debug("Request rejected, type not supported, RIC: {}", ric); RejectionException e = new RejectionException( "Type: " + type.name() + " not supported by RIC: " + ric.name(), HttpStatus.NOT_FOUND); return Mono.error(e); @@ -285,6 +289,7 @@ public class PolicyController { if (ric.getState() == Ric.RicState.AVAILABLE) { return Mono.just("OK"); } else { + logger.debug("Request rejected RIC not IDLE, ric: {}", ric); RejectionException e = new RejectionException( "Ric is not operational, RIC name: " + ric.name() + ", state: " + ric.getState(), HttpStatus.LOCKED); return Mono.error(e);