X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Ftasks%2FRicSynchronizationTask.java;h=a42135ef335e594696c45206ae9e27cf5c758fe2;hb=be2000ec2d21151b42cb559ef881695eb32e35e9;hp=a664b26cfb04408084a5c0ca88d962a1717958bb;hpb=4f602854561a08e754eb0c4ba9327bf49b0e63d7;p=nonrtric.git diff --git a/policy-agent/src/main/java/org/oransc/policyagent/tasks/RicSynchronizationTask.java b/policy-agent/src/main/java/org/oransc/policyagent/tasks/RicSynchronizationTask.java index a664b26c..a42135ef 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/tasks/RicSynchronizationTask.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/tasks/RicSynchronizationTask.java @@ -55,6 +55,7 @@ import reactor.core.publisher.Mono; *

* Notify subscribing services */ +@SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally public class RicSynchronizationTask { private static final Logger logger = LoggerFactory.getLogger(RicSynchronizationTask.class); @@ -72,7 +73,7 @@ public class RicSynchronizationTask { this.services = services; } - @SuppressWarnings("squid:S2629") + @SuppressWarnings("squid:S2445") // Blocks should be synchronized on "private final" fields public void run(Ric ric) { logger.debug("Handling ric: {}", ric.getConfig().name()); @@ -101,9 +102,8 @@ public class RicSynchronizationTask { return Flux.concat(recoverTypes, policiesDeletedInRic, policiesRecreatedInRic); } - @SuppressWarnings("squid:S2629") private void onSynchronizationComplete(Ric ric) { - logger.debug("Synchronization completed for: {}", ric.name()); + logger.info("Synchronization completed for: {}", ric.name()); ric.setState(RicState.IDLE); notifyAllServices("Synchronization completed for:" + ric.name()); } @@ -124,7 +124,6 @@ public class RicSynchronizationTask { } } - @SuppressWarnings("squid:S2629") private void onSynchronizationError(Ric ric, Throwable t) { logger.warn("Synchronization failed for ric: {}, reason: {}", ric.name(), t.getMessage()); // If synchronization fails, try to remove all instances @@ -137,12 +136,11 @@ public class RicSynchronizationTask { .doOnComplete(() -> deleteAllPoliciesInRepository(ric)); Flux.concat(recoverTypes, deletePoliciesInRic) // - .subscribe(x -> logger.debug("Brute recover: ", x), // + .subscribe(x -> logger.debug("Brute recover: {}", x), // throwable -> onRecoveryError(ric, throwable), // () -> onSynchronizationComplete(ric)); } - @SuppressWarnings("squid:S2629") private void onRecoveryError(Ric ric, Throwable t) { logger.warn("Synchronization failure recovery failed for ric: {}, reason: {}", ric.name(), t.getMessage()); ric.setState(RicState.UNDEFINED);