+
+ return ric == null || type == null ? Mono.just(new ResponseEntity<>(HttpStatus.NOT_FOUND))
+ : Mono.just(new ResponseEntity<>(HttpStatus.LOCKED)); // Recovering
+ }
+
+ private Mono<Object> validateModifiedPolicy(Policy policy) {
+ // Check that ric is not updated
+ Policy current = this.policies.get(policy.id());
+ if (current != null && !current.ric().name().equals(policy.ric().name())) {
+ return Mono.error(new Exception("Policy cannot change RIC, policyId: " + current.id() + //
+ ", RIC name: " + current.ric().name() + //
+ ", new name: " + policy.ric().name()));
+ }
+ return Mono.just("OK");